de.fzj.unicore.wsrflite.utils
Class FileWatcher

java.lang.Object
  extended by de.fzj.unicore.wsrflite.utils.FileWatcher
All Implemented Interfaces:
Runnable

public class FileWatcher
extends Object
implements Runnable

helper to watch a file and invoke a specific action if it was modified. This should be executed periodically, for example using the scheduled executor service from the ResourcePool

Author:
schuller

Constructor Summary
FileWatcher(File target, Runnable action)
           
 
Method Summary
 void run()
          check if target file 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
 

Constructor Detail

FileWatcher

public FileWatcher(File target,
                   Runnable action)
            throws FileNotFoundException
Throws:
FileNotFoundException
Method Detail

run

public void run()
check if target file has been touched and invoke the action if it has

Specified by:
run in interface Runnable


Copyright © 2010. All Rights Reserved.