Modifier and Type | Class and Description |
---|---|
static class |
FolderWatcher.FolderFilter
A FileFilter that accepts all folders that are not a trakem2 cache folder.
|
Constructor and Description |
---|
FolderWatcher(String folderName,
long inInterval) |
FolderWatcher(String folderName,
long inInterval,
FileFilter filter) |
FolderWatcher(String folderName,
long inInterval,
FileFilter filter)
Watch the folder at the given location for changes, polling at a given interval, ignoring
all files but those accepted by the given filter.
|
FolderWatcher(String folderName,
long inInterval,
String... extension) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(FileListener fl) |
boolean |
cancel()
Stop this FolderWatcher/TimerTask, cancel()'ing all FileListeners as well.
|
Vector<File> |
getFileList()
Returns a list of all files seen.
|
Vector<File> |
getFreshFileList()
Returns a list of file newly seen since the last poll epoch.
|
static void |
main(String[] args)
Because who doesn't like a main method?
|
void |
run() |
void |
start() |
scheduledExecutionTime
public FolderWatcher(String folderName, long inInterval)
public FolderWatcher(String folderName, long inInterval, FileFilter filter)
public FolderWatcher(String folderName, long inInterval, FileFilter filter)
folderName
- the String path to the folder in questioninInterval
- the poll interval in millisecondsfilter
- a filter to accept the files that we're interested in.public void addListener(FileListener fl)
public void start() throws IOException
IOException
public Vector<File> getFileList()
public Vector<File> getFreshFileList()
public boolean cancel()
public static void main(String[] args) throws IOException
args
- looks at args[0] for a folder to watch.IOException
Copyright © 2015–2021 Fiji. All rights reserved.