commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Wendland <OleWendl...@gmx.de>
Subject [Configuration] problems with changing the delimiter
Date Tue, 20 Feb 2007 17:17:57 GMT
Hello Guys,
please tell me whats the problem with this delimiter.
The Program is this one:

import org.apache.commons.configuration.*;
import java.io.*;
import java.util.List;
 
class SaveProperties
{    
  public static void main( String[] args )
  {

      try {    
        PropertiesConfiguration config = new 
PropertiesConfiguration("test.txt");
         config.setListDelimiter('|');
        
System.out.println(System.out.println(config.getList("test").get(0));

    } catch (ConfigurationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
  }
}

and the test.txt looks like this
test = one|two|three

The output I expect should be "one" but he can't split the List and 
gives me  "one|two|three". When I use a comma as Delimiter is everything 
fine.
What is my mistake?

Greetings Ole

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


Mime
View raw message