commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: PropertiesConfiguration: about properties referencing other properties
Date Tue, 06 Nov 2007 20:38:00 GMT
nocturna_gr wrote:
> Sorry, i forgot the RES_DIR line... Now i have changed it, but there was a
> RES_DIR defined upon BASE_DIR, that is:
> BASE_DIR=C:/Documents and Settings/paxosk/Desktop/projects/SQOSS/src/
> RES_DIR=${BASE_DIR}some/path
> LOG_MAIL_FILE=${RES_DIR}resources/logs/MailInserter.txt

The getProperty() method you are using is intended for low-level access 
to properties. It returns the "raw" property value without doing any 
interpolation.

Try getString() instead. This method will resolve your variable.

Oliver

> 
> 
> 
> nocturna_gr wrote:
>> Hi,
>> i have this properies file:
>> BASE_DIR=C:/Documents and Settings/paxosk/Desktop/projects/SQOSS/src/
>> LOG_MAIL_FILE=${RES_DIR}resources/logs/MailInserter.txt
>>
>> and this code:
>>     public static void main(String[] args) throws Exception
>>     {
>>         PropertiesConfiguration conf=new PropertiesConfiguration();
>>         conf.load(new FileInputStream("C:/Documents and
>> Settings/paxosk/Desktop/projects/SQOSS/src/resources/all.properties"));
>>         System.err.println((String)conf.getProperty("LOG_MAIL_FILE"));
>>     }
>>
>> The problem is that it prints:
>> ${RES_DIR}resources/logs/MailInserter.txt, without parsing the RES_DIR...
>> How can i fix that?
>>
>> Thanks
>>
>>
> 


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


Mime
View raw message