Reputation: 24192
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?
Upvotes: 8
Views: 1632
Reputation: 8278
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
Upvotes: 6