class MacOsWatchServiceDirectoryWatcher extends AbstractDirectoryWatcher
Implementation of a AbstractDirectoryWatcher that uses java.nio.WatchService. This implementation is used for Java 7 and later.
Modifiers | Name | Description |
---|---|---|
private static org.slf4j.Logger |
LOG |
|
private java.util.Set<java.nio.file.Path> |
individualWatchedFiles |
|
private java.util.Map<java.nio.file.WatchKey, java.util.List<java.lang.String>> |
watchKeyToExtensionsMap |
|
private java.nio.file.WatchService |
watchService |
Fields inherited from class | Fields |
---|---|
class AbstractDirectoryWatcher |
active, listeners, sleepTime |
Constructor and description |
---|
MacOsWatchServiceDirectoryWatcher
() |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addWatchDirectory(java.io.File dir, java.util.List<java.lang.String> fileExtensions) |
|
private void |
addWatchDirectory(java.nio.file.Path dir, java.util.List<java.lang.String> fileExtensions) |
|
public void |
addWatchFile(java.io.File fileToWatch) |
<T> |
private static java.nio.file.WatchEvent<T> |
cast(java.nio.file.WatchEvent<?> event) |
|
public java.nio.file.FileVisitResult |
preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs) |
|
public void |
run() |
Methods inherited from class | Name |
---|---|
class AbstractDirectoryWatcher |
addListener, addWatchDirectory, addWatchFile, fireOnChange, fireOnNew, getFilenameExtension, isValidDirectoryToMonitor, isValidFileToMonitor, removeListener, setActive, setSleepTime |