Interface IWorkflowFileHandler


  • public interface IWorkflowFileHandler
    Handler with utility methods for working with files during the execution of a workflow, and making these files available to other workflow node. Contains methods such as attaching files to the form record or saving files to the file system.

    Useful for node action that implement IProviding and IAttachableFile.

    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • attachFilesToFormRecord

        default List<Attachment> attachFilesToFormRecord​(File... files)
                                                  throws IOException
        Attaches the given files to the current form record for which the workflow is executed. The files are attached as the UserMgmtUtils.SYSTEM user.
        Parameters:
        files - Files to be attached to the form record. Must not be a directory.
        Returns:
        The attachments that were created.
        Throws:
        IOException - When the file data could not be read.
      • attachFilesToFormRecord

        default List<Attachment> attachFilesToFormRecord​(Iterable<File> files)
                                                  throws IOException
        Attaches the given files to the current form record for which the workflow is executed. The files are attached as the UserMgmtUtils.SYSTEM user.
        Parameters:
        files - Files to be attached to the form record. Must not be a directory.
        Returns:
        The attachments that were created.
        Throws:
        IOException - When the file data could not be read.
      • attachFilesToFormRecord

        List<Attachment> attachFilesToFormRecord​(Iterable<File> files,
                                                 IAttachFilesToFormRecordOptions options)
                                          throws IOException
        Attaches the given files to the current form record for which the workflow is executed. The files are attached as the UserMgmtUtils.SYSTEM user.
        Parameters:
        files - Files to be attached to the form record. Must not be a directory.
        options - Options for how to attach the files.
        Returns:
        The attachments that were created.
        Throws:
        IOException - When the file data could not be read.
      • copyFilesToDir

        @Deprecated
        @Nullable
        default File copyFilesToDir​(File sourceFileOrDirectory,
                                    File targetDir)
                             throws IOException
        Copies the source files to the given target directory. If the source points to a directory, all files in that directory are copied (non-recursively) to the target. The target directory and all parent directories are created when they do not exist yet.

        Files in the target directory are overwritten if they exist already.

        Parameters:
        sourceFileOrDirectory - File or directory with files to copy.
        targetDir - Target directory for the source files. Must be a directory and not a file.
        Returns:
        When the source is a file: the file object pointing to the copied file. When the source is a directory: the file object pointing to the subdirectory in the target directory. null when no source or target was given, or the target is not a directory.
        Throws:
        IOException - When the file cannot be copied.
        See Also:
        , if you want to specify a particular file name.
      • copyFilesToDir

        @Nullable
        File copyFilesToDir​(File sourceFileOrDirectory,
                            File targetDir,
                            EFileConflictMode mode)
                     throws IOException
        Copies the source files to the given target directory. If the source points to a directory, all files in that directory are copied (non-recursively) to the target. The target directory and all parent directories are created when they do not exist yet.

        Files in the target directory are overwritten if they exist already.

        Parameters:
        sourceFileOrDirectory - File or directory with files to copy.
        targetDir - Target directory for the source files. Must be a directory and not a file.
        mode - How to proceed when the target file exists already.
        Returns:
        When the source is a file: the file object pointing to the copied file. When the source is a directory: the file object pointing to the subdirectory in the target directory. null when no source or target was given, or the target is not a directory.
        Throws:
        IOException - When the file cannot be copied.
        Since:
        7.0.5
        See Also:
        , if you want to specify a particular file name.
      • copyFilesToDir

        @Deprecated
        default List<File> copyFilesToDir​(File[] sourceFileOrDirectories,
                                          File targetDir)
                                   throws IOException
        Copies the source files to the given target directory. If the source points to a directory, all files in that directory are copied (non-recursively) to the target. The target directory and all parent directories are created when they do not exist yet.

        Files in the target directory are overwritten if they exist already.

        Parameters:
        sourceFileOrDirectories - Files or directories with files to copy.
        targetDir - Target directory for the source files . Must be a directory and not a file.
        Returns:
        The list of copied files or directories that were written to the file system, as if copyFilesToDir(File, File) had been called on each source file separately.
        Throws:
        IOException - When the file cannot be copied.
      • copyFilesToDir

        default List<File> copyFilesToDir​(File[] sourceFileOrDirectories,
                                          File targetDir,
                                          EFileConflictMode mode)
                                   throws IOException
        Copies the source files to the given target directory. If the source points to a directory, all files in that directory are copied (non-recursively) to the target. The target directory and all parent directories are created when they do not exist yet.

        Files in the target directory are overwritten if they exist already.

        Parameters:
        sourceFileOrDirectories - Files or directories with files to copy.
        targetDir - Target directory for the source files . Must be a directory and not a file.
        mode - How to proceed when the target file exists already.
        Returns:
        The list of copied files or directories that were written to the file system, as if copyFilesToDir(File, File) had been called on each source file separately.
        Throws:
        IOException - When the file cannot be copied.
        Since:
        7.0.5
      • copyFilesToDir

        @Deprecated
        default List<File> copyFilesToDir​(Iterable<File> sourceFileOrDirectories,
                                          File targetDir)
                                   throws IOException
        Copies the source files to the given target directory. If the source points to a directory, all files in that directory are copied (non-recursively) to the target. The target directory and all parent directories are created when they do not exist yet.

        Files in the target directory are overwritten if they exist already.

        Parameters:
        sourceFileOrDirectories - Files or directories with files to copy.
        targetDir - Target directory for the source files . Must be a directory and not a file.
        Returns:
        The list of copied files or directories that were written to the file system, as if copyFilesToDir(File, File) had been called on each source file separately.
        Throws:
        IOException - When the file cannot be copied.
      • copyFilesToDir

        default List<File> copyFilesToDir​(Iterable<File> sourceFileOrDirectories,
                                          File targetDir,
                                          EFileConflictMode mode)
                                   throws IOException
        Copies the source files to the given target directory. If the source points to a directory, all files in that directory are copied (non-recursively) to the target. The target directory and all parent directories are created when they do not exist yet.

        Files in the target directory are overwritten if they exist already.

        Parameters:
        sourceFileOrDirectories - Files or directories with files to copy.
        targetDir - Target directory for the source files . Must be a directory and not a file.
        mode - How to proceed when the target file exists already.
        Returns:
        The list of copied files or directories that were written to the file system, as if copyFilesToDir(File, File) had been called on each source file separately.
        Throws:
        IOException - When the file cannot be copied.
        Since:
        7.0.5
      • getAttachmentsFromCurrentNodes

        List<Attachment> getAttachmentsFromCurrentNodes​(Iterable<WorkflowNode> currentNodes)
        Returns all attachments from the given nodes. These nodes must currently be in the process of being executed. Nodes that did not create an attachments are omitted.
        Parameters:
        currentNodes - Currently executed nodes for which to retrieve the attachments.
        Returns:
        All attachments that were created by the specified nodes currently being executed.
        Since:
        8.2.0
        See Also:
        getAttachmentsFromPreviousNodes(Iterable)
      • getAttachmentsFromCurrentNodes

        default List<Attachment> getAttachmentsFromCurrentNodes​(WorkflowNode... currentNodes)
        Returns all attachments from the given nodes. These nodes must currently be in the process of being executed. Nodes that did not create an attachment are omitted.
        Parameters:
        currentNodes - Currently executed nodes for which to retrieve the attachments.
        Returns:
        All attachments that were created by the specified nodes currently being executed.
        Since:
        8.2.0
        See Also:
        getAttachmentsFromPreviousNodes(WorkflowNode[])
      • getAttachmentsFromPreviousNode

        List<List<Attachment>> getAttachmentsFromPreviousNode​(WorkflowNode previousNode)
        Returns all attachments from given node. The node must have been executed already. Nodes that did not create attachments are omitted. Note that a node may have been executed multiple times, e.g. when it was placed in a loop.
        Parameters:
        previousNode - Previous node for which to retrieve the attachments.
        Returns:
        A list with one item for each time the node was executed. Each item contains all attachments that were created the specified previous nodes during that execution.
        Since:
        8.1.0
      • getAttachmentsFromPreviousNodes

        List<Attachment> getAttachmentsFromPreviousNodes​(Iterable<WorkflowNode> previousNode)
        Returns all attachments from given nodes. These nodes must have been executed already. Nodes that did not create an attachment are omitted. When a node was executed multiple times, all attachments from all executions are returned.
        Parameters:
        previousNode - Previous nodes for which to retrieve the attachments.
        Returns:
        All attachments that were created the specified previous nodes.
        Since:
        8.1.0
      • getAttachmentsFromPreviousNodes

        default List<Attachment> getAttachmentsFromPreviousNodes​(WorkflowNode... previousNodes)
        Returns all attachments from the given previous nodes. Nodes that did not create an attachment are omitted.
        Parameters:
        previousNodes - Previous nodes for which to retrieve the attachments.
        Returns:
        All attachments that were created for the specified previous nodes.
        Since:
        8.1.0
      • getAttachmentsFromPreviousOrCurrentNodes

        default List<Attachment> getAttachmentsFromPreviousOrCurrentNodes​(Iterable<WorkflowNode> nodes)
        Returns all attachments from the given previous and current nodes (= node that either are currently being executed or that have finished execution). Nodes that did not create am attachment are omitted.

        When a node was executed multiple times, all attachments from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the attachments from the current execution if the current node is inside the loop.

        Parameters:
        nodes - Nodes for which to retrieve the attachments.
        Returns:
        All attachments that were created by the specified nodes.
        Since:
        8.2.0
      • getAttachmentsFromPreviousOrCurrentNodes

        default List<Attachment> getAttachmentsFromPreviousOrCurrentNodes​(WorkflowNode... nodes)
        Returns all attachments from the given previous and current nodes (= node that either are currently being executed or that have finished execution). Nodes that did not create an attachment are omitted.

        When a node was executed multiple times, all attachments from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the attachments from the current execution if the current node is inside the loop.

        Parameters:
        nodes - Nodes for which to retrieve the attachments.
        Returns:
        All attachments that were created by the specified nodes.
        Since:
        8.2.0
      • getAttachmentsFromUploadElements

        List<Attachment> getAttachmentsFromUploadElements​(List<String> uploadElements,
                                                          Vorgang formRecord,
                                                          IFormDataAdapter formDataAdapter)
                                                   throws de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException
        Determines the upload attachments from the specified form record.
        Parameters:
        uploadElements - Upload elements the given action required.
        formRecord - the Vorgang
        formDataAdapter - a IFormDataAdapter
        Returns:
        a list of Attachment objects from the form record
        Throws:
        de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException - When an attachment could not be read from the database.
      • getFileKeysFromCurrentNodes

        Set<String> getFileKeysFromCurrentNodes​(Iterable<WorkflowNode> currentNodes)
        Gets all file keys for which a file is available for at least one of the given current nodes. These nodes must currently be in the process of being executed (or nothing is returned). In other words, this returns all keys for which getFilesFromCurrentNodes(Set, Iterable) would return a non-empty result.
        Parameters:
        currentNodes - The current nodes for which to retrieve the file keys.
        Returns:
        All file keys for which a file is available for at least one of the given nodes.
      • getFileKeysFromCurrentTriggers

        Set<String> getFileKeysFromCurrentTriggers​(Iterable<WorkflowTrigger> currentTriggers)
        Gets all file keys for which a file is available for at least one of the given current triggers. These triggers must currently be firing (or nothing is returned). In other words, this returns all keys for which getFilesFromCurrentTriggers(Set, Iterable) would return a non-empty result.
        Parameters:
        currentTriggers - The current triggers for which to retrieve the file keys.
        Returns:
        All file keys for which a file is available for at least one of the given triggers.
      • getFileKeysFromPreviousNodes

        Set<String> getFileKeysFromPreviousNodes​(Iterable<WorkflowNode> previousNodes)
        Gets all file keys for which a file is available for at least one of the given previous nodes. In other words, this returns all keys for which getFilesFromPreviousNodes(Set, Iterable) could possibly return a result.

        When a node was executed multiple times, all file keys from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the file keys from the current execution if the current node is inside the loop.

        Parameters:
        previousNodes - The nodes for which to retrieve the file keys.
        Returns:
        All file keys for which a file is available for at least one of the given nodes.
      • getFileKeysFromPreviousTriggers

        Set<String> getFileKeysFromPreviousTriggers​(Iterable<WorkflowTrigger> previousTriggers)
        Gets all file keys for which a file is available for at least one of the given previous triggers. In other words, this returns all keys for which getFilesFromPreviousTriggers(Set, Iterable) could possibly return a result.

        When a trigger was fired multiple times, all file keys from all executions are returned.

        Parameters:
        previousTriggers - The triggers for which to retrieve the file keys.
        Returns:
        All file keys for which a file is available for at least one of the given triggers.
      • getFileValuesFromCurrentNodes

        default List<IWorkflowFileValue> getFileValuesFromCurrentNodes​(WorkflowNode... currentNodes)
        Gets all file values that were provided by the given current nodes. These nodes must currently be in the process of being executed (or nothing is returned).
        Parameters:
        currentNodes - The nodes for which to retrieve the file values.
        Returns:
        All file values from the given current nodes.
      • getFileValuesFromCurrentNodes

        List<IWorkflowFileValue> getFileValuesFromCurrentNodes​(Iterable<WorkflowNode> currentNodes)
        Gets all file values that were provided by the given current nodes. These nodes must currently be in the process of being executed (or nothing is returned).
        Parameters:
        currentNodes - The nodes for which to retrieve the file values.
        Returns:
        All file values from the given current nodes.
      • getFileValuesFromCurrentTriggers

        List<IWorkflowFileValue> getFileValuesFromCurrentTriggers​(Iterable<WorkflowTrigger> currentTriggers)
        Gets all file values that were provided by the given current triggers. These triggers must currently be firing (or nothing is returned).
        Parameters:
        currentTriggers - The triggers for which to retrieve the file values.
        Returns:
        All file values from the given current triggers.
      • getFileValuesFromCurrentTriggers

        default List<IWorkflowFileValue> getFileValuesFromCurrentTriggers​(WorkflowTrigger... currentTriggers)
        Gets all file values that were provided by the given current triggers. These triggers must currently be firing (or nothing is returned).
        Parameters:
        currentTriggers - The triggers for which to retrieve the file values.
        Returns:
        All file values from the given current triggers.
      • getFileValuesFromPreviousNodes

        List<IWorkflowFileValue> getFileValuesFromPreviousNodes​(Iterable<WorkflowNode> previousNodes)
        Gets all file values that were provided by the given previous nodes. These nodes must have been executed already (or nothing is returned).

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        Parameters:
        previousNodes - The nodes for which to retrieve the file values.
        Returns:
        All file values from the given previous nodes.
      • getFileValuesFromPreviousNodes

        default List<IWorkflowFileValue> getFileValuesFromPreviousNodes​(WorkflowNode... previousNodes)
        Gets all file values that were provided by the given previous nodes. These nodes must have been executed already (or nothing is returned).

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        Parameters:
        previousNodes - The nodes for which to retrieve the file values.
        Returns:
        All file values from the given previous nodes.
      • getFileValuesFromPreviousOrCurrentNodes

        default List<IWorkflowFileValue> getFileValuesFromPreviousOrCurrentNodes​(Iterable<WorkflowNode> nodes)
        Returns all files from the given previous and current nodes (= node that either are currently being executed or that have finished execution). Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that created executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        nodes - Nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified nodes.
        Since:
        8.2.0
      • getFileValuesFromPreviousOrCurrentNodes

        default List<IWorkflowFileValue> getFileValuesFromPreviousOrCurrentNodes​(WorkflowNode... nodes)
        Returns all files from the given previous and current nodes (= node that either are currently being executed or that have finished execution). Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that created executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        nodes - Nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified nodes.
        Since:
        8.2.0
      • getFileValuesFromPreviousOrCurrentTriggers

        default List<IWorkflowFileValue> getFileValuesFromPreviousOrCurrentTriggers​(Iterable<WorkflowTrigger> triggers)
        Returns all file values from the given previous and current triggers (=triggers that either are currently firing or that have fired in the past). Triggers that did not create a file or directory are omitted.

        When a trigger was executed multiple times, all files from all executions are returned.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        triggers - Triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified triggers.
        Since:
        8.2.0
      • getFileValuesFromPreviousOrCurrentTriggers

        default List<IWorkflowFileValue> getFileValuesFromPreviousOrCurrentTriggers​(WorkflowTrigger... triggers)
        Returns all file values from the given previous and current triggers (=triggers that either are currently firing or that have fired in the past). Triggers that did not create a file or directory are omitted.

        When a trigger was executed multiple times, all files from all executions are returned.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        triggers - Triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified triggers.
        Since:
        8.2.0
      • getFileValuesFromPreviousTriggers

        List<IWorkflowFileValue> getFileValuesFromPreviousTriggers​(Iterable<WorkflowTrigger> previousTriggers)
        Gets all file values that were provided by the given previous triggers. These triggers must have been fired already (or nothing is returned).

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        Parameters:
        previousTriggers - The triggers for which to retrieve the file values.
        Returns:
        All file values from the given previous triggers.
      • getFileValuesFromPreviousTriggers

        default List<IWorkflowFileValue> getFileValuesFromPreviousTriggers​(WorkflowTrigger... previousTriggers)
        Gets all file values that were provided by the given previous triggers. These triggers must have been fired already (or nothing is returned).

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        Parameters:
        previousTriggers - The triggers for which to retrieve the file values.
        Returns:
        All file values from the given previous triggers.
      • getFilesFromCurrentNodes

        List<File> getFilesFromCurrentNodes​(Set<String> fileKeys,
                                            Iterable<WorkflowNode> currentNodes)
        Returns all files from given nodes. These nodes must currently be in the process of being executed. Nodes that did not create a file or directory are omitted.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        currentNodes - Currently executed nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified nodes currently being executed.
        Since:
        8.2.0
        See Also:
        getFilesFromPreviousNodes(Iterable)
      • getFilesFromCurrentNodes

        default List<File> getFilesFromCurrentNodes​(Set<String> fileKeys,
                                                    WorkflowNode... currentNodes)
        Returns all files from given nodes. These nodes must currently be in the process of being executed. Nodes that did not create a file or directory are omitted.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        currentNodes - Current nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified nodes currently being executed.
        Since:
        8.2.0
        See Also:
        getFilesFromPreviousNodes(WorkflowNode[])
      • getFilesFromCurrentTriggers

        List<File> getFilesFromCurrentTriggers​(Set<String> fileKeys,
                                               Iterable<WorkflowTrigger> currentTriggers)
        Returns all files from given triggers, limited to triggers that are currently firing. Triggers that did not create a file or directory are omitted.

        When a trigger fired multiple times, only the current firing is considered.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        currentTriggers - Previous triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous triggers.
        Since:
        8.2.0
        See Also:
        getFilesFromPreviousTriggers(Set, Iterable)
      • getFilesFromCurrentTriggers

        default List<File> getFilesFromCurrentTriggers​(Set<String> fileKeys,
                                                       WorkflowTrigger... currentTriggers)
        Returns all files from given triggers, limited to triggers that are currently firing. Triggers that did not create a file or directory are omitted.

        When a trigger fired multiple times, only the current firing is considered.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        currentTriggers - Previous triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous triggers.
        Since:
        8.2.0
        See Also:
        getFilesFromPreviousTriggers(Set, WorkflowTrigger[])
      • getFilesFromPreviousNode

        @Deprecated
        default List<List<File>> getFilesFromPreviousNode​(WorkflowNode previousNode)
        Deprecated.
        Returns all files from given node. The node must have been executed already. Nodes that did not create a file or directory are omitted. Note that a node may have been executed multiple times, e.g. when it was placed in a loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        previousNode - Previous node for which to retrieve the files.
        Returns:
        A list with one item for each time the node was executed. Each item contains all files or directories that were created the specified previous nodes during that execution.
      • getFilesFromPreviousNode

        List<List<File>> getFilesFromPreviousNode​(Set<String> fileKeys,
                                                  WorkflowNode previousNode)
        Returns all files from given node. The node must have been executed already. Nodes that did not create a file or directory are omitted. Note that a node may have been executed multiple times, e.g. when it was placed in a loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        previousNode - Previous node for which to retrieve the files.
        Returns:
        A list with one item for each time the node was executed. Each item contains all files or directories that were created the specified previous nodes during that execution.
        Since:
        8.2.0
      • getFilesFromPreviousNodes

        @Deprecated
        default List<File> getFilesFromPreviousNodes​(Iterable<WorkflowNode> previousNode)
        Deprecated.
        Returns all files from given nodes. These nodes must have been executed already. Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that created executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        previousNode - Previous nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous nodes.
        See Also:
        getFilesFromCurrentNodes(Set, Iterable)
      • getFilesFromPreviousNodes

        @Deprecated
        default List<File> getFilesFromPreviousNodes​(WorkflowNode... previousNodes)
        Deprecated.
        Returns all files from the given previous nodes. Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        previousNodes - Previous nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous nodes.
      • getFilesFromPreviousNodes

        List<File> getFilesFromPreviousNodes​(Set<String> fileKeys,
                                             Iterable<WorkflowNode> previousNode)
        Returns all files from given nodes. These nodes must have been executed already. Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that created executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        previousNode - Previous nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous nodes.
        Since:
        8.2.0
        See Also:
        getFilesFromCurrentNodes(Set, Iterable)
      • getFilesFromPreviousNodes

        default List<File> getFilesFromPreviousNodes​(Set<String> fileKeys,
                                                     WorkflowNode... previousNodes)
        Returns all files from the given previous nodes. Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        previousNodes - Previous nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous nodes.
        Since:
        8.2.0
      • getFilesFromPreviousOrCurrentNodes

        default List<File> getFilesFromPreviousOrCurrentNodes​(Set<String> fileKeys,
                                                              Iterable<WorkflowNode> nodes)
        Returns all files from the given previous and current nodes (= node that either are currently being executed or that have finished execution). Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that created executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        nodes - Nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified nodes.
        Since:
        8.2.0
      • getFilesFromPreviousOrCurrentNodes

        default List<File> getFilesFromPreviousOrCurrentNodes​(Set<String> fileKeys,
                                                              WorkflowNode... nodes)
        Returns all files from the given previous and current nodes (= node that either are currently being executed or that have finished execution). Nodes that did not create a file or directory are omitted.

        When a node was executed multiple times, all files from all executions are returned if the current node is outside the loop that executed the node multiple times; or only the files from the current execution if the current node is inside the loop.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        nodes - Nodes for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified nodes.
        Since:
        8.2.0
      • getFilesFromPreviousOrCurrentTriggers

        default List<File> getFilesFromPreviousOrCurrentTriggers​(Set<String> fileKeys,
                                                                 Iterable<WorkflowTrigger> triggers)
        Returns all files from the given previous and current triggers (=triggers that either are currently firing or that have fired in the past). Triggers that did not create a file or directory are omitted.

        When a trigger was executed multiple times, all files from all executions are returned.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        triggers - Triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified triggers.
        Since:
        8.2.0
      • getFilesFromPreviousOrCurrentTriggers

        default List<File> getFilesFromPreviousOrCurrentTriggers​(Set<String> fileKeys,
                                                                 WorkflowTrigger... triggers)
        Returns all files from the given previous and current triggers (=triggers that either are currently firing or that have fired in the past). Triggers that did not create a file or directory are omitted.

        When a trigger was executed multiple times, all files from all executions are returned.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        triggers - Triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified triggers.
        Since:
        8.2.0
      • getFilesFromPreviousTrigger

        List<List<File>> getFilesFromPreviousTrigger​(Set<String> fileKeys,
                                                     WorkflowTrigger previousTrigger)
        Returns all files from given trigger, not including the current firing, if any. The trigger must have been fired already. Triggers that did not create a file or directory are omitted. Note that a trigger may have fired multiple times, e.g. when it was invoked manually multiple times during a workflow execution.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        previousTrigger - Previous trigger for which to retrieve the files.
        Returns:
        A list with one item for each time the trigger fired. Each item contains all files or directories that were created the specified previous triggers during that execution.
        Since:
        8.2.0
      • getFilesFromPreviousTriggers

        List<File> getFilesFromPreviousTriggers​(Set<String> fileKeys,
                                                Iterable<WorkflowTrigger> previousTriggers)
        Returns all files from given triggers, not including the current firing, if any. These triggers must have fired already. Triggers that did not create a file or directory are omitted.

        When a trigger fired multiple times, all files from all firings are returned.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        previousTriggers - Previous triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous triggers.
        Since:
        8.2.0
        See Also:
        getFilesFromCurrentTriggers(Set, Iterable)
      • getFilesFromPreviousTriggers

        default List<File> getFilesFromPreviousTriggers​(Set<String> fileKeys,
                                                        WorkflowTrigger... previousTriggers)
        Returns all files from the given previous triggers, not including the current firing, if any. These triggers must have fired already. Triggers that did not provide a file or directory are omitted.

        When a trigger was fired multiple times, all files from all firings are returned.

        The returned file(s) may be shared with other elements and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForTrigger(WorkflowTrigger, String...) or randomTempDirForTrigger(WorkflowTrigger, String...) when you need write output our temporary files.

        Parameters:
        previousTriggers - Previous triggers for which to retrieve the files.
        Returns:
        All files or directories that were created by the specified previous triggers.
        Since:
        8.2.0
        See Also:
        getFilesFromCurrentTriggers(Set, WorkflowTrigger[])
      • getFilesFromUploadElements

        default List<IResolvedFile> getFilesFromUploadElements​(IUploadConsuming consuming)
                                                        throws de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException,
                                                               IOException
        Same as getFilesFromUploadElements(List), but takes the parameters from the given IUploadConsuming corresponding.

        The returned file(s) may be shared with other nodes and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        consuming - Object with the upload element names for which to retrieve the files.
        Returns:
        List of the files that were uploaded for the given upload elements.
        Throws:
        de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException - When the files could not be read from the database.
        IOException - When the files could not be saved to the file system.
      • getFilesFromUploadElements

        List<IResolvedFile> getFilesFromUploadElements​(List<String> uploadElements)
                                                throws IOException
        Returns a list of all files from the given upload elements. Upload elements with no uploaded file are skipped.

        The returned file(s) may be shared with other nodes and should be thought of a read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        uploadElements - Upload elements the given action required. Must contain the FormElement.getAlias() of the form upload element.
        Returns:
        List of the files that were uploaded for the given upload elements.
        Throws:
        de.xima.cmn.dao.exceptions.AbstractDaoRuntimeException - When the files could not be read from the database.
        IOException - When the files could not be saved to the file system.
      • guessContentType

        IGuessedContentType guessContentType​(File file)
        Parameters:
        file - A file to analyze.
        Returns:
        The best guess for the content type of the given file. May return application/octet-stream when no better guess is available When the file could not be read or accessed, returns application/octet-stream.
      • guessContentType

        IGuessedContentType guessContentType​(String fileName,
                                             byte[] contents)
        Parameters:
        fileName - Name of the file, with the extension.
        contents - Contents of the file to analyze.
        Returns:
        The best guess for the content type of the given file. May return application/octet-stream when no better guess is available.
      • handleFileProvision

        default <E extends ThrowableIHandleFileProvisionResult handleFileProvision​(IFileProvision provision,
                                                                                     IFileProvisionOptions<E> options,
                                                                                     File... files)
                                                                              throws E extends Throwable
        Applies the configuration of the given IFileProvision to the given files. This may include actions such as attaching the files to the current form record.
        Type Parameters:
        E - Type of the exception that may be thrown by the error processor.
        Parameters:
        provision - Configuration for the file provision.
        options - Options for how to handle the provision. You can use INodeExecutionParams.standardFileProvisionOptions()
        files - Files to handle.
        Returns:
        Result of the file provision.
        Throws:
        E - When an error occurs during the file provision and the provided error processors throws that exception.
        E extends Throwable
      • handleFileProvision

        default <E extends ThrowableIHandleFileProvisionResult handleFileProvision​(IFileProvision provision,
                                                                                     IFileProvisionOptions<E> options,
                                                                                     Path... files)
                                                                              throws E extends Throwable
        Applies the configuration of the given IFileProvision to the given files. This may include actions such as attaching the files to the current form record.
        Type Parameters:
        E - Type of the exception that may be thrown by the error processor.
        Parameters:
        provision - Configuration for the file provision.
        options - Options for how to handle the provision. You can use INodeExecutionParams.standardFileProvisionOptions()
        files - Files to handle.
        Returns:
        Result of the file provision.
        Throws:
        E - When an error occurs during the file provision and the provided error processors throws that exception.
        E extends Throwable
      • handleFileProvision

        default <E extends ThrowableIHandleFileProvisionResult handleFileProvision​(IFileProvision provision,
                                                                                     IFileProvisionOptions<E> options,
                                                                                     Stream<Path> files)
                                                                              throws E extends Throwable
        Applies the configuration of the given IFileProvision to the given files. This may include actions such as attaching the files to the current form record.
        Type Parameters:
        E - Type of the exception that may be thrown by the error processor.
        Parameters:
        provision - Configuration for the file provision.
        options - Options for how to handle the provision. You can use INodeExecutionParams.standardFileProvisionOptions()
        files - Files to handle.
        Returns:
        Result of the file provision.
        Throws:
        E - When an error occurs during the file provision and the provided error processors throws that exception.
        E extends Throwable
      • handleFileProvision

        <E extends ThrowableIHandleFileProvisionResult handleFileProvision​(IFileProvision provision,
                                                                             IFileProvisionOptions<E> options,
                                                                             Iterable<Path> files)
                                                                      throws E extends Throwable
        Applies the configuration of the given IFileProvision to the given files. This may include actions such as attaching the files to the current form record.
        Type Parameters:
        E - Type of the exception that may be thrown by the error processor.
        Parameters:
        provision - Configuration for the file provision.
        options - Options for how to handle the provision. You can use INodeExecutionParams.standardFileProvisionOptions()
        files - Files to handle.
        Returns:
        Result of the file provision.
        Throws:
        E - When an error occurs during the file provision and the provided error processors throws that exception.
        E extends Throwable
      • isHasExtension

        default boolean isHasExtension​(File file,
                                       Iterable<String> extensions)
        Checks whether the given file has one of the given extensions.
        Parameters:
        file - A file to check.
        extensions - Extensions to check for. May or may not contain a leading period.
        Returns:
        true if the file has one of the given extensions, false otherwise or when the given extensions are null or empty.
      • isHasExtension

        default boolean isHasExtension​(File file,
                                       String... extensions)
        Checks whether the given file has one of the given extensions.
        Parameters:
        file - A file to check.
        extensions - Extensions to check for. May or may not contain a leading period.
        Returns:
        true if the file has one of the given extensions, false otherwise or when the given extensions are null or empty.
      • isHasExtension

        default boolean isHasExtension​(String fileName,
                                       Iterable<String> extensions)
        Checks whether the given file name has one of the given extensions.
        Parameters:
        fileName - A file name to check.
        extensions - Extensions to check for. May or may not contain a leading period.
        Returns:
        true if the file name has one of the given extensions, false otherwise or when the given extensions are null or empty.
      • isHasExtension

        boolean isHasExtension​(String fileName,
                               String... extensions)
        Checks whether the given file name has one of the given extensions.
        Parameters:
        fileName - A file name to check.
        extensions - Extensions to check for. May or may not contain a leading period.
        Returns:
        true if the file name has one of the given extensions, false otherwise or when the given extensions are null or empty.
      • listFiles

        default List<File> listFiles​(File directory,
                                     boolean recursive,
                                     Iterable<String> extensions)
                              throws IOException
        Lists all files contained in the given directory. If the given directory is a File.isFile(), a singleton list with that file is returned, or an empty list if the file does not match the extension. If recursive is enabled, this method walks all directories recursively and only returns the files they contain.

        The returned list only contains files, never directories.

        Parameters:
        directory - Directory with files to list.
        recursive - true to list files in subdirectories, false to list only the immediate content of the given directory.
        extensions - A list of extensions by which to filter the returned files. When null or empty, all files are returned.
        Returns:
        All files in the given directory, empty list if no files are found.
        Throws:
        IOException - When the contents of the directory could not be read.
      • listFiles

        List<File> listFiles​(File directory,
                             boolean recursive,
                             String... extensions)
                      throws IOException
        Lists all files contained in the given directory. If the given directory is a File.isFile(), a singleton list with that file is returned. If recursive is enabled, this method walks all directories recursively and only returns the files they contain.

        The returned list only contains files, never directories.

        Parameters:
        directory - Directory with files to list.
        recursive - true to list files in subdirectories, false to list only the immediate content of the given directory.
        extensions - A list of extensions by which to filter the returned files. When null or empty, all files are returned.
        Returns:
        All files in the given directory, empty list if no files are found.
        Throws:
        IOException - When the contents of the directory could not be read.
      • listFiles

        default List<File> listFiles​(File[] directories,
                                     boolean recursive,
                                     Iterable<String> extensions)
                              throws IOException
        Lists all files contained in the given directories. Duplicate files are excluded in the returned list .If a given directory is a File.isFile(), that file is returned in the resulting list. If recursive is enabled, this method walks all directories recursively and only returns the files they contain.

        The returned list only contains files, never directories.

        Parameters:
        directories - Directories with files to list.
        recursive - true to list files in subdirectories, false to list only the immediate content of the given directory.
        extensions - A list of extensions by which to filter the returned files. When null or empty, all files are returned.
        Returns:
        All files in the given directory, empty list if no files are found.
        Throws:
        IOException - When the contents of the directory could not be read.
      • listFiles

        default List<File> listFiles​(File[] directories,
                                     boolean recursive,
                                     String... extensions)
                              throws IOException
        Lists all files contained in the given directories. Duplicate files are excluded in the returned list .If a given directory is a File.isFile(), that file is returned in the resulting list. If recursive is enabled, this method walks all directories recursively and only returns the files they contain.

        The returned list only contains files, never directories.

        Parameters:
        directories - Directories with files to list.
        recursive - true to list files in subdirectories, false to list only the immediate content of the given directory.
        extensions - A list of extensions by which to filter the returned files. When null or empty, all files are returned.
        Returns:
        All files in the given directory, empty list if no files are found.
        Throws:
        IOException - When the contents of the directory could not be read.
      • listFiles

        default List<File> listFiles​(Iterable<File> directories,
                                     boolean recursive,
                                     Iterable<String> extensions)
                              throws IOException
        Lists all files contained in the given directories. Duplicate files are excluded in the returned list .If a given directory is a File.isFile(), that file is returned in the resulting list. If recursive is enabled, this method walks all directories recursively and only returns the files they contain.

        The returned list only contains files, never directories.

        Parameters:
        directories - Directories with files to list.
        recursive - true to list files in subdirectories, false to list only the immediate content of the given directory.
        extensions - A list of extensions by which to filter the returned files. When null or empty, all files are returned.
        Returns:
        All files in the given directory, empty list if no files are found.
        Throws:
        IOException - When the contents of the directory could not be read.
      • listFiles

        List<File> listFiles​(Iterable<File> directories,
                             boolean recursive,
                             String... extensions)
                      throws IOException
        Lists all files contained in the given directories. Duplicate files are excluded in the returned list .If a given directory is a File.isFile(), that file is returned in the resulting list. If recursive is enabled, this method walks all directories recursively and only returns the files they contain.

        The returned list only contains files, never directories.

        Parameters:
        directories - Directories with files to list.
        recursive - true to list files in subdirectories, false to list only the immediate content of the given directory.
        extensions - A list of extensions by which to filter the returned files. When null or empty, all files are returned.
        Returns:
        All files in the given directory and all subdirectories, empty list if no files are found.
        Throws:
        IOException - When the contents of the directory could not be read.
      • randomSourceDirForNode

        default File randomSourceDirForNode​(WorkflowNode node,
                                            String... subDirs)
                                     throws IOException
        Creates a random temporary directory inside the given source directory of the node. This may be used by generic helper methods that need to create a different directory each time they are called. This is essentially the same as creating a random temporary directory inside the directory returned by sourceDirForNode

        To find nodes, use the node locator IWorkflowExecutionContext.node()

        Parameters:
        node - The node for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A random temporary directory inside the directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
        See Also:
        IWorkflowExecutionContext.node()
      • randomSourceDirForTrigger

        default File randomSourceDirForTrigger​(WorkflowTrigger trigger,
                                               String... subDirs)
                                        throws IOException
        Creates a random temporary directory inside the given source directory of the trigger. This may be used by generic helper methods that need to create a different directory each time they are called. This is essentially the same as creating a random temporary directory inside the directory returned by sourceDirForTrigger
        Parameters:
        trigger - The trigger for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A random temporary directory inside the directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
      • randomTargetDirForNode

        default File randomTargetDirForNode​(WorkflowNode node,
                                            String... subDirs)
                                     throws IOException
        Creates a random temporary directory inside the given target directory of the node. This may be used by generic helper methods that need to create a different directory each time they are called. This is essentially the same as creating a random temporary directory inside the directory returned by targetDirForNode

        To find nodes, use the node locator IWorkflowExecutionContext.node()

        Parameters:
        node - The node for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A random temporary directory inside the directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
        See Also:
        IWorkflowExecutionContext.node()
      • randomTargetDirForTrigger

        default File randomTargetDirForTrigger​(WorkflowTrigger trigger,
                                               String... subDirs)
                                        throws IOException
        Creates a random temporary directory inside the given target directory of the trigger. This may be used by generic helper methods that need to create a different directory each time they are called. This is essentially the same as creating a random temporary directory inside the directory returned by targetDirForTrigger
        Parameters:
        trigger - The trigger for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A random temporary directory inside the directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
      • randomTempDirForNode

        File randomTempDirForNode​(WorkflowNode node,
                                  String... subDirs)
                           throws IOException
        Creates a random temporary directory inside the given subdirectory for the node. This may be used by generic helper methods that need to create a different directory each time they are called. This is essentially the same as creating a random temporary directory inside the directory returned by tempDirForNode

        To find nodes, use the node locator IWorkflowExecutionContext.node()

        Parameters:
        node - The node for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A random temporary directory inside the directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
        See Also:
        IWorkflowExecutionContext.node()
      • randomTempDirForTrigger

        File randomTempDirForTrigger​(WorkflowTrigger trigger,
                                     String... subDirs)
                              throws IOException
        Creates a random temporary directory inside the given subdirectory for the trigger. This may be used by generic helper methods that need to create a different directory each time they are called. This is essentially the same as creating a random temporary directory inside the directory returned by tempDirForTrigger
        Parameters:
        trigger - The trigger for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A random temporary directory inside the directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
      • resolveReferencedAttachments

        IResolvedAttachmentList resolveReferencedAttachments​(WorkflowNode node,
                                                             IReferencedAttachmentList attachmentList,
                                                             IAttachmentSearchOptions options)
        Returns the attachments represented by the given descriptor. When the attachments of a previous node are referenced and that node was executed multiple times, all attachments from all executions of that node are returned.

        Different actions may require errors to be handled differently, so this method never throws any exceptions. Use the returned IResolvedAttachmentList instance to handle errors. In particular, if you wish to use the standard error behavior, you can use collectResult together with the standardAttachmentErrorsSingle or standardAttachmentErrorsMultiple method from INodeExecutionParams that are passed to the execute method.

        Parameters:
        node - Node that requested the attachments. Used as the context for resolving attachments, e.g. when the node is within a loop.
        attachmentList - Attachment descriptor with the attachment references to resolve.
        options - Options for searching attachments. When null, a reasonable default is used.
        Returns:
        The resolved attachments.
        Since:
        8.1.0
      • resolveReferencedFiles

        IResolvedFileList resolveReferencedFiles​(WorkflowNode node,
                                                 IReferencedFileList fileList,
                                                 IFileSearchOptions options)
        Returns the files represented by the given descriptor. When the files of a previous node are referenced and that node was executed multiple times, all files from all executions of that node are returned.

        Different actions may require errors to be handled differently, so this method never throws any exceptions. Use the returned IResolvedFileList instance to handle errors. In particular, if you wish to use the standard error behavior, you can use collectResult together with the standardFileErrorsSingle or standardFileErrorsMultiple method from INodeExecutionParams that are passed to the execute method.

        The returned file(s) may be shared with other nodes and should be thought of as read-only. You may read the file(s), but should neither modify nor delete the file(s). You should also not write other files to the directory of the returned file(s), use targetDirForNode(WorkflowNode, String...) or randomTempDirForNode(WorkflowNode, String...) when you need write output our temporary files.

        Parameters:
        node - Node that requested the files. Used e.g. to determine an appropriate temporary directory.
        fileList - File descriptor with the file references to resolve.
        options - Options for searching files. When null, a reasonable default is used.
        Returns:
        The resolved multi files, with the original file names and the directory containing the files.
      • sanitizeFilename

        default String sanitizeFilename​(String fileName)
        Parameters:
        fileName - A possibly unsafe name (such as user input) that you would like to use as a filename.
        Returns:
        A safe filename that can be used to create a new file on the file system. It is only a file name without any path separators.
        See Also:
        tempDirForNode(WorkflowNode, String...)
      • sanitizeFilename

        String sanitizeFilename​(String fileName,
                                IPlaceholderEscaper placeholderEscaper)
        Parameters:
        fileName - A possibly unsafe name (such as user input) that you would like to use as a filename.
        placeholderEscaper - When null, no placeholders are escaped. When not null, placeholders are escaped and these parameters indicates how placeholders are inserted into the text body.
        Returns:
        A safe filename that can be used to create a new file on the file system. It is only a file name without any path separators.
        See Also:
        tempDirForNode(WorkflowNode, String...)
      • sourceDirForNode

        default File sourceDirForNode​(WorkflowNode node,
                                      String... subDirs)
                               throws IOException
        Shortcut for getTempDirForNode(node, "source"). The default directory for storing intermediate files that are required only during execution of the node, but are not returned and made available to other nodes. When a path is given, this method ensures that the returned directory is inside the source directory, even when the given path contains navigation symbols such as ...
        Parameters:
        node - The node for which the source directory should be returned.
        subDirs - Optional path segments to access a subdirectory or the source directory.
        Returns:
        The temporary source directory for the given node, a subdirectory of the node's temporary directory.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • sourceDirForTrigger

        default File sourceDirForTrigger​(WorkflowTrigger trigger,
                                         String... subDirs)
                                  throws IOException
        Shortcut for getTempDirForTrigger(trigger, "source"). The default directory for storing intermediate files that are required only during execution of the trigger, but are not returned and made available to other triggers. When a path is given, this method ensures that the returned directory is inside the source directory, even when the given path contains navigation symbols such as ...
        Parameters:
        trigger - The trigger for which the source directory should be returned.
        subDirs - Optional path segments to access a subdirectory or the source directory.
        Returns:
        The temporary source directory for the given trigger, a subdirectory of the trigger's temporary directory.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • sourceFileForNode

        default File sourceFileForNode​(WorkflowNode node,
                                       String... pathSegments)
                                throws IOException
        Shortcut for getTempFileForNode(node, "source"). Creates a file in the default directory for storing intermediate files that are required only during execution of the node, but are not returned and made available to other nodes. When a path is given, this method ensures that the returned file is inside the source directory, even when the given path contains navigation symbols such as ...

        Compared with sourceDirForNode(WorkflowNode, String...), this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call sourceDirForNode(node, "foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        node - The node for which the source directory should be returned.
        pathSegments - Optional path segments to access a subdirectory or the source directory. The last item must be the file name.
        Returns:
        A file within the temporary source directory for the given node.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • sourceFileForNode

        default File sourceFileForNode​(WorkflowTrigger trigger,
                                       String... pathSegments)
                                throws IOException
        Shortcut for getTempFileForTrigger(trigger, "source"). Creates a file in the default directory for storing intermediate files that are required only during execution of the trigger, but are not returned and made available to other triggers. When a path is given, this method ensures that the returned file is inside the source directory, even when the given path contains navigation symbols such as ...

        Compared with sourceDirForTrigger(WorkflowTrigger, String...), this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call sourceDirForTrigger(trigger, "foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        trigger - The trigger for which the source directory should be returned.
        pathSegments - Optional path segments to access a subdirectory or the source directory. The last item must be the file name.
        Returns:
        A file within the temporary source directory for the given trigger.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • subDirectory

        default File subDirectory​(File baseDir,
                                  Iterable<String> subDirs)
                           throws IOException
        Starting at the given base directory, accesses the given subdirectories, creates that subdirectory if necessary, and returns a file corresponding to that subdirectory.

        Each item in the given subdirectory is sanitized and should not contain path separators or relative paths. When the subDirs contains n non-empty items, it is guaranteed that the baseDir is the nth parent of the returned directory. So for example:

         // "/tmp/foo"
         subDirectory("/tmp", "foo");
         // "/tmp/bar"
         subDirectory("/tmp", "../bar");
         // "/tmp/bar/baz"
         subDirectory("/tmp", "../bar", "baz");
         
        Parameters:
        baseDir - Base directory.
        subDirs - A list of subdirectories. Should be an absolute path. Empty names are ignored, e.g. passing ["foo", "", "bar] is the same as passing ["foo", "bar].
        Returns:
        The file pointing to the path corresponding to <dir>/subDirs[0]/subDirs[1]/.../subDirs[len - 1]. Non-existing directories will be created.
        Throws:
        IOException - When the subdirectory could not be created.
      • subDirectory

        File subDirectory​(File baseDir,
                          String... subDirs)
                   throws IOException
        Starting at the given base directory, accesses the given subdirectories, creates that subdirectory if necessary, and returns a file corresponding to that subdirectory.

        Each item in the given subdirectory is sanitized and should not contain path separators or relative paths. When the subDirs contains n non-empty items, it is guaranteed that the baseDir is the nth parent of the returned directory. So for example:

         // "/tmp/foo"
         subDirectory("/tmp", "foo");
         // "/tmp/bar"
         subDirectory("/tmp", "../bar");
         // "/tmp/bar/baz"
         subDirectory("/tmp", "../bar", "baz");
         
        Parameters:
        baseDir - Base directory.
        subDirs - A list of subdirectories. Should be an absolute path. Empty names are ignored, e.g. passing ["foo", "", "bar] is the same as passing ["foo", "bar].
        Returns:
        The file pointing to the path corresponding to <dir>/subDirs[0]/subDirs[1]/.../subDirs[len - 1]. Non-existing directories will be created.
        Throws:
        IOException - When the subdirectory could not be created.
      • subFile

        default File subFile​(File baseDir,
                             Iterable<String> subDirs)
                      throws IOException
        Similar to subDirectory(File, String...), but with the different that this method does not create a directory for the last item in the given subDirs. So if you call subDir("path/to/base/dir". "foo", "bar.txt, it would attempt to create the directories foo and bar.txt. This method only creates the node directory.
        Parameters:
        baseDir - The base directory. Should be an absolute path.
        subDirs - A list of subdirectories to access or create in the base directory. Empty names are ignored, e.g. passing ["foo", "", "bar] is the same as passing ["foo", "bar].
        Returns:
        The file pointing to the path corresponding to <dir>/subDirs[0]/subDirs[1]/.../subDirs[len - 1]. Non-existing directories will be created (except for the last item in the given subDirs).
        Throws:
        IOException - When the subdirectory could not be created.
      • subFile

        File subFile​(File baseDir,
                     String... subDirs)
              throws IOException
        Similar to subDirectory(File, String...), but with the different that this method does not create a directory for the last item in the given subDirs. So if you call subDir("path/to/base/dir". "foo", "bar.txt, it would attempt to create the directories foo and bar.txt. This method only creates the node directory.
        Parameters:
        baseDir - The base directory. Should be an absolute path.
        subDirs - A list of subdirectories to access or create in the base directory. Empty names are ignored, e.g. passing ["foo", "", "bar] is the same as passing ["foo", "bar].
        Returns:
        The file pointing to the path corresponding to <dir>/subDirs[0]/subDirs[1]/.../subDirs[len - 1]. Non-existing directories will be created (except for the last item in the given subDirs).
        Throws:
        IOException - When the subdirectory could not be created.
      • targetDirForNode

        default File targetDirForNode​(WorkflowNode node,
                                      String... subDirs)
                               throws IOException
        Shortcut for getTempDirForNode(node, "target"). The default directory for storing files that are returned and made available to other nodes. When a path is given, this method ensures that the returned directory is inside the target directory, even when the given path contains navigation symbols such as ...
        Parameters:
        node - The node for which the target directory should be returned.
        subDirs - Optional path segments to access a subdirectory or the target directory.
        Returns:
        The temporary source directory for the given node, a subdirectory of the node's temporary directory.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • targetDirForTrigger

        default File targetDirForTrigger​(WorkflowTrigger trigger,
                                         String... subDirs)
                                  throws IOException
        Shortcut for getTempDirForTrigger(trigger, "target"). The default directory for storing files that are returned and made available to other triggers. When a path is given, this method ensures that the returned directory is inside the target directory, even when the given path contains navigation symbols such as ...
        Parameters:
        trigger - The trigger for which the target directory should be returned.
        subDirs - Optional path segments to access a subdirectory or the target directory.
        Returns:
        The temporary source directory for the given trigger, a subdirectory of the trigger's temporary directory.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • targetFileForNode

        default File targetFileForNode​(WorkflowNode node,
                                       String... subDirs)
                                throws IOException
        Shortcut for getTempFileForNode(node, "target"). The default directory for storing files that are returned and made available to other nodes. When a path is given, this method ensures that the returned file is inside the target directory, even when the given path contains navigation symbols such as ...

        Compared with targetDirForNode, this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call targetDirForNode(node, "foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        node - The node for which the target directory should be returned.
        subDirs - Optional path segments to access a subdirectory or the target directory.
        Returns:
        A file within the temporary source directory for the given node.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • targetFileForTrigger

        default File targetFileForTrigger​(WorkflowTrigger trigger,
                                          String... subDirs)
                                   throws IOException
        Shortcut for getTempFileForTrigger(trigger, "target"). The default directory for storing files that are returned and made available to other triggers. When a path is given, this method ensures that the returned file is inside the target directory, even when the given path contains navigation symbols such as ...

        Compared with targetDirForTrigger, this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call targetDirForTrigger(trigger, "foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        trigger - The trigger for which the target directory should be returned.
        subDirs - Optional path segments to access a subdirectory or the target directory.
        Returns:
        A file within the temporary source directory for the given trigger.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • tempDirForNode

        File tempDirForNode​(WorkflowNode node,
                            String... subDirs)
                     throws IOException
        Path to the temporary target directory for the given workflow node. This directory may be used to store files created by the workflow node. The directory path that is returned points to a directory that exists on the file system (if necessary, it is created when calling this method). The directory will be deleted once execution of the workflow finishes. When a path is given, this method ensures that the returned directory is inside the temporary directory, even when the given path contains navigation symbols such as ...
        Parameters:
        node - The node for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        The directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
        See Also:
        To find nodes, use the node locator
      • tempDirForTrigger

        File tempDirForTrigger​(WorkflowTrigger trigger,
                               String... subDirs)
                        throws IOException
        Path to the temporary target directory for the given workflow trigger. This directory may be used to store files created by the workflow trigger. The directory path that is returned points to a directory that exists on the file system (if necessary, it is created when calling this method). The directory will be deleted once execution of the workflow finishes. When a path is given, this method ensures that the returned directory is inside the temporary directory, even when the given path contains navigation symbols such as ...
        Parameters:
        trigger - The trigger for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        The directory for the given processed item, or a subdirectory if subDirs is given.
        Throws:
        IOException - When the target directory could not be acquired or created.
      • tempDirShared

        File tempDirShared​(String... subDirs)
                    throws IOException
        Return a path to the temporary directory shared by all workflow nodes. Usually you should not be using this, use tempDirForNode(WorkflowNode, String...) instead. When a path is given, this method ensures that the returned directory is inside the temporary directory, even when the given path contains navigation symbols such as ...
        Parameters:
        subDirs - Optional path segments to access a subdirectory, or a subdirectory if subDirs is given.
        Returns:
        Temporary directory for the current workflow execution.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • tempFileForNode

        File tempFileForNode​(WorkflowNode node,
                             String... subDirs)
                      throws IOException
        Returns the path to a file in the temporary target directory for the given workflow node. This directory may be used to store files created by the workflow node. The directory of the file returned by this method point to a directory that exists on the file system (if necessary, it is created when calling this method). The directory will be deleted once execution of the workflow finishes. When a path is given, this method ensures that the returned file is inside the temporary directory, even when the given path contains navigation symbols such as ...

        Compared with tempDirForNode, this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call tempDirForNode(node, "foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        node - The node for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A file within the directory for the given processed item.
        Throws:
        IOException - When the target directory could not be acquired or created.
        See Also:
        To find nodes, use the node locator
      • tempFileForTrigger

        File tempFileForTrigger​(WorkflowTrigger trigger,
                                String... subDirs)
                         throws IOException
        Returns the path to a file in the temporary target directory for the given workflow trigger. This directory may be used to store files created by the workflow trigger. The directory of the file returned by this method point to a directory that exists on the file system (if necessary, it is created when calling this method). The directory will be deleted once execution of the workflow finishes. When a path is given, this method ensures that the returned file is inside the temporary directory, even when the given path contains navigation symbols such as ...

        Compared with tempDirForTrigger, this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call tempDirForTrigger(trigger, "foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        trigger - The trigger for which the temporary directory should be returned.
        subDirs - Optional path segments to access a subdirectory.
        Returns:
        A file within the directory for the given processed item.
        Throws:
        IOException - When the target directory could not be acquired or created.
      • tempFileShared

        File tempFileShared​(String... subDirs)
                     throws IOException
        Return a file within to the temporary directory shared by all workflow nodes. Usually you should not be using this, use tempDirForNode(WorkflowNode, String...) instead. When a path is given, this method ensures that the returned file is inside the temporary directory, even when the given path contains navigation symbols such as ...

        Compared with tempDirShared(String...), this method interprets the last item of subDirs as a file and does not attempt to create a directory for that. E.g. if you call tempDirShared("foo", "bar.txt", it would attempt to create the directories foo and bar.txt. This method only creates the foo directory.

        Parameters:
        subDirs - Optional path segments to access a subdirectory, or a subdirectory if subDirs is given.
        Returns:
        Temporary directory for the current workflow execution.
        Throws:
        IOException - When intermediate non-existing directories could not be created.
      • withExtension

        File withExtension​(File file,
                           String newExtension)
        Changes the extension of the file name to the given extension.
        Parameters:
        file - Input file for which to change the extension.
        newExtension - New extension for the file. When this is empty, the extension is removed. May or may not start with a period.
        Returns:
        A new file object with the path and name, but with the extension changed to the given new extension.
      • withExtension

        String withExtension​(String fileName,
                             String newExtension)
        Changes the extension of the file name to the given extension.
        Parameters:
        fileName - Input file name for which to change the extension.
        newExtension - New extension for the file. When this is empty, the extension is removed. May or may not start with a period.
        Returns:
        A new file name with the path and name, but with the extension changed to the given new extension.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowNode node,
                                      byte[] data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the sourceDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the source directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowNode node,
                                      File data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the sourceDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the source directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowNode node,
                                      IFileProviding<?,​? extends IFileDataEntity<?>> providing,
                                      String... subDirs)
                               throws IOException,
                                      de.xima.cmn.dao.exceptions.ReadException
        Writes the given binary data to a file in the sourceDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose source directory is used to create the file.
        providing - An instance that provides the binary data to write to the file system.
        subDirs - Optional subdirectories in temporary directory where the file is written. The file name is taken from the given providing.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
        de.xima.cmn.dao.exceptions.ReadException - When the data could not be read from the database.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowNode node,
                                      InputStream data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the sourceDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the source directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowTrigger trigger,
                                      byte[] data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the sourceDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the source directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowTrigger trigger,
                                      File data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the sourceDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the source directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowTrigger trigger,
                                      IFileProviding<?,​? extends IFileDataEntity<?>> providing,
                                      String... subDirs)
                               throws IOException,
                                      de.xima.cmn.dao.exceptions.ReadException
        Writes the given binary data to a file in the sourceDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose source directory is used to create the file.
        providing - An instance that provides the binary data to write to the file system.
        subDirs - Optional subdirectories in temporary directory where the file is written. The file name is taken from the given providing.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
        de.xima.cmn.dao.exceptions.ReadException - When the data could not be read from the database.
      • writeToSourceDir

        default File writeToSourceDir​(WorkflowTrigger trigger,
                                      InputStream data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the sourceDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the source directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowNode node,
                                      byte[] data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the targetDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the target directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowNode node,
                                      File data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the targetDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the target directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowNode node,
                                      IFileProviding<?,​? extends IFileDataEntity<?>> providing,
                                      String... subDirs)
                               throws IOException,
                                      de.xima.cmn.dao.exceptions.ReadException
        Writes the given binary data to a file in the targetDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose target directory is used to create the file.
        providing - An instance that provides the binary data to write to the file system.
        subDirs - Optional subdirectories in temporary directory where the file is written. The file name is taken from the given providing.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
        de.xima.cmn.dao.exceptions.ReadException - When the data could not be read from the database.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowNode node,
                                      InputStream data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the targetDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the target directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowTrigger trigger,
                                      byte[] data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the targetDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the target directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowTrigger trigger,
                                      File data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the targetDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the target directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowTrigger trigger,
                                      IFileProviding<?,​? extends IFileDataEntity<?>> providing,
                                      String... subDirs)
                               throws IOException,
                                      de.xima.cmn.dao.exceptions.ReadException
        Writes the given binary data to a file in the targetDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose target directory is used to create the file.
        providing - An instance that provides the binary data to write to the file system.
        subDirs - Optional subdirectories in temporary directory where the file is written. The file name is taken from the given providing.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
        de.xima.cmn.dao.exceptions.ReadException - When the data could not be read from the database.
      • writeToTargetDir

        default File writeToTargetDir​(WorkflowTrigger trigger,
                                      InputStream data,
                                      String... path)
                               throws IOException
        Writes the given binary data to a file in the targetDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the target directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTempDir

        default File writeToTempDir​(WorkflowNode node,
                                    byte[] data,
                                    String... path)
                             throws IOException
        Writes the given binary data to a file in the tempDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the temporary directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTempDir

        default File writeToTempDir​(WorkflowNode node,
                                    File data,
                                    String... path)
                             throws IOException
        Writes the given binary data to a file in the tempDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the temporary directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTempDir

        File writeToTempDir​(WorkflowNode node,
                            IFileProviding<?,​? extends IFileDataEntity<?>> providing,
                            String... subDirs)
                     throws IOException,
                            de.xima.cmn.dao.exceptions.ReadException
        Writes the given binary data to a file in the tempDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        providing - An instance that provides the binary data to write to the file system.
        subDirs - Optional subdirectories in temporary directory where the file is written. The file name is taken from the given providing.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
        de.xima.cmn.dao.exceptions.ReadException - When the data could not be read from the database.
      • writeToTempDir

        File writeToTempDir​(WorkflowNode node,
                            InputStream data,
                            String... path)
                     throws IOException
        Writes the given binary data to a file in the tempDirForNode(WorkflowNode, String...) of the given node, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        node - The node whose temporary directory is used to create the file.
        path - Desired path in the temporary directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTempDir

        default File writeToTempDir​(WorkflowTrigger trigger,
                                    byte[] data,
                                    String... path)
                             throws IOException
        Writes the given binary data to a file in the tempDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the temporary directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTempDir

        default File writeToTempDir​(WorkflowTrigger trigger,
                                    File data,
                                    String... path)
                             throws IOException
        Writes the given binary data to a file in the tempDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the temporary directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
      • writeToTempDir

        File writeToTempDir​(WorkflowTrigger trigger,
                            IFileProviding<?,​? extends IFileDataEntity<?>> providing,
                            String... subDirs)
                     throws IOException,
                            de.xima.cmn.dao.exceptions.ReadException
        Writes the given binary data to a file in the tempDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        providing - An instance that provides the binary data to write to the file system.
        subDirs - Optional subdirectories in temporary directory where the file is written. The file name is taken from the given providing.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.
        de.xima.cmn.dao.exceptions.ReadException - When the data could not be read from the database.
      • writeToTempDir

        File writeToTempDir​(WorkflowTrigger trigger,
                            InputStream data,
                            String... path)
                     throws IOException
        Writes the given binary data to a file in the tempDirForTrigger(WorkflowTrigger, String...) of the given trigger, and returns a file pointing to the newly created file. When a file with the name exists already in the given directory, creates a file name that does not exist yet.
        Parameters:
        trigger - The trigger whose temporary directory is used to create the file.
        path - Desired path in the temporary directory where the file is created (should end on a file name). The file name may be changed if a file with the same name exists already.
        data - The binary data to write to the file system.
        Returns:
        The file pointing to the newly created file with the given binary data.
        Throws:
        IOException - When the file could not be created.