Class FileWatcher

All Implemented Interfaces:
ResourceWatcher

public class FileWatcher extends AbstractResourceWatcher<FileChangesListener>
File resources watcher The file watcher checks directory and all its subdirectories for file changes and notifies its listeners accordingly
  • Constructor Details

    • FileWatcher

      public FileWatcher(Path path)
      Creates new file watcher on the given directory
      Parameters:
      path - the directory to watch
    • FileWatcher

      public FileWatcher(Path path, boolean checkFileContents)
      Creates new file watcher on the given directory
      Parameters:
      path - the directory to watch
      checkFileContents - whether to inspect the content of the file for changes (via a message digest) - this is a "best efforts" check and will err on the side of sending extra change notifications if the file might have changed.
  • Method Details