commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [Configuration]: Classpath resource in composite configuration
Date Thu, 21 Feb 2008 06:59:15 GMT
uma_rk@comcast.net schrieb:
> I am using commons configuration ver. 1.2.
> 
> I would like ot define a composite configuration in which 
> one or more items are classpath resources as in:
> 
>   <configuration>
>       <properties fileName="usergui.properties"/>
>       <xml fileName="classpath:/gui.xml"/>
>   </configuration>
> 
> Is this somehow possible? Even if the syntax above is not supported, 
> how can I accomplish the same result alternatively? That is,
> I would like to create a composite configuration in which one or more
> resources are loaded off the classpath.
> 
> Thanks,
> 
> /U
> 

In recent versions of commons configuration the class path is 
automatically searched for configuration files. I am not sure whether 
this is true for 1.2. (I guess there is a reason why you have to use 
this old version.)

What probably will work is to load the configuration definition file 
itself from the class path and specify relative paths to the 
configuration files to be loaded. If the application is correctly 
packaged, the files should be found.

There is also some information available at [1].

HTH
Oliver

[1] 
http://commons.apache.org/configuration/userguide-1.2/howto_configurationfactory.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message