public class FileWatcher
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
running
Flag if running.
|
protected java.lang.Thread |
thread
The watch thread.
|
protected java.io.File |
watchedfile
The watched file.
|
Constructor and Description |
---|
FileWatcher(java.lang.String filepath,
java.lang.Runnable run,
boolean forcepoll)
Creates the watcher.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Override
|
protected void |
pollingMode(java.lang.Runnable run)
Use polling mode.
|
void |
stop()
Stops the monitoring.
|
protected boolean running
protected java.lang.Thread thread
protected java.io.File watchedfile
public FileWatcher(java.lang.String filepath, java.lang.Runnable run, boolean forcepoll)
filepath
- File to watch.run
- Callback on changes.public void stop()
protected void pollingMode(java.lang.Runnable run)
run
- The user runnable.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable