|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.util.monitor.FileMonitor
public class FileMonitor
Class for monitoring changes in disk files. Usage: 1. Implement the FileListener interface. 2. Create a FileMonitor instance. 3. Add the file(s)/directory(ies) to listen for. fileChanged() will be called when a monitored file is created, deleted or its modified time changes.
Nested Class Summary | |
---|---|
class |
FileMonitor.FileMonitorNotifier
This is the timer thread which is executed every n milliseconds according to the setting of the file monitor. |
Constructor Summary | |
---|---|
FileMonitor(long pollingInterval)
Create a file monitor instance with specified polling interval. |
Method Summary | |
---|---|
void |
addFile(File file)
Add file to listen for. |
void |
addListener(FileListener fileListener)
Add listener to this file monitor. |
void |
removeFile(File file)
Remove specified file for listening. |
void |
removeListener(FileListener fileListener)
Remove listener from this file monitor. |
void |
start()
|
void |
stop()
Stop the file monitor polling. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileMonitor(long pollingInterval)
pollingInterval
- Polling interval in milli seconds.Method Detail |
---|
public void stop()
public void start()
public void addFile(File file)
file
- File to listen for.public void removeFile(File file)
file
- File to remove.public void addListener(FileListener fileListener)
fileListener
- Listener to add.public void removeListener(FileListener fileListener)
fileListener
- Listener to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |