public class FileWatcher extends AbstractResourceWatcher<FileChangesListener>
Constructor and Description |
---|
FileWatcher(java.nio.file.Path file)
Creates new file watcher on the given directory
|
Modifier and Type | Method and Description |
---|---|
void |
clearState()
Clears any state with the FileWatcher, making all files show up as new
|
protected void |
doCheckAndNotify()
Will be called periodically
|
protected void |
doInit()
Will be called once on initialization
|
addListener, checkAndNotify, init, listeners, remove
public FileWatcher(java.nio.file.Path file)
public void clearState()
protected void doInit() throws java.io.IOException
AbstractResourceWatcher
doInit
in class AbstractResourceWatcher<FileChangesListener>
java.io.IOException
protected void doCheckAndNotify() throws java.io.IOException
AbstractResourceWatcher
Implementing watcher should check resource and notify all AbstractResourceWatcher.listeners()
.
doCheckAndNotify
in class AbstractResourceWatcher<FileChangesListener>
java.io.IOException