A better class to update property files?

后端 未结 8 2005
不思量自难忘°
不思量自难忘° 2020-12-01 10:27

Though java.util.properties allows reading and writing properties file, the writing does not preserve the formatting. Not surprising, because it is not tied to

8条回答
  •  悲哀的现实
    2020-12-01 10:54

    The best answer contains a small mistake: The line:

    PropertiesConfigurationLayout layout = new PropertiesConfigurationLayout(config);
    

    Must be replaced by:

    PropertiesConfigurationLayout layout = config.getLayout();
    

提交回复
热议问题