public class FileWatcherPollingService extends Object
Constructor and Description |
---|
FileWatcherPollingService(ScheduledExecutorService exec,
java.time.Duration scanRate) |
Modifier and Type | Method and Description |
---|---|
void |
addWatcher(File file,
Runnable callback)
Registers a file for updates.
|
void |
removeWatcher(File file,
Runnable callback)
Unregisters a file for updates.
|
void |
scan() |
public FileWatcherPollingService(ScheduledExecutorService exec, java.time.Duration scanRate)
public void addWatcher(File file, Runnable callback)
file
- a filecallback
- called when the file changespublic void removeWatcher(File file, Runnable callback)
file
- a filecallback
- no longer called when the file changespublic void scan()
Copyright © 2015. All rights reserved.