Tuesday, October 27, 2009

ini file which helps you to preserve comments while updating

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.

http://ini4j.sourceforge.net/tutorial/IniTutorial.java.html

1 comment:

  1. Hi,

    I 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 ?

    ReplyDelete