[Geoserver-devel] [jira] Created: (GEOS-4610) FileWatcher.java does not recognize restored files

FileWatcher.java does not recognize restored files
--------------------------------------------------

                 Key: GEOS-4610
                 URL: http://jira.codehaus.org/browse/GEOS-4610
             Project: GeoServer
          Issue Type: Bug
          Components: Global
    Affects Versions: 2.2.x
            Reporter: Christian Mueller
            Assignee: Christian Mueller
            Priority: Minor
             Fix For: 2.2.x

FileWatcher.java

Method:

     public boolean isModified() {
         long now = System.currentTimeMillis();
         if((now - lastCheck) > 1000) {
             lastCheck = now;
             stale = file.exists() && (file.lastModified() > lastModified);
         }
         return stale;
     }

A file is recognized as modified if the last modified timestamp is newer as the last known timestamp. In case of restoring a file with a backup/restore utility, the timestamp could be older. Replacing > with != gives

stale = file.exists() && (file.lastModified() != lastModified);

This will do the job.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira