commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [CONFIGURATION] preserve mulitline property over load and save
Date Tue, 13 Sep 2011 22:06:54 GMT
On 13 September 2011 21:31, Oliver Heger <oliver.heger@oliver-heger.de> wrote:
> Hi Wieland,
>
> Am 13.09.2011 18:19, schrieb Wieland Gmeiner:
>>
>> Hi,
>>
>> i have property values spanning multiple lines like
>>
>>       value = aaa, \
>>                    bbb
>>
>> When I load this into a PropertiesConfiguration and later store to a
>> file I can only achieve two results,
>>
>> * having everything on one line like
>>
>>      value = aaa,bbb
>>
>> * or a mulitvalue property like
>>
>>      value = aaa
>>      value = bbb
>>
>> Is there a possiblity to tweak the PropertiesConfiguration so that it
>> preserves the original layout over a load/store cycle?

Why do you want to do this?

> unfortunately, there is no such possibility currently. When the properties
> file is read the backslash as line combiner is processed, and the value is
> stored without any information about a line break.
>
> I fear that implementing such a feature would not be trivial. You would
> probably have to invent a format which tells the configuration that a
> property should span multiple lines, but the line break character must not
> be mixed up with regular content of the property value.
>
> If you have concrete ideas how to solve this, you might want to open a
> feature request in our bug tracking system [1].

It would be quite easy to save all multi-valued properties with \ and
line-break between values (as 3rd option), but that would not
necessarily preserve the exact original format.

And of course the order would almost certainly be different.

> Oliver
>
> [1] http://commons.apache.org/configuration/issue-tracking.html
>
>>
>> Thanks,
>> Wieland
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Mime
View raw message