public class FileUpdateMonitor
extends java.lang.Thread
Constructor and Description |
---|
FileUpdateMonitor() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addUpdateListener(FileUpdateListener ul,
java.io.File file)
Add a new file to monitor.
|
void |
changeFile(java.lang.String key,
java.io.File file) |
java.io.File |
getTempFile(java.lang.String key)
Method for getting the temporary file used for this database.
|
boolean |
hasBeenModified(java.lang.String handle)
Forces a check on the file, and returns the result.
|
void |
perturbTimestamp(java.lang.String handle)
Change the stored timestamp for the given file.
|
void |
removeUpdateListener(java.lang.String handle)
Removes a listener from the monitor.
|
void |
run() |
void |
stopMonitoring()
Cause the thread to stop monitoring.
|
void |
updateTimeStamp(java.lang.String key) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stopMonitoring()
public java.lang.String addUpdateListener(FileUpdateListener ul, java.io.File file) throws java.io.IOException
ul
- FileUpdateListener The listener to notify when the file changes.file
- File The file to monitor.java.io.IOException
- if the file does not exist.public boolean hasBeenModified(java.lang.String handle) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void perturbTimestamp(java.lang.String handle)
handle
- the handle to the correct file.public void removeUpdateListener(java.lang.String handle)
handle
- String The handle for the listener to remove.public void updateTimeStamp(java.lang.String key) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void changeFile(java.lang.String key, java.io.File file) throws java.io.IOException, java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
public java.io.File getTempFile(java.lang.String key) throws java.lang.IllegalArgumentException
key
- String The handle for this monitor.java.lang.IllegalArgumentException
- If the handle doesn't correspond to an entry.