I wrote a micro-framework for exactly that purpose - binding strings to contents from properties files, on top of another micro-framework for loading them without hard-coding paths (you can have system defaults in /etc/myapp.properties overlaid with ~/myapp.properties overlaid with ./myapp.properties and it takes care of binding them to @Named) - which might be helpful:
https://github.com/timboudreau/giulius and the javadoc here: http://timboudreau.com/builds/job/giulius/lastSuccessfulBuild/artifact/giulius-settings/target/site/apidocs/index.html http://timboudreau.com/builds/job/giulius/lastSuccessfulBuild/artifact/giulius/target/site/apidocs/index.html If you need values before the injector is created, you'll want to work directly with a Settings object (like a Properties without mutator methods - see the last javascript link), but you could just as easily write a Provider that uses @Named to get the string and initializes it on first use. -Tim -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
