Class HotFolder

java.lang.Object
org.cip4.jdflib.util.hotfolder.HotFolder
Direct Known Subclasses:
ColdFolder

public class HotFolder extends Object
a very simple hotfolder watcher subdirectories are ignored
  • Field Details

    • stabilizeTime

      public int stabilizeTime
      the time in milliseconds to wait for stabilization
    • hfl

      protected final ArrayList<org.cip4.jdflib.util.hotfolder.ExtensionListener> hfl
  • Constructor Details

    • HotFolder

      @Deprecated public HotFolder(File _dir)
      Deprecated.
      - use the 3 parameter version
      constructor for a simple hotfolder watcher that is automagically started in its own thread
      Parameters:
      _dir - the Directory to watch
    • HotFolder

      public HotFolder(File _dir, String ext, HotFolderListener _hfl)
      constructor for a simple hotfolder watcher that is automagically started in its own thread
      Parameters:
      _dir - the Directory to watch
      ext - the extension filter - case is ignored and lists of extensions may be specified as a comma separated list e.g. ".txt,.xml"
      _hfl - the listener callback
  • Method Details

    • getMaxCheck

      public int getMaxCheck()
    • setMaxCheck

      public void setMaxCheck(int maxCheck)
    • setMaxConcurrent

      public void setMaxConcurrent(int maxConcurrent)
      Parameters:
      maxConcurrent - the maxConcurrent to set note will only add
    • getListener

      public org.cip4.jdflib.util.hotfolder.ExtensionListener getListener(int i)
      Parameters:
      i -
      Returns:
    • getMaxConcurrent

      public int getMaxConcurrent()
      Returns:
    • getDir

      public File getDir()
      Returns:
      the hot folder directory
    • addListener

      public void addListener(HotFolderListener _hfl, String ext)
      Parameters:
      _hfl -
      ext -
    • restart

      public void restart()
      restart the thread
    • stop

      public void stop()
      stop this thread;
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getDefaultStabilizeTime

      public static int getDefaultStabilizeTime()
      Returns:
      the defaultStabilizeTime
    • setDefaultStabilizeTime

      public static void setDefaultStabilizeTime(int defaultStabilizeTime)
      Parameters:
      defaultStabilizeTime - the defaultStabilizeTime to set
    • getStabilizeTime

      public int getStabilizeTime()
      Returns:
      the stabilizeTime
    • setStabilizeTime

      public void setStabilizeTime(int stabilizeTime)
      Parameters:
      stabilizeTime - the stabilizeTime to set in milliseconds - we always ensure at least 2000 because some OS have 1000 file modified garnularity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also: