I have to read/edit a properties file WITH comments and write it back in the same file with the same structure.
The reading of the properties is not the problem, I don’t get it to read the file line by line and replace the selected settings.
For an example:
I found at stackoverflow to read properties line by line with comment but didn’t work in my project and the comments will show as ## without any comment text and properties.
The properties will be saved in an Arraylist to compare in another bean with some values and there I want to save the changed properties.
Now what I actually have:
my central language handler, I compare the settings and write it back in the properties file
here is my properties reader
The change works fine but the structured properties file is destroyed (unsorted) and without any comments