Editing properties file from java class
I am using the MVC model for developing a web application. I am using a properties file for store some settings.I am trying to change the value of a key in the property file using the following code.
publicvoid setValue(String thekey, String thevalue)throws IOException{
Properties prop =new Properties();
FileOutputStream out =new FileOutputStream("browserpush.properties");
prop.setProperty(thekey,thevalue);
prop.store(out,null);
prop.list(System.out);
out.close();
}
The above code completely erases all the other values inbrowserpush.properties and creates a new one with only the specified parameters(thekey,thevalue).
clearly i just want to change the value of one of the keys in thebrowserpush.properties file with other values unchanged.
do i need to load the whole property file, remove the particular key and add the key again with new value before outputting it? or any other solution?
Thanks in advance

