Skip to content

Instantly share code, notes, and snippets.

@shooley
Created March 29, 2011 13:42
Show Gist options
  • Save shooley/892377 to your computer and use it in GitHub Desktop.
Save shooley/892377 to your computer and use it in GitHub Desktop.
Commons Configuration Property Manager
import org.apache.commons.configuration.CombinedConfiguration;
public class PropertyManager {
private String YOUR_PROPERTY_FILE = "properties.xml";
private static CombinedConfiguration combinedConfiguration =
CommonsConfigurationUtility
.createConfiguration(YOUR_PROPERTY_FILE);
private PropertyManager() { }
public getProperty(String key) {
return combinedConfiguration.getString(key);
}
public getPropertyList(String propertyList) {
return combinedConfiguration.getStringArray(propertyName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment