Package lazyj
Class DateFileWatchdog
java.lang.Object
java.util.Observable
lazyj.DateFileWatchdog
This class monitors a specified File for a change and notifies back when the file on disk has changed. It is based on the last modification time of the file.
-
Constructor Summary
ConstructorsConstructorDescriptionDateFileWatchdog(File f, long howOften) Create a watcher for a given fileDateFileWatchdog(String fileName, long howOften) Create a watcher for a given file name -
Method Summary
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
-
Constructor Details
-
DateFileWatchdog
Create a watcher for a given file name- Parameters:
fileName- path to the file to monitorhowOften- How often to verify for a change ( in millis )- Throws:
Exception
-
DateFileWatchdog
Create a watcher for a given file- Parameters:
f-howOften- - How often to verify for a change ( in millis )- Throws:
Exception
-
-
Method Details
-
getFile
Get the file that is monitored for changes- Returns:
- the file that is monitored for changes
-
stopIt
public void stopIt()Stop monitoring this file for changes -
finalize
-
setChanged
public void setChanged()- Overrides:
setChangedin classObservable
-