title: How to save Java properties file to classpath?
body: <p>To load a properties file from classpath, we can simply do:</p>
  
  <pre><code>InputStream inputStream = CommonUtils.class.getClassLoader().getResourceAsStream("com/abc/resources/config.properties");
  prop.load(inputStream);
  </code></pre>
  
  <p>After above step, all properties are correctly loaded. But how can I change a property and save it back to the same file on the fly? (Below doesn't work)</p>
  
  <pre><code>OutputStream outputStream = new FileOutputStream("com/abc/resources/config.properties");
  prop.setProperty(key, value);
  prop.store(outputStream, null);
  </code></pre>