I'm using commons-configuration v1.10 and I'm using the class PropertiesConfiguration
to read in my applications properties. I have a property which has commas in it, but when I read it in, it gets delimited, and I can't figure out how to get it not to.
It spits back the property all in order and commas included, but the reason why it's being a problem is because I get '[' and ']' surrounding it.
AbstractConfiguration
has a function, setDelimiterParsingDisabled()
, that disables delimiting, but I couldn't find a class which implemented it to read property files.
private static String readProperty(String property) {
try {
Configuration configuration = new PropertiesConfiguration(propertiesFile);
return configuration.getProperty(property).toString();
}
catch(ConfigurationException e) {
System.out.println("Issue reading " + property + " property");
e.printStackTrace();
System.exit(1);
return "";
}
}