Package lazyj

Class DateFileWatchdog

java.lang.Object
java.util.Observable
lazyj.DateFileWatchdog

public final class DateFileWatchdog extends Observable
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 Details

    • DateFileWatchdog

      public DateFileWatchdog(String fileName, long howOften) throws Exception
      Create a watcher for a given file name
      Parameters:
      fileName - path to the file to monitor
      howOften - How often to verify for a change ( in millis )
      Throws:
      Exception
    • DateFileWatchdog

      public DateFileWatchdog(File f, long howOften) throws Exception
      Create a watcher for a given file
      Parameters:
      f -
      howOften - - How often to verify for a change ( in millis )
      Throws:
      Exception
  • Method Details

    • getFile

      public File 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

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • setChanged

      public void setChanged()
      Overrides:
      setChanged in class Observable