title: java - File lastModified vs reading the file
body: <p>I am using a file and need to update value in java when  file is modified.
  So, I am thinking to check modified time using <code>lastModified</code> of <code>File</code> class, and if modified read the file and update single property from the file.</p>
  
  <p>My doubt is, is <code>lastModified</code> as heavy as reading single property from the file/reading whole file. Because my test results are showing almost same results.</p>
  
  <p>So is it better to read file and update property from the file everytime or checking <code>lastModified</code> is better option in long run.</p>
  
  <p><strong>Note</strong>: This operation is performed every one minute.</p>
  
  <p>Or is there any better option than polling lastModified to check if file has changed. I am using java 6.</p>