Class FileWatcherBuilder

java.lang.Object
com.codingchili.core.files.FileWatcherBuilder

public class FileWatcherBuilder extends Object
File watcher builder.
  • Method Details

    • withListener

      public FileWatcherBuilder withListener(FileStoreListener listener)
      Sets the listener that is called on file changes.
      Parameters:
      listener - the listener to be used.
      Returns:
      fluent.
    • onDirectory

      public FileWatcherBuilder onDirectory(String directory)
      Defines the directory that should be watched relative from the application root.
      Parameters:
      directory - the directory to be watched, includes its subdirectories.
      Returns:
      fluent
    • rate

      public FileWatcherBuilder rate(TimerSource rate)
      The rate in which to poll the file change events.
      Parameters:
      rate - a timersource in milliseconds.
      Returns:
      fluent
    • build

      public FileWatcher build()
      Constructs the new FileWatcher.
      Returns:
      fluent