My property file has properties like below:
#property1=
property2=asd
Is there a proper way to un comment and change the property1? I was looking at Apache Commons but there seems to be no non-ugly way to do this. The following wont work as the commented out property wont be read in the first place.
PropertiesConfiguration config = new PropertiesConfiguration();
PropertiesConfigurationLayout layout = new PropertiesConfigurationLayout(config);
layout.load(new InputStreamReader(new FileInputStream(new File(filePath))));
config.setProperty("#property1", "new_value");
FileWriter propsFile = new FileWriter(filePath, false);
layout.save(propsFile);