How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Hi, Configuration (XmlConfiguration) getString returns (^|\\s)#([1-9][0-9]{3 for config.getString([EMAIL PROTECTED]). How can I get the entire String? scc task_expression=(^|\\s)#([1-9][0-9]{3,}) / I use 1.1RC2. Zsolt - To

Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Oliver Heger
You have hit a known limitation: The configuration interprets the , as a property delimiter and inserts two values for this key. For more details see here: http://issues.apache.org/bugzilla/show_bug.cgi?id=29716 So config.getString([EMAIL PROTECTED](0)) will return the first part of the

Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Oliver Heger
Oh, I forgot an important point: you can escape the delimiter using a backslash. So if your configuration file contains: scc task_expression=(^|\\s)#([1-9][0-9]{3\,}) / the entire string should be returned. Oliver Oliver Heger wrote: You have hit a known limitation: The configuration interprets

AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Thank you Oliver, unfortunately I cannot do that because we have to assure compatibility (with the version where we didn't use commons-configuration), thus here is my code: List exprs = config.getList([EMAIL PROTECTED]); if (!exprs.isEmpty()) { sccTaskIdExpression =

Re: AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Emmanuel Bourg
You can also disable the string splitting by changing the delimiter to a char unlikely to be found in your configuration: XMLConfiguration conf = new XMLConfiguration(); conf.setDelimiter('\u'); conf.setFilename(conf.xml); conf.load(); We will have a cleaner solution when Bug 29716 is fixed

AW: AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Sorry, but this doesn't work with 1.1RC2. XMLConfiguration config = new XMLConfiguration(); AbstractConfiguration.setDelimiter('\u'); char del = AbstractConfiguration.getDelimiter(); log.debug(Delimiter + del + ); config.setFile(file); config.load(); CompositeConfiguration cc = new

Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Emmanuel Bourg
Sorry I forgot the method was static. Try this instead: XMLConfiguration config = new XMLConfiguration(); XMLConfiguration.setDelimiter('\u'); Emmanuel Bourg Zsolt Koppany wrote: Sorry, but this doesn't work with 1.1RC2. XMLConfiguration config = new XMLConfiguration();

AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
setDelimiter is in AbstractConfiguration and XMLConfiguration doesn't overwrite it. Again: I'm using 1.1RC2, I don't have the source code of 1.1-RC2 thus I cannot check it. Zsolt -Ursprüngliche Nachricht- Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 30. März

Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Ha ryon
maybe try : AbstractConfiguration.setDelimiter('\u'); XMLConfiguration config = new XMLConfiguration(); I would assume that, it's better to change a static parameter before an instance that need the change is created. On Wed, 30 Mar 2005 17:24:12 +0200, Zsolt Koppany [EMAIL PROTECTED]

Re: How to get the entire string with Configuration.getString

2005-03-30 Thread Emmanuel Bourg
The code I suggested does work, there is a test case with a similar syntax, see testChangingDelimiter() in TestPropertiesConfiguration: http://svn.apache.org/repos/asf/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java This will

AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
I also tried that, didn't work either. Zsolt -Ursprüngliche Nachricht- Von: Ha ryon [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 30. März 2005 17:32 An: Jakarta Commons Users List Betreff: Re: How to get the entire string with Configuration.getString maybe try :

AW: How to get the entire string with Configuration.getString

2005-03-30 Thread Zsolt Koppany
Can it be an xmlconfiguration problem? -Ursprüngliche Nachricht- Von: Emmanuel Bourg [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 30. März 2005 17:59 An: Jakarta Commons Users List Betreff: Re: How to get the entire string with Configuration.getString The code I suggested does