FileUpdateListeners.
Implementation based on https://stackoverflow.com/questions/16251273/can-i-watch-for-single-file-change-with-watchservice-not-the-whole-directory.
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| private final Multimap | |
| private static final Logger | |
| private final AtomicBoolean | |
| private volatile WatchService |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListenerForFile(Path
The file to monitor. file, FileUpdateListener listener)Implements org. Add a new file to monitor. |
| public boolean | isActive()
Implements org. Indicates whether the native system's file monitor has successfully started. |
| private void | |
| public void | removeListener(Path
The path to remove. path, FileUpdateListener listener)Implements org. Removes a listener from the monitor. |
| public void | |
| public void |
| filesystemMonitorFailure | back to summary |
|---|---|
| private final AtomicReference<Optional<JabRefException>> filesystemMonitorFailure | |
| listeners | back to summary |
|---|---|
| private final Multimap<Path, FileUpdateListener> listeners | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| notShutdown | back to summary |
|---|---|
| private final AtomicBoolean notShutdown | |
| watcher | back to summary |
|---|---|
| private volatile WatchService watcher | |
| DefaultFileUpdateMonitor | back to summary |
|---|---|
| public DefaultFileUpdateMonitor() | |
| addListenerForFile | back to summary |
|---|---|
| public void addListenerForFile(Path file, FileUpdateListener listener) throws IOException Implements org. Doc from org. Add a new file to monitor.
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() Implements org. Doc from org. Indicates whether the native system's file monitor has successfully started.
| |
| notifyAboutChange | back to summary |
|---|---|
| private void notifyAboutChange(Path path) | |
| removeListener | back to summary |
|---|---|
| public void removeListener(Path path, FileUpdateListener listener) Implements org. Doc from org. Removes a listener from the monitor. | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Implements org. Doc from org. stops watching for changes
| |