Class FileAlterationMonitor

java.lang.Object
org.apache.commons.io.monitor.FileAlterationMonitor
All Implemented Interfaces:
Runnable

public final class FileAlterationMonitor extends Object implements Runnable
A runnable that spawns a monitoring thread triggering any registered FileAlterationObserver at a specified interval.
Since:
2.0
See Also:
  • Constructor Details

    • FileAlterationMonitor

      Constructs a monitor with a default interval of 10 seconds.
    • FileAlterationMonitor

      public FileAlterationMonitor(long intervalMillis)
      Constructs a monitor with the specified interval.
      Parameters:
      intervalMillis - The amount of time in milliseconds to wait between checks of the file system.
    • FileAlterationMonitor

      public FileAlterationMonitor(long interval, Collection<FileAlterationObserver> observers)
      Constructs a monitor with the specified interval and collection of observers.
      Parameters:
      interval - The amount of time in milliseconds to wait between checks of the file system.
      observers - The collection of observers to add to the monitor.
      Since:
      2.9.0
    • FileAlterationMonitor

      public FileAlterationMonitor(long interval, FileAlterationObserver... observers)
      Constructs a monitor with the specified interval and set of observers.
      Parameters:
      interval - The amount of time in milliseconds to wait between checks of the file system.
      observers - The set of observers to add to the monitor.
  • Method Details