title: How to update a property file?
body: <p>i am using the classLoader method to load a property file. Using this, I am able to retrieve the values of properties but now I want to update the values of some properties and i am not able to do it. Please help. Here, is the code:</p>
  
  <p>InputStream inputStream = this.getClass().getClassLoader()
    .getResourceAsStream("PublishDate.properties");</p>
  
  <pre><code>try {
      Properties properties = new Properties();
  
      try {
         // load the inputStream using the Properties
         properties.load(inputStream);
      }
      catch(Exception e) {
         e.printStackTrace();
      }
      // get the value of the property
      String propValue = properties.getProperty("lastHtlProcessPublishDate");
  </code></pre>
  
  <p>here, in propValue i get the right value from file. I am updating this like this:</p>
  
  <pre><code>properties.put("lastHtlProcessPublishDate",dateFormatter.format(new Date()));   
  properties.store(new FileOutputStream("PublishDate.properties"), null);
  </code></pre>
  
  <p>Using this the value doesn't get update but when i provide the complete path for <code>PublishDate.properties</code> then it works.
  But, I don't want to give the complete path as the path is dynamic. Does someone knows how to do this using some relative path. Please advise me on this.</p>