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

        

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to