public class DirectoryMonitor
extends java.lang.Thread
Modifier and Type | Class and Description |
---|---|
static interface |
DirectoryMonitor.Callback
Callback for monitoring.
|
static interface |
DirectoryMonitor.DirectoryCallback |
protected static class |
DirectoryMonitor.FileInfo
Information about exist file.
|
Modifier and Type | Field and Description |
---|---|
protected DirectoryMonitor.Callback |
callback |
protected java.io.File |
dir |
protected DirectoryMonitor.DirectoryCallback |
directoryCallback |
protected static long |
LOOKUP_PERIOD |
Constructor and Description |
---|
DirectoryMonitor(java.io.File dir,
DirectoryMonitor.Callback callback)
Create monitor.
|
DirectoryMonitor(java.io.File dir,
DirectoryMonitor.Callback callback,
DirectoryMonitor.DirectoryCallback directoryCallback) |
Modifier and Type | Method and Description |
---|---|
void |
checkChanges()
Process changes in directory.
|
void |
fin()
Stop directory monitoring.
|
java.io.File |
getDir() |
java.util.Set<java.io.File> |
getExistFiles() |
void |
run() |
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
protected final java.io.File dir
protected final DirectoryMonitor.Callback callback
protected final DirectoryMonitor.DirectoryCallback directoryCallback
protected static final long LOOKUP_PERIOD
public DirectoryMonitor(java.io.File dir, DirectoryMonitor.Callback callback)
dir
- directory to monitoringpublic DirectoryMonitor(java.io.File dir, DirectoryMonitor.Callback callback, DirectoryMonitor.DirectoryCallback directoryCallback)
public java.io.File getDir()
public void fin()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.util.Set<java.io.File> getExistFiles()
public void checkChanges()