Class FileWatcher


  • public abstract class FileWatcher
    extends java.lang.Object
    Class for watching file existence. If file not exists - FileWatcher creates it and fire onChange event.
    Version:
    $Id: $Id
    Author:
    dsilenko
    • Constructor Summary

      Constructors 
      Constructor Description
      FileWatcher​(java.lang.String aFilePath, long aPeriod)
      Constructor for FileWatcher.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void onChange()
      Event when file was not exist.
      void start()
      Starting file watching task.
      void stop()
      Stopping file watching task.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileWatcher

        public FileWatcher​(java.lang.String aFilePath,
                           long aPeriod)

        Constructor for FileWatcher.

        Parameters:
        aFilePath - path for file to watch.
        aPeriod - delay for starting and period time in milliseconds between successive task executions.
    • Method Detail

      • start

        public void start()
        Starting file watching task.
      • stop

        public void stop()
        Stopping file watching task.
      • onChange

        protected abstract void onChange()
        Event when file was not exist.