org.cip4.jdflib.util.hotfolder
Class StorageHotFolder

java.lang.Object
  extended by org.cip4.jdflib.util.hotfolder.StorageHotFolder
Direct Known Subclasses:
PollHotFolder, QueueHotFolder

public class StorageHotFolder
extends Object

a hotfolder that handles storage of "hotfolded" data

Author:
prosirai

Field Summary
protected  HotFolder hf
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
StorageHotFolder(File _hotFolderDir, File storageDir, String ext, HotFolderListener hfListener)
          constructor for a simple queue based hotfolder watcher that is automagically started in its own thread
 
Method Summary
 org.cip4.jdflib.util.hotfolder.StorageHotFolderListener addListener(HotFolderListener _hfl, String ext)
          add a listener that also stores
 void copyCompleted(File storedFile, boolean ok)
          copy any files to the ok or error files as set by the folder properties
 File getHfDirectory()
           
 void restart()
          restart this hot folder, create s a new listner thread and stops the old one
 void setErrorStorage(File error)
          set the directory for error done
 void setMaxStore(int maxStore)
          Setter for maxStore attribute.
 void setOKStorage(File ok)
          set the directory for successful done
 void stop()
          stop this hot folder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hf

protected final HotFolder hf

log

protected final org.apache.commons.logging.Log log
Constructor Detail

StorageHotFolder

public StorageHotFolder(File _hotFolderDir,
                        File storageDir,
                        String ext,
                        HotFolderListener hfListener)
constructor for a simple queue based hotfolder watcher that is automagically started in its own thread

Parameters:
_hotFolderDir - the hot folder directory to watch
storageDir - the storage directory where hot files are moved to
ext - the comma separated list of file extensions that are moved - if null no filtering
hfListener - callback that receives the generated JMF - the location of the stored file will be found in the standard command parameters
Method Detail

getHfDirectory

public File getHfDirectory()
Returns:
the hotfolder directory

stop

public void stop()
stop this hot folder


restart

public void restart()
restart this hot folder, create s a new listner thread and stops the old one


addListener

public org.cip4.jdflib.util.hotfolder.StorageHotFolderListener addListener(HotFolderListener _hfl,
                                                                           String ext)
add a listener that also stores

Parameters:
_hfl -
ext -
Returns:
the newly added listener

setOKStorage

public void setOKStorage(File ok)
set the directory for successful done

Parameters:
ok - the local directory for ok files in the input hot folder

copyCompleted

public void copyCompleted(File storedFile,
                          boolean ok)
copy any files to the ok or error files as set by the folder properties

Parameters:
storedFile -
ok -

setErrorStorage

public void setErrorStorage(File error)
set the directory for error done

Parameters:
error - the local directory for error files in the input hot folder

setMaxStore

public void setMaxStore(int maxStore)
Setter for maxStore attribute.

Parameters:
maxStore - the maxStore to set


Copyright © 2013. All Rights Reserved.