Joel Trunick wrote:
Has someone written a Properties File configuration that will combine a
bunch of properties file on the classpath into one properties "file"?
Basically, it should take a single file name, and do a
Class.getResources(), combining all the properties into one.

I only ask because it sounds obvious, but I don't see one in the
package. Shouldn't this be trivial?

Hi Joel, that's quite easy to implement with a CompositeConfiguration. The code would look like this :

CompositeConfiguration conf = new CompositeConfiguration();
Enumeration<URL> e = Thread.currentThread().getContextClassLoader().getResources("config.properties");

while (e.hasMoreElements()) {
    conf.addConfiguration(new PropertiesConfiguration(e.nextElement()));
}

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to