gate.util.reporting
Class FileWatcher

java.lang.Object
  extended by java.util.TimerTask
      extended by gate.util.reporting.FileWatcher
All Implemented Interfaces:
Runnable

abstract class FileWatcher
extends TimerTask

A FileWather class to check whether the file is modified or not at specified interval.


Field Summary
private  File file
           
private  long timeStamp
           
 
Constructor Summary
FileWatcher(File file)
          Creates a FileWatcher on a given file.
 
Method Summary
protected abstract  void onChange(File file)
          Specifies the actions to be taken when a file is modified.
 void run()
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeStamp

private long timeStamp

file

private File file
Constructor Detail

FileWatcher

public FileWatcher(File file)
Creates a FileWatcher on a given file.

Parameters:
file - A handle of the file to be watched.
Method Detail

run

public final void run()
Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

onChange

protected abstract void onChange(File file)
                          throws BenchmarkReportExecutionException
Specifies the actions to be taken when a file is modified.

Parameters:
file - A handle of the file to be watched.
Throws:
BenchmarkReportExecutionException