Class FileWatcherExecutorService

java.lang.Object
org.chenile.filewatch.handler.FileWatcherExecutorService

public class FileWatcherExecutorService extends Object
The main file for file watch This allows the handler to register FileWatchDefinition. It also starts the file watch by executing the FileWatcher in a separate thread. Once a file is discovered by the file watcher, this class picks it up and hands it over to the fileProcessor for further processing.
Author:
Raja Shankar Kolluru
  • Field Details

  • Constructor Details

    • FileWatcherExecutorService

      public FileWatcherExecutorService(String baseWatchFolder, String baseProcessedFolder, int pollTimeInSeconds, FileSystem fileSystem)
  • Method Details

    • registerWatch

      public void registerWatch(FileWatchDefinition fileWatchDefinition)
    • processExisting

      private void processExisting(FileWatchDefinition fileWatchDefinition, Path watchDir, Path processedDir)
    • startWatch

      public void startWatch()
    • handleFile

      public void handleFile(WatchKey key, Path fileSeen)
      This will be the callback for every file that has been discovered by the FileWatcher
      Parameters:
      key -
      fileSeen -