S
Sanjay
I am wondering whether anybody know a way to load a properties file with
comments.
My problem is that I need to read a sample configuration file (same
format as java properties file) which has many sections in it and each
section has section name and some comments. This properties file is
bundled into a jar file. Then depending on some user input, I will
change some of the properties and then write the file to some other
location. However, I need to keep the format the same, including the
section comments and line breaks before them.
java.util.Properties seems to be a good fit for this purpose to me as I
can use load() and store() methods with pretty much no other code. Is
there a better way to do this? Thanks.
Sanjay
comments.
My problem is that I need to read a sample configuration file (same
format as java properties file) which has many sections in it and each
section has section name and some comments. This properties file is
bundled into a jar file. Then depending on some user input, I will
change some of the properties and then write the file to some other
location. However, I need to keep the format the same, including the
section comments and line breaks before them.
java.util.Properties seems to be a good fit for this purpose to me as I
can use load() and store() methods with pretty much no other code. Is
there a better way to do this? Thanks.
Sanjay