public class DirectoryWatcher extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DirectoryWatcher.FileEvent |
| Constructor and Description |
|---|
DirectoryWatcher() |
| Modifier and Type | Method and Description |
|---|---|
Map<Path,DirectoryWatcher.FileEvent> |
getChangesSinceLastTime()
Checks all the watched directories (that are being kept in a map) for changes since the last call to this method.
|
void |
stopWatching()
Close the watch service.
|
void |
watchDirectoryTree(Path dir)
Walk the directories under given path, and register a watcher for every directory.
|
public void stopWatching()
public void watchDirectoryTree(Path dir)
dir - the starting point under which to listen for changes, if it doesn't exist, do nothing.public Map<Path,DirectoryWatcher.FileEvent> getChangesSinceLastTime()
Copyright © 2018. All rights reserved.