Code snippet from the FileWatcher
public boolean isModified() {
long now = System.currentTimeMillis();
if((now - lastCheck) > 1000) {
lastCheck = now;
stale = file.exists() && (file.lastModified() != lastModified);
}
return stale;
}
The check interval is 1000 ms. Unfortunately, my JUNIT tests are too
fast, so I modified the file, want to check the modifications, but
isModified returns false and my tests fail. Doing a sleep(2000) makes
the tests happy again, but I do not want to slow down the tests.
What about a property (with getter and setter, default = 1000)
milliSecsBetweenChecks
Simple exercise, I would test and commit.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel