Apache Commons PropertiesConfiguration escapes characters on Save [migrated]
- by Anuvrat
I am using the commons-configuration from apache commons library. I have a properties file which has properties like:
blog_loc=http://my.blog.com
blog_name="my blog name"
I open the properties file, change the blog_name property and save the file. The following are the lines of code I use:
PropertiesConfiguration propertyFile = new PropertiesConfiguration(propertyFileName);
propertyFile.setProperty(blog_name, "blog name");
propertyFile.save(propertyFileName + ".out");
Unfortunately, in the output file certain characters get escaped as follows:
blog_loc=http:\/\/my.blog.com
blog_name=\"blog name\"
Is there any way of preventing escaping of the above characters?