title: File validation for modification and correction
body: <p>My application (RCP plugin desktop based) is writing some config and text files for its further use, which can be modified by user.</p>
  
  <p><strong>MY LOGIC:</strong> I have written a validation logic with the help of last modification time and got validation whether file is changed or not.</p>
  
  <p><strong>IMPROVEMENT NEEDED:</strong> Now I want if user omit the changes then treat file as a valid one, which last modified time logic will treat as a invalid.</p>
  
  <p>So what changes are required in my logic or any other move can i take. </p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>this is quite straight logic that i have taken: A map which hold the last modified time and get validated as... </p>
  
  <pre><code>if (lastModifiedMap.containsKey(f.getPath()))
          {
              long fileModTime = lastModifiedMap.get(f.getPath());
  
              if (f.lastModified() &gt; fileModTime)
              {
                  System.err
                  .println(f.getName()
                          + "::file has changed");
  
                  return false;
              }
  
              else if (f.lastModified() == fileModTime)
              {
                  System.out.println("File is not modified");
                  return true;
              }
          }
  
          return false;
  </code></pre>