Add an observer of events.
Add an observer of events.
the observer to add
the handle to the observer.
Catch any exceptions in subclasses.
Catch any exceptions in subclasses.
Register a path to monitor for file events.
Register a path to monitor for file events. The watcher will only watch child subdirectories up to maxDepth. For example, with a directory structure like /foo/bar/baz, if we register the path /foo/ with maxDepth 0, we will be notified for any files that are created, updated or deleted in foo, but not bar. If we increase maxDepth to 1, then the files in /foo/bar are monitored, but not the files in /foo/bar/baz.
the directory to watch for file events
the maximum maxDepth of subdirectories to watch
an com.swoval.functional.Either containing the result of the registration or an IOException if registration fails. This method should be idempotent and return true the first time the directory is registered or when the depth is changed. Otherwise it should return false.
Remove an observer.
Remove an observer.
the handle that was returned by addObserver
Stop watching a path.
Stop watching a path.
the path to remove from monitoring