public interface FileEventMonitor
extends java.lang.AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Handle all exceptions.
|
FileEventMonitors.Handle |
createStream(java.nio.file.Path path,
long latency,
java.util.concurrent.TimeUnit timeUnit,
Flags.Create flags)
Start monitoring a path.
|
void |
stopStream(FileEventMonitors.Handle streamHandle)
Stop monitoring a path previously registered with
createStream(java.nio.file.Path, long, java.util.concurrent.TimeUnit, com.swoval.files.apple.Flags.Create). |
FileEventMonitors.Handle createStream(java.nio.file.Path path, long latency, java.util.concurrent.TimeUnit timeUnit, Flags.Create flags) throws ClosedFileEventMonitorException
path - the path to monitor. The apple file events api only supports recursive monitoring,
so if this path is a directory, all of its children will also be monitored.latency - the minimum latency with which the os will deliver file events. It seems to be
limited to roughly O(10ms), so there is little point in setting the value less than that.timeUnit - the unit in which the latency is specifiedflags - the flags specified to create the streamClosedFileEventMonitorException - if the FileEventMonitor has been closedvoid stopStream(FileEventMonitors.Handle streamHandle) throws ClosedFileEventMonitorException
createStream(java.nio.file.Path, long, java.util.concurrent.TimeUnit, com.swoval.files.apple.Flags.Create).streamHandle - the handle returned by createStream(java.nio.file.Path, long, java.util.concurrent.TimeUnit, com.swoval.files.apple.Flags.Create)ClosedFileEventMonitorException - if the FileEventMonitor has been closedvoid close()
close in interface java.lang.AutoCloseable