Class DirWatch

    • Field Detail

      • m_Events

        protected WatchEventKind[] m_Events
        the events to look for.
      • m_WaitPoll

        protected int m_WaitPoll
        the waiting period in msec before polling again.
      • m_RegExp

        protected BaseRegExp m_RegExp
        the regular expression to match the file names against.
      • m_MoveFiles

        protected boolean m_MoveFiles
        whether to move the files before transmitting them.
      • m_AtomicMove

        protected boolean m_AtomicMove
        whether to perform an atomic move.
      • m_WatchedDir

        protected transient Path m_WatchedDir
        the watched directory.
      • m_Watch

        protected transient WatchService m_Watch
        the watch service.
    • Constructor Detail

      • DirWatch

        public DirWatch()
    • Method Detail

      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class AbstractActor
      • setSource

        public void setSource​(PlaceholderDirectory value)
        Sets the incoming directory.
        Parameters:
        value - the incoming directory
      • getSource

        public PlaceholderDirectory getSource()
        Returns the incoming directory.
        Returns:
        the incoming directory.
      • sourceTipText

        public String sourceTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setEvents

        public void setEvents​(WatchEventKind[] value)
        Sets the events to report.
        Parameters:
        value - the events
      • getEvents

        public WatchEventKind[] getEvents()
        Returns the events to report.
        Returns:
        the events
      • eventsTipText

        public String eventsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setWaitPoll

        public void setWaitPoll​(int value)
        Sets the number of milli-seconds to wait before polling whether files have arrived.
        Parameters:
        value - the number of milli-seconds
      • getWaitPoll

        public int getWaitPoll()
        Returns the number of milli-seconds to wait before polling again whether files have arrived.
        Returns:
        the number of milli-seconds
      • waitPollTipText

        public String waitPollTipText()
        Returns the tip text for this property. VariableChangedEvent.java
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRegExp

        public void setRegExp​(BaseRegExp value)
        Sets the regular expression to match the filenames against (name only, not path).
        Parameters:
        value - the expression
      • getRegExp

        public BaseRegExp getRegExp()
        Returns the regular expression to match the filenames against (name only, not path).
        Returns:
        the expression
      • regExpTipText

        public String regExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setMoveFiles

        public void setMoveFiles​(boolean value)
        Sets whether to move the files to the specified target directory before transmitting them.
        Parameters:
        value - true if to move files
      • getMoveFiles

        public boolean getMoveFiles()
        Returns whether to move the files to the specified target directory before transmitting them.
        Returns:
        true if to move files
      • moveFilesTipText

        public String moveFilesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAtomicMove

        public void setAtomicMove​(boolean value)
        Sets whether to attempt atomic move operation.
        Specified by:
        setAtomicMove in interface AtomicMoveSupporter
        Parameters:
        value - if true then attempt atomic move operation
      • getAtomicMove

        public boolean getAtomicMove()
        Returns whether to attempt atomic move operation.
        Specified by:
        getAtomicMove in interface AtomicMoveSupporter
        Returns:
        true if to attempt atomic move operation
      • atomicMoveTipText

        public String atomicMoveTipText()
        Returns the tip text for this property.
        Specified by:
        atomicMoveTipText in interface AtomicMoveSupporter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTarget

        public void setTarget​(PlaceholderDirectory value)
        Sets the move-to directory.
        Parameters:
        value - the move-to directory
      • getTarget

        public PlaceholderDirectory getTarget()
        Returns the move-to directory.
        Returns:
        the move-to directory.
      • targetTipText

        public String targetTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • checkActors

        protected String checkActors​(Actor[] actors)
        Checks the actors before they are set via the setActors method. Returns an error message if the actors are not acceptable, null otherwise.
        Specified by:
        checkActors in class AbstractMutableActorDaemonEvent<WatchKey,​String[]>
        Parameters:
        actors - the actors to check
        Returns:
        null if accepted, otherwise error message
      • stopWatchService

        protected void stopWatchService()
        Stops the watch service, if active.