Package org.cip4.jdflib.util.hotfolder
Class HotFolder
java.lang.Object
org.cip4.jdflib.util.hotfolder.HotFolder
- Direct Known Subclasses:
ColdFolder
a very simple hotfolder watcher subdirectories are ignored
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArrayList<org.cip4.jdflib.util.hotfolder.ExtensionListener>intthe time in milliseconds to wait for stabilization -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(HotFolderListener _hfl, String ext) booleanstatic intgetDir()org.cip4.jdflib.util.hotfolder.ExtensionListenergetListener(int i) intintintinthashCode()voidrestart()restart the threadstatic voidsetDefaultStabilizeTime(int defaultStabilizeTime) voidsetMaxCheck(int maxCheck) voidsetMaxConcurrent(int maxConcurrent) voidsetStabilizeTime(int stabilizeTime) voidstop()stop this thread;toString()
-
Field Details
-
stabilizeTime
public int stabilizeTimethe time in milliseconds to wait for stabilization -
hfl
-
-
Constructor Details
-
HotFolder
Deprecated.- use the 3 parameter versionconstructor for a simple hotfolder watcher that is automagically started in its own thread- Parameters:
_dir- the Directory to watch
-
HotFolder
constructor for a simple hotfolder watcher that is automagically started in its own thread- Parameters:
_dir- the Directory to watchext- 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
- Returns:
- the hot folder directory
-
addListener
- Parameters:
_hfl-ext-
-
restart
public void restart()restart the thread -
stop
public void stop()stop this thread; -
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() -
equals
-