public class FileMonitor
extends java.lang.Object
| Constructor and Description |
|---|
FileMonitor(long pollingInterval)
Create a file monitor instance with specified polling interval.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(java.io.File file,
FileListener listener)
Add file to listen for.
|
boolean |
contains(java.io.File file) |
static void |
main(java.lang.String[] args)
Test this class.
|
void |
removeFile(java.io.File file)
Remove specified file for listening.
|
void |
removeListener(java.io.File file,
FileListener fileListener)
Remove listener from this file monitor.
|
void |
stop()
Stop the file monitor polling.
|
void |
updateLastModified(java.io.File file,
long time)
manually update the last modified time of a file
|
public FileMonitor(long pollingInterval)
pollingInterval - Polling interval in milli seconds.public void stop()
public void addFile(java.io.File file,
FileListener listener)
More than one file can be listened for. When the specified file is created, modified or deleted, listeners are notified.
file - File to listen for.public void updateLastModified(java.io.File file,
long time)
file - time - public void removeFile(java.io.File file)
file - File to remove.public boolean contains(java.io.File file)
rmiFileImpl - public void removeListener(java.io.File file,
FileListener fileListener)
fileListener - Listener to remove.public static void main(java.lang.String[] args)
args - Not used.