Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a java library for manipulating *.properties files

Tags:

java

I plan to write a utility for commenting/uncommenting/editing properties inside *.properties files. i know i can read/modify/write those using the Properties class, but im looking for a library that will let me access things like commented lines, preserve formatting and line order when writing back etc.

does such a library exist?

like image 830
radai Avatar asked Dec 27 '12 08:12

radai


1 Answers

The closest thing I am aware of is Apache Commons Configuration. Take a look on PropertiesConfiguration.

EDIT Create a PropertiesConfigurationLayout object from your properties then you will be able to keep the information about whitespaces and comments. It also will help you to keep track on properties changes

like image 163
aviad Avatar answered Oct 21 '22 12:10

aviad