private void poll() {
    try {
      long timeStampMillis = Files.getLastModifiedTime(path).toMillis();
      if (timeStampMillis != lastModifiedTimeMillis) {
        logger.debug("Detected update for {}", path);
        lastModifiedTimeMillis = timeStampMillis;
        onUpdate.run();
      } else {
        logger.debug("No change detected for {}", path);
      }
    } catch (Exception e) {
      logger.debug("Error watching {}", path, e);
      onError.run();
    }
  }
Watches a single file for changes by polling the last modified time on the file.

<p>
Note: {@link WatchService} is not used here because it has problems with container file systems
and remote file systems.
<p>
geode-core/src/main/java/org/apache/geode/internal/net/filewatch/PollingFileWatcher.java