I've tried commons configuration, and I find to quite usable. Good work!
Thanks ! Glad to hear you found it useful :)
There is one thing I didn't manage to do (or understand how to do). As an example I'm building a test appliction in which there exist a default configuration loaded off the classpath.
How can I add a configuration file specified by the user, perhaps as an argument on the command line?
From what I understand the ConfigurationFactory needs a URL to an XML file containing reference to which configuration files to load. Is this right?
You could use the ConfigurationFactory, but since the user file isn't known it's easier to build a CompositeConfiguration directly. It would look like this:
CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(new PropertiesConfiguration("default-config.properties"));
if (userConfig != null) {
config.addConfiguration(new PropertiesConfiguration(userConfig));
}
Emmanuel Bourg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
