Class SynchronousFileWatcher

java.lang.Object
org.apache.nifi.util.file.monitor.SynchronousFileWatcher

public class SynchronousFileWatcher extends Object
Allows the user to configure a Path to watch for modifications and periodically poll to check if the file has been modified
  • Field Details

  • Constructor Details

    • SynchronousFileWatcher

      public SynchronousFileWatcher(Path path, UpdateMonitor monitor)
    • SynchronousFileWatcher

      public SynchronousFileWatcher(Path path, UpdateMonitor monitor, long checkMillis)
  • Method Details

    • checkAndReset

      public boolean checkAndReset() throws IOException
      Checks if the file has been updated according to the configured UpdateMonitor and resets the state
      Returns:
      true if updated; false if not updated or if not yet time to check
      Throws:
      IOException - if failure occurs checking for changes
    • checkForUpdate

      private boolean checkForUpdate() throws IOException
      Throws:
      IOException