I have faced a difficult situation where one of the scenario require to write and preserve comments in configuration file. I tried using properties file and ini file concept using java. But when we write back to the file for storing configuration information, the entire comments in the proprieties or ini file get lost.
At last after a frantic search, I got the following free library which will help you to store configuration in an ini file where you can read and write and it will preserve any comments wrtitten at the top of the file.
At last after a frantic search, I got the following free library which will help you to store configuration in an ini file where you can read and write and it will preserve any comments wrtitten at the top of the file.
http://ini4j.sourceforge.net/tutorial/IniTutorial.java.html
Hi,
ReplyDeleteI have a same problem I am updating a property file in java. But all the existing comments get deleted. Can you show me a small demo for the same ?