public class FileObserver extends Object
FileAlterationObserver and FileAlterationMonitor.| Constructor and Description |
|---|
FileObserver(File rootDirectory)
A file observer that uses the default interval to check for file changes.
|
FileObserver(File rootDirectory,
long interval)
A file observer that uses the specified interval to check for file changes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFileObserverListener(FileObserverListener listener) |
List<FileObserverListener> |
getFileObserverListeners() |
long |
getInterval() |
boolean |
isRunning() |
void |
removeFileObserverListener(FileObserverListener listener) |
void |
start() |
void |
stop() |
void |
stop(long ms) |
public FileObserver(File rootDirectory, long interval)
rootDirectory - the root directory to monitorinterval - the interval in milliseconds to observe changespublic FileObserver(File rootDirectory)
rootDirectory - the root directory to monitorpublic void addFileObserverListener(FileObserverListener listener)
public void removeFileObserverListener(FileObserverListener listener)
public List<FileObserverListener> getFileObserverListeners()
public long getInterval()
public boolean isRunning()
Copyright © 2019. All rights reserved.