public abstract class FileMonitor
extends java.lang.Object
Watched files which are removed from the filesystem are no longer watched.
Modifier and Type | Class and Description |
---|---|
class |
FileMonitor.FileEvent |
static interface |
FileMonitor.FileListener |
Modifier and Type | Field and Description |
---|---|
static int |
FILE_ACCESSED |
static int |
FILE_ANY |
static int |
FILE_ATTRIBUTES_CHANGED |
static int |
FILE_CREATED |
static int |
FILE_DELETED |
static int |
FILE_MODIFIED |
static int |
FILE_NAME_CHANGED_NEW |
static int |
FILE_NAME_CHANGED_OLD |
static int |
FILE_RENAMED |
static int |
FILE_SECURITY_CHANGED |
static int |
FILE_SIZE_CHANGED |
Constructor and Description |
---|
FileMonitor() |
Modifier and Type | Method and Description |
---|---|
void |
addFileListener(FileMonitor.FileListener listener) |
void |
addWatch(java.io.File dir) |
void |
addWatch(java.io.File dir,
int mask) |
void |
addWatch(java.io.File dir,
int mask,
boolean recursive) |
abstract void |
dispose() |
protected void |
finalize() |
static FileMonitor |
getInstance() |
protected void |
notify(FileMonitor.FileEvent e) |
void |
removeFileListener(FileMonitor.FileListener x) |
void |
removeWatch(java.io.File file) |
protected abstract void |
unwatch(java.io.File file) |
protected abstract void |
watch(java.io.File file,
int mask,
boolean recursive) |
public static final int FILE_CREATED
public static final int FILE_DELETED
public static final int FILE_MODIFIED
public static final int FILE_ACCESSED
public static final int FILE_NAME_CHANGED_OLD
public static final int FILE_NAME_CHANGED_NEW
public static final int FILE_RENAMED
public static final int FILE_SIZE_CHANGED
public static final int FILE_ATTRIBUTES_CHANGED
public static final int FILE_SECURITY_CHANGED
public static final int FILE_ANY
protected abstract void watch(java.io.File file, int mask, boolean recursive) throws java.io.IOException
java.io.IOException
protected abstract void unwatch(java.io.File file)
public abstract void dispose()
public void addWatch(java.io.File dir) throws java.io.IOException
java.io.IOException
public void addWatch(java.io.File dir, int mask) throws java.io.IOException
java.io.IOException
public void addWatch(java.io.File dir, int mask, boolean recursive) throws java.io.IOException
java.io.IOException
public void removeWatch(java.io.File file)
protected void notify(FileMonitor.FileEvent e)
public void addFileListener(FileMonitor.FileListener listener)
public void removeFileListener(FileMonitor.FileListener x)
protected void finalize()
finalize
in class java.lang.Object
public static FileMonitor getInstance()