如何使用 org.apache.commons.configuration.PropertiesConfiguration 创建分隔符之间没有空格的属性?

How to create properties without white spaces between separator using org.apache.commons.configuration.PropertiesConfiguration?

需要使用 org.apache.commons.configuration.PropertiesConfiguration 编写属性文件,它的格式应该类似于 variablename=variablevalue,并且分隔符之间没有空格。有没有办法使用 apache commons-configuration 来实现?

我当前的实现:

PropertiesConfiguration conf = new PropertiesConfiguration("test.properties");
conf.setProperty("key1","value1");
conf.save();

结果:

key1 = value1

预期结果:

key1=value1

文档在这里:https://commons.apache.org/proper/commons-configuration/userguide_v1.10/howto_properties.html

未经测试,但我想是这样的:

conf.getLayout().setGlobalSeparator("=");