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] Variable Interpolation doesn't happen in subset() and configurationAt()
Date Sat, 02 Dec 2006 18:12:26 GMT
Mark,

I can now reproduce the problem. In this code fragment you call subset() 
rather than configurationAt(), and here interpolation fails. I have 
created a bug report for this problem [1].

Thanks
Oliver

[1] https://issues.apache.org/jira/browse/CONFIGURATION-242

Mark Diggory wrote:
> Actually, your example works for me too, but my real case still doesn't
> heres more detail:
> 
> my instatiation of Configuration looks more like this
> 
> CombinedConfiguration configuration = new CombinedConfiguration();
>> configuration.addConfiguration(
>>                 new PropertiesConfiguration(new
>> File(configProperty).toURL())
>>             );
>>
> 
> My properties file looks like this:
> 
> # DSpace installation directory
>> dspace.dir = /dspace
>> # Example Apache HTTPD configuration
>> # config.template.apache13.conf = ${dspace.dir}/config/httpd.conf
>> config.template.log4j.properties = ${dspace.dir}/config/log4j.properties
>> config.template.log4j-handle-plugin.properties = ${dspace.dir
>> }/config/log4j-handle-plugin.properties
>> config.template.oaicat.properties = 
>> ${dspace.dir}/config/oaicat.properties
>>
> 
> I then go on to do my test:
> 
> 
>>         System.out.println(configuration.getString("dspace.dir"));
>>         System.out.println(configuration.getString("
>> config.template.log4j.properties"));
>>         System.out.println(configuration.getString("
>> config.template.log4j-handle-plugin.properties"));
>>         System.out.println(configuration.getString("
>> config.template.oaicat.properties"));
>>
>>         Configuration subset = configuration.subset("config.template");
>>
>>         this.assertEquals(
>>                     configuration.getString("
>> config.template.log4j.properties"),
>>                     subset.getString("log4j.properties")
>>                     );
>>
>>         this.assertEquals(
>>                 configuration.getString("
>> config.template.log4j-handle-plugin.properties"),
>>                 subset.getString("log4j-handle-plugin.properties")
>>                 );
>>
>>         this.assertEquals(
>>                 
>> configuration.getString("config.template.oaicat.properties
>> "),
>>                 subset.getString("oaicat.properties")
>>                 );
>>
>>
> 
> Thanks,
> Mark

<snip/>

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


Mime
View raw message