org.dlese.dpc.util
Class FileDirectoryMonitor
java.lang.Object
java.util.TimerTask
org.dlese.dpc.util.FileDirectoryMonitor
- All Implemented Interfaces:
- Runnable
- public class FileDirectoryMonitor
- extends TimerTask
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileDirectoryMonitor
public FileDirectoryMonitor()
init
public boolean init(String directoryName,
long period,
boolean asDaemon)
init
public boolean init(String directoryName,
String directoryDataDir,
long period,
boolean asDaemon)
run
public void run()
addListener
public void addListener(FileDirectoryListener listener)
- Add a
FileDirectoryListener
to this FileDirectoryMonitor
.
- Parameters:
listener
- The listener to add
removeListener
public void removeListener(FileDirectoryListener listener)
- Remove a
FileDirectoryListener
from this FileDirectoryMonitor
.
- Parameters:
listener
- The listener to remove
fireFileDirectoryEvent
protected void fireFileDirectoryEvent(List filesToAdd,
List filesToRemove)
- Construct the FileDirectoryEvent object and fire off the event to listeners.