eu.emi.dsr.core
Class FileListener
java.lang.Object
eu.emi.dsr.core.FileListener
- All Implemented Interfaces:
- Runnable
public class FileListener
- extends Object
- implements Runnable
Borrowed from unicore service environment's (use) core package
- Author:
- schuller
|
Method Summary |
void |
addTarget(File target)
add a file to be watched
Note: files are stored in a Set, so it is no problem if the same file is added
repeatedly |
boolean |
removeTarget(File target)
|
void |
run()
check if one of the target files has been touched and invoke
the action if it has |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileListener
public FileListener(File target,
Runnable action)
throws FileNotFoundException
- Throws:
FileNotFoundException
addTarget
public void addTarget(File target)
- add a file to be watched
Note: files are stored in a Set, so it is no problem if the same file is added
repeatedly
- Parameters:
target - - the file to watch
removeTarget
public boolean removeTarget(File target)
run
public void run()
- check if one of the target files has been touched and invoke
the action if it has
- Specified by:
run in interface Runnable
Copyright © 2012. All Rights Reserved.