Class HotFolder

  • Direct Known Subclasses:
    ColdFolder

    public class HotFolder
    extends java.lang.Object
    a very simple hotfolder watcher subdirectories are ignored
    • Field Detail

      • stabilizeTime

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

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

      • HotFolder

        @Deprecated
        public HotFolder​(java.io.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​(java.io.File _dir,
                         java.lang.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 Detail

      • 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 java.io.File getDir()
        Returns:
        the hot folder directory
      • addListener

        public void addListener​(HotFolderListener _hfl,
                                java.lang.String ext)
        Parameters:
        _hfl -
        ext -
      • restart

        public void restart()
        restart the thread
      • stop

        public void stop()
        stop this thread;
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • 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 java.lang.Object
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)