X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fdatarouter%2Futil%2FFileWatcher.java;h=8ae69d3799cc489db88cb678196c8f784dcb4995;hb=71088aaf4cf7d8d7182bd0cfe9943781e1538d44;hp=5b0431084ba2c277cc3b10bd8385a1713543bfe7;hpb=44565e3e7b6927926293f067a270367f4dff7150;p=aai%2Fdata-router.git diff --git a/src/main/java/org/openecomp/datarouter/util/FileWatcher.java b/src/main/java/org/openecomp/datarouter/util/FileWatcher.java index 5b04310..8ae69d3 100644 --- a/src/main/java/org/openecomp/datarouter/util/FileWatcher.java +++ b/src/main/java/org/openecomp/datarouter/util/FileWatcher.java @@ -34,14 +34,15 @@ public abstract class FileWatcher extends TimerTask { this.timeStamp = file.lastModified(); } + @Override public final void run() { - long timeStamp = file.lastModified(); + long newTimeStamp = file.lastModified(); - if ((timeStamp - this.timeStamp) > 500) { - this.timeStamp = timeStamp; + if ((newTimeStamp - this.timeStamp) > 500) { + this.timeStamp = newTimeStamp; onChange(file); } } protected abstract void onChange(File file); -} \ No newline at end of file +}