Class WindowsRecursiveWatcher

  • public class WindowsRecursiveWatcher
    extends RecursiveWatcher
    The Windows recursive file watcher monitors a folder (and its sub-folders) by registering a recursive watch on the root folder. This class is used only on Windows and uses jpathwatch-based WatchService.

    Via the jpathwatch library, the class uses the Windows-native recursive folder- watching capabilities of Windows and thereby does not need to register watches on all sub-folders. Instead, only one watch on the root folder is needed.

    When a file event occurs, a timer is started to wait for the file operations to settle. It is reset whenever a new event occurs. When the timer times out, an event is thrown through the RecursiveWatcher.WatchListener.