public class DirectoryMonitor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
DirectoryMonitor.Listener
Allows custom behavior to be hooked up to process file state changes.
|
Constructor and Description |
---|
DirectoryMonitor(java.io.File target,
DirectoryMonitor.Listener listener,
long pollIntervalMillis) |
Modifier and Type | Method and Description |
---|---|
void |
addFile(java.io.File file) |
DirectoryMonitor.Listener |
getListener() |
long |
getPollIntervalMillis() |
java.io.File |
getTarget() |
void |
removeFile(java.io.File file) |
void |
scan()
Looks for changes to the immediate contents of the directory we're watching.
|
void |
start() |
void |
stop() |
public static final Logger logger
public DirectoryMonitor(java.io.File target, DirectoryMonitor.Listener listener, long pollIntervalMillis)
public long getPollIntervalMillis()
public java.io.File getTarget()
public DirectoryMonitor.Listener getListener()
public void stop()
public void start()
public void addFile(java.io.File file)
public void removeFile(java.io.File file)
public void scan()