Skip to content

Instantly share code, notes, and snippets.

@billy-bacon
Created October 9, 2013 20:35
Show Gist options
  • Save billy-bacon/6907900 to your computer and use it in GitHub Desktop.
Save billy-bacon/6907900 to your computer and use it in GitHub Desktop.
Guice Names.bindProperties
public void bindProperties(Binder binder, String propertiesFile) {
log.info("binding {}", propertiesFile);
try {
final Properties props = new Properties();
props.load(this.getClass().getClassLoader().getResourceAsStream(propertiesFile));
Names.bindProperties(binder, props);
} catch (IOException e) {
throw new RuntimeException("Could not load " + propertiesFile, e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment