Need to write a properties file using org.apache.commons.configuration.PropertiesConfiguration and it should have a format like variablename=variablevalue without having whitespaces between the separator. Is there a way to achieve that using apache commons-configuration?
My current implementation :
JavaScript
x
PropertiesConfiguration conf = new PropertiesConfiguration("test.properties");
conf.setProperty("key1","value1");
conf.save();
Result :
JavaScript
key1 = value1
Expected Result :
JavaScript
key1=value1
Advertisement
Answer
Docs are here: https://commons.apache.org/proper/commons-configuration/userguide_v1.10/howto_properties.html
Untested but I imagine this does it:
JavaScript
conf.getLayout().setGlobalSeparator("=");