title: Updating a file in java having values in form of key-value
body: <p>I have a requirement to update a file (just one particular row) which contains value in form of key value.</p>
  
  <pre><code>app.num_hosts=4
  app.resourceid=broker0
  </code></pre>
  
  <p>I was planning to read all the file in a map, then modify the particular field and rewrite the file. Is this a good way to do update a file? Which API could i use to write a map into a file?</p>
  
  <p>By searching through the existing questions i couldn't find a way to do update just single row without rewriting the entire file. </p>