How would someone specify that strategy from the xml specification of
the search? Wouldn't it need to be part of commons-config?

Joel

-----Original Message-----
From: Emmanuel Bourg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 15, 2005 4:37 AM
To: Jakarta Commons Developers List
Subject: Re: [CONFIGURATION] Conglomeration Properties file

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.prop
erties");

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

Emmanuel Bourg


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



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

Reply via email to