Class RetrieveFileCommand

    • Field Detail

      • sourcePath

        protected java.lang.String sourcePath
        The original source path of the file we are retrieving
      • renameOnSuccess

        protected boolean renameOnSuccess
        Rename the file on successful retrieval
      • renameExtension

        protected java.lang.String renameExtension
        Extension with which to rename successfully retrieved files As optional timestamp can be specified by using a pattern of /[dateFormat]/ in the renameExtension e.g. "/yyyyMMddHHmmss/.complete"
      • destructive

        protected boolean destructive
        Whether or not to destroy the file after we pick it up
      • renameTimestampExtensionPattern

        protected java.util.regex.Pattern renameTimestampExtensionPattern
        Pattern used in replacing a timestamp in a rename extension, for instance, captures /[dateFormat]/
    • Constructor Detail

      • RetrieveFileCommand

        protected RetrieveFileCommand()
        No args constructor required by Hibernate and unit tests
      • RetrieveFileCommand

        public RetrieveFileCommand​(BaseFileTransferDao dao,
                                   boolean renameOnSuccess,
                                   java.lang.String renameExtension,
                                   boolean moveOnSuccess,
                                   java.lang.String moveOnSuccessNewPath,
                                   boolean destructive)
        Constructor
        Parameters:
        dao - hibernateDAO
        renameOnSuccess - flag
        renameExtension - to rename file
        moveOnSuccess - flag
        moveOnSuccessNewPath - to move file
        destructive - flag
    • Method Detail

      • doCommit

        protected void doCommit()
                         throws javax.resource.ResourceException
        (non-Javadoc)
        Specified by:
        doCommit in class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
        Throws:
        javax.resource.ResourceException
        See Also:
        AbstractTransactionalResourceCommand.doCommit()
      • doRollback

        protected void doRollback()
        (non-Javadoc)
        Specified by:
        doRollback in class org.ikasan.connector.base.command.AbstractTransactionalResourceCommand
        See Also:
        AbstractTransactionalResourceCommand.doRollback()
      • expandRenameExtension

        protected java.lang.String expandRenameExtension()
      • parseTimestampFormat

        protected void parseTimestampFormat()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • getSourcePath

        public java.lang.String getSourcePath()
        Accessor method for source path
        Returns:
        sourcePath
      • isRenameOnSuccess

        public boolean isRenameOnSuccess()
        Do we rename the file on successful delivery?
        Returns:
        true if we rename, else false
      • getRenameExtension

        public java.lang.String getRenameExtension()
        Get the extension that we'rerenaming the file with
        Returns:
        file extension for the renamed file
      • setRenameExtension

        protected void setRenameExtension​(java.lang.String renameExtension)
        Private setter used by Hibernate
        Parameters:
        renameExtension - when renaming file
      • isDestructive

        public boolean isDestructive()
        Do we delete the file on successful delivery?
        Returns:
        true if we delete, else false
      • isMoveOnSuccess

        public boolean isMoveOnSuccess()
        Do we move the file on successful delivery?
        Returns:
        moveOnSuccess
      • getMoveNewPath

        public java.lang.String getMoveNewPath()
        Get the new path a file is being moved to.
        Returns:
        moveNewPath