|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.anthonyeden.lib.util.VFSFileMonitor
Class which monitors a file in a thread separate from the main application. If the file changes then the reload() method of the given target will be executed.
| Field Summary | |
static int |
DEFAULT_DELAY
The default delay value (5 seconds) for checking for modifications. |
| Constructor Summary | |
VFSFileMonitor(org.apache.commons.vfs.FileObject file,
long delay,
Reloadable target)
Construct a new VFSFileMonitor for the given file and target. |
|
VFSFileMonitor(org.apache.commons.vfs.FileObject file,
Reloadable target)
Construct a new VFSFileMonitor for the given file and target. |
|
| Method Summary | |
long |
getDelay()
Get the delay between file checks. |
org.apache.commons.vfs.FileObject |
getFile()
Get the file which is being monitored. |
void |
run()
The thread's run method. |
void |
setDelay(long delay)
Set the delay between checks. |
void |
startMonitor()
Start the monitoring thread. |
void |
stopMonitor()
Stop the monitoring thread. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_DELAY
| Constructor Detail |
public VFSFileMonitor(org.apache.commons.vfs.FileObject file,
Reloadable target)
throws org.apache.commons.vfs.FileSystemException
file - The file to monitortarget - The target
org.apache.commons.vfs.FileSystemException
public VFSFileMonitor(org.apache.commons.vfs.FileObject file,
long delay,
Reloadable target)
throws org.apache.commons.vfs.FileSystemException
file - The file to monitordelay - The delay timetarget - The target
org.apache.commons.vfs.FileSystemException| Method Detail |
public void startMonitor()
public void stopMonitor()
public org.apache.commons.vfs.FileObject getFile()
public long getDelay()
public void setDelay(long delay)
delay - The delay in millisecondspublic void run()
startMonitor()
and stopMonitor() methods should be used to start and stop
the monitor.
run in interface java.lang.Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||