commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: [Configuration] support for a slightly different format for multi-line properties ?
Date Fri, 21 Mar 2008 17:40:39 GMT
Gavin Eadie schrieb:
> I have a need to read properties from a file of the form:
> key this sentence is
>   the value of the key.
> that is, the multi-line string value of the key is signaled by leading 
> white space on the second and subsequent lines, rather than the use of 
> "\" on each previous line.  Is there a neat way to coerce 
> common-configuration into parsing this as I want it?  Could I override 
> PropertiesConfiguration.PropertiesReader for example to get this effect?
> Thanks for any suggestions .. Gavin

After having a look at the code I don't see an easy way to achieve this. 
Overriding PropertiesReader would probably not help you because
1) there is no easy way to tell PropertiesConfiguration (or its layout 
object) to use your derived class and
2) there is no simple hook in PropertiesReader for inserting your custom 
line end parsing.

What you of course can do is implementing your own reader that extracts 
the properties and adds them to a newly created PropertiesConfiguration 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message