commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@apache.org>
Subject Re: First post, ExtendedProperties question
Date Wed, 14 May 2008 09:53:37 GMT
csanders a écrit :

> We have a project that uses Velocity, which uses ExtendedProperties, 
> which we want to extend to interpolate environmental variables and 
> system properties.
> 
> Does anyone have any objection / suggestion for this ?  Is we write the 
> patch is this something that could be included ?

An alternative is to build a Configuration with Commons Configuration 
that performs the interpolation you want, and then turn it into an 
ExtendedProperties.

The code would look like this:

CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(new SystemConfiguration());
config.addConfiguration(new EnvironmentConfiguration());
config.addConfiguration(new PropertiesConfiguration("conf.properties"));

ExtendedProperties props = 
ConfigurationConverter.getExtendedProperties(config);


Emmanuel Bourg



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


Mime
View raw message