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 21:00:04 GMT
csanders a écrit :
> Yep, here is the code:
> 
>            CompositeConfiguration config = new CompositeConfiguration();
>            config.addConfiguration(new SystemConfiguration());
>            config.addConfiguration(new EnvironmentConfiguration());
>            config.addConfiguration(new 
> PropertiesConfiguration(Config.velocity_properties_file));
>                      
> System.out.println(config.getProperty("file.resource.loader.path") );
>            System.out.println(config.getProperty("TEMPLATE_HOME") );
> 
>            ExtendedProperties configuration = 
> ConfigurationConverter.getExtendedProperties(config);
> 
> TEMPLATE_HOME is the env var, and the getProperty() does expand it, but 
> the file.resource.loader.path just returns ${TEMPLATE_HOME} .

config.getProperty() doesn't perform the interpolation, it returns the 
raw property. You have to use config.getString() to retrieve the 
interpolated value.

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