title: Commenting out a property in a Property file
body: <p>I am using java to manipulate a property file. I have a requirement like I have to comment out a property value before updating and add that property with new value. Like</p>
  
  <blockquote>
    <p>path=c:\</p>
  </blockquote>
  
  <p>after I update it should be like</p>
  
  <blockquote>
    <p>#path=c:\<br>
    path=c:\my_folder</p>
  </blockquote>
  
  <p>Is it possible to achieve this ? Below is the code I use for editing property file.</p>
  
  <pre><code>        Properties prop=new Properties();
          String currentDirectary=System.getProperty("testDir");
          String path=currentDirectary+"/test.Properties";
          FileOutputStream out=new FileOutputStream(path,true);
          prop.setProperty("path","c:\\my_folder");
          prop.store(out, null);
  </code></pre>