You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Kenji Nakamura <ke...@clazzsoft.com> on 2006/01/14 00:03:50 UTC
[configuraiton] Save multiple values in one line
Hi,
I just started to explorer commons-configuration, and got the
following problem.
I'd like to save a property to a file with List type value in one line.
By default, the output looks like this.
key = value1
key = value2
I want to make the output like this.
key = value1, value2
I managed to do this by setting "0" temporarily as the delimiter in
ProeprtiesConfiguration. However, even after I set back the original
delimiter ',', calling getList() returns a single entry containing
"value1,value2" as the value.
In addition to that, I don't want to change the delimiter because it
is static and affects all threads using AbstractConfiguration and the
subclasses.
Is there a way to save list values in one-line without resorting to
changing the delimiter temporarily?
Thanks in advance,
--
Kenji Nakamura
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [configuraiton] Save multiple values in one line
Posted by Oliver Heger <ol...@t-online.de>.
Kenji Nakamura wrote:
>Hi,
>
>I just started to explorer commons-configuration, and got the
>following problem.
>I'd like to save a property to a file with List type value in one line.
>By default, the output looks like this.
>key = value1
>key = value2
>
>I want to make the output like this.
>key = value1, value2
>
>I managed to do this by setting "0" temporarily as the delimiter in
>ProeprtiesConfiguration. However, even after I set back the original
>delimiter ',', calling getList() returns a single entry containing
>"value1,value2" as the value.
>In addition to that, I don't want to change the delimiter because it
>is static and affects all threads using AbstractConfiguration and the
>subclasses.
>
>Is there a way to save list values in one-line without resorting to
>changing the delimiter temporarily?
>
>Thanks in advance,
>
>--
>Kenji Nakamura
>
>
>
PropertiesConfiguration ATM always writes multiple lines when a property
has multiple values. I think, it would be a good idea to make this more
flexible. Could you please open a new enhancement request for this
feature in bugzilla (see
http://jakarta.apache.org/commons/configuration/issue-tracking.html)? It
should not be too complicated to implement.
Thanks,
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org