Package jadex.common

Class FileWatcher

java.lang.Object
jadex.common.FileWatcher

public class FileWatcher extends Object
Watcher for files, written to be backwards compatible. TODO: Implement polling.
  • Field Details

    • running

      protected boolean running
      Flag if running.
    • thread

      protected Thread thread
      The watch thread.
    • watchedfile

      protected File watchedfile
      The watched file.
  • Constructor Details

    • FileWatcher

      public FileWatcher(String filepath, Runnable run, boolean forcepoll)
      Creates the watcher.
      Parameters:
      filepath - File to watch.
      run - Callback on changes.
  • Method Details

    • stop

      public void stop()
      Stops the monitoring.
    • pollingMode

      protected void pollingMode(Runnable run)
      Use polling mode.
      Parameters:
      run - The user runnable.
    • finalize

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