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
andIAttachableFile
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default List<Attachment>
attachFilesToFormRecord(File... files)
Attaches the given files to the current form record for which the workflow is executed.default List<Attachment>
attachFilesToFormRecord(Iterable<File> files)
Attaches the given files to the current form record for which the workflow is executed.List<Attachment>
attachFilesToFormRecord(Iterable<File> files, IAttachFilesToFormRecordOptions options)
Attaches the given files to the current form record for which the workflow is executed.default List<File>
copyFilesToDir(File[] sourceFileOrDirectories, File targetDir)
Deprecated.default List<File>
copyFilesToDir(File[] sourceFileOrDirectories, File targetDir, EFileConflictMode mode)
Copies the source files to the given target directory.default File
copyFilesToDir(File sourceFileOrDirectory, File targetDir)
Deprecated.File
copyFilesToDir(File sourceFileOrDirectory, File targetDir, EFileConflictMode mode)
Copies the source files to the given target directory.default List<File>
copyFilesToDir(Iterable<File> sourceFileOrDirectories, File targetDir)
Deprecated.default List<File>
copyFilesToDir(Iterable<File> sourceFileOrDirectories, File targetDir, EFileConflictMode mode)
Copies the source files to the given target directory.File
copyFileTo(File sourceFile, File targetFile, EFileConflictMode mode)
Copies the given file to the target directory and file name.default List<Attachment>
getAttachmentsFromCurrentNodes(WorkflowNode... currentNodes)
Returns all attachments from the given nodes.List<Attachment>
getAttachmentsFromCurrentNodes(Iterable<WorkflowNode> currentNodes)
Returns all attachments from the given nodes.List<List<Attachment>>
getAttachmentsFromPreviousNode(WorkflowNode previousNode)
Returns all attachments from given node.default List<Attachment>
getAttachmentsFromPreviousNodes(WorkflowNode... previousNodes)
Returns all attachments from the given previous nodes.List<Attachment>
getAttachmentsFromPreviousNodes(Iterable<WorkflowNode> previousNode)
Returns all attachments from given nodes.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).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).List<Attachment>
getAttachmentsFromUploadElements(List<String> uploadElements, Vorgang formRecord, IFormDataAdapter formDataAdapter)
Determines the upload attachments from the specified form record.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.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.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.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.default List<File>
getFilesFromCurrentNodes(Set<String> fileKeys, WorkflowNode... currentNodes)
Returns all files from given nodes.List<File>
getFilesFromCurrentNodes(Set<String> fileKeys, Iterable<WorkflowNode> currentNodes)
Returns all files from given nodes.default List<File>
getFilesFromCurrentTriggers(Set<String> fileKeys, WorkflowTrigger... currentTriggers)
Returns all files from given triggers, limited to triggers that are currently firing.List<File>
getFilesFromCurrentTriggers(Set<String> fileKeys, Iterable<WorkflowTrigger> currentTriggers)
Returns all files from given triggers, limited to triggers that are currently firing.default List<List<File>>
getFilesFromPreviousNode(WorkflowNode previousNode)
Deprecated.List<List<File>>
getFilesFromPreviousNode(Set<String> fileKeys, WorkflowNode previousNode)
Returns all files from given node.default List<File>
getFilesFromPreviousNodes(WorkflowNode... previousNodes)
Deprecated.default List<File>
getFilesFromPreviousNodes(Iterable<WorkflowNode> previousNode)
Deprecated.default List<File>
getFilesFromPreviousNodes(Set<String> fileKeys, WorkflowNode... previousNodes)
Returns all files from the given previous nodes.List<File>
getFilesFromPreviousNodes(Set<String> fileKeys, Iterable<WorkflowNode> previousNode)
Returns all files from given nodes.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).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).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).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).List<List<File>>
getFilesFromPreviousTrigger(Set<String> fileKeys, WorkflowTrigger previousTrigger)
Returns all files from given trigger, not including the current firing, if any.default List<File>
getFilesFromPreviousTriggers(Set<String> fileKeys, WorkflowTrigger... previousTriggers)
Returns all files from the given previous triggers, not including the current firing, if any.List<File>
getFilesFromPreviousTriggers(Set<String> fileKeys, Iterable<WorkflowTrigger> previousTriggers)
Returns all files from given triggers, not including the current firing, if any.default List<IResolvedFile>
getFilesFromUploadElements(IUploadConsuming consuming)
Same asgetFilesFromUploadElements(List)
, but takes the parameters from the givenIUploadConsuming
corresponding.List<IResolvedFile>
getFilesFromUploadElements(List<String> uploadElements)
Returns a list of all files from the given upload elements.IResolvedFile
getFileSingle(WorkflowNode node, ISingleFileProviding singleFile, IFileSearchOptions options)
IResolvedMultiFile
getFilesMulti(WorkflowNode node, IMultiFileProviding multiFile, IFileSearchOptions options)
default List<IWorkflowFileValue>
getFileValuesFromCurrentNodes(WorkflowNode... currentNodes)
Gets all file values that were provided by the given current nodes.List<IWorkflowFileValue>
getFileValuesFromCurrentNodes(Iterable<WorkflowNode> currentNodes)
Gets all file values that were provided by the given current nodes.default List<IWorkflowFileValue>
getFileValuesFromCurrentTriggers(WorkflowTrigger... currentTriggers)
Gets all file values that were provided by the given current triggers.List<IWorkflowFileValue>
getFileValuesFromCurrentTriggers(Iterable<WorkflowTrigger> currentTriggers)
Gets all file values that were provided by the given current triggers.default List<IWorkflowFileValue>
getFileValuesFromPreviousNodes(WorkflowNode... previousNodes)
Gets all file values that were provided by the given previous nodes.List<IWorkflowFileValue>
getFileValuesFromPreviousNodes(Iterable<WorkflowNode> previousNodes)
Gets all file values that were provided by the given previous nodes.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).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).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).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).default List<IWorkflowFileValue>
getFileValuesFromPreviousTriggers(WorkflowTrigger... previousTriggers)
Gets all file values that were provided by the given previous triggers.List<IWorkflowFileValue>
getFileValuesFromPreviousTriggers(Iterable<WorkflowTrigger> previousTriggers)
Gets all file values that were provided by the given previous triggers.IGuessedContentType
guessContentType(File file)
IGuessedContentType
guessContentType(String fileName, byte[] contents)
default <E extends Throwable>
IHandleFileProvisionResulthandleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, File... files)
Applies the configuration of the givenIFileProvision
to the given files.<E extends Throwable>
IHandleFileProvisionResulthandleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, Iterable<Path> files)
Applies the configuration of the givenIFileProvision
to the given files.default <E extends Throwable>
IHandleFileProvisionResulthandleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, Path... files)
Applies the configuration of the givenIFileProvision
to the given files.default <E extends Throwable>
IHandleFileProvisionResulthandleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, Stream<Path> files)
Applies the configuration of the givenIFileProvision
to the given files.default boolean
isHasExtension(File file, Iterable<String> extensions)
Checks whether the given file has one of the given extensions.default boolean
isHasExtension(File file, String... extensions)
Checks whether the given file has one of the given extensions.default boolean
isHasExtension(String fileName, Iterable<String> extensions)
Checks whether the given file name has one of the given extensions.boolean
isHasExtension(String fileName, String... extensions)
Checks whether the given file name has one of the given extensions.default List<File>
listFiles(File[] directories, boolean recursive, Iterable<String> extensions)
Lists all files contained in the given directories.default List<File>
listFiles(File[] directories, boolean recursive, String... extensions)
Lists all files contained in the given directories.default List<File>
listFiles(File directory, boolean recursive, Iterable<String> extensions)
Lists all files contained in the given directory.List<File>
listFiles(File directory, boolean recursive, String... extensions)
Lists all files contained in the given directory.default List<File>
listFiles(Iterable<File> directories, boolean recursive, Iterable<String> extensions)
Lists all files contained in the given directories.List<File>
listFiles(Iterable<File> directories, boolean recursive, String... extensions)
Lists all files contained in the given directories.default File
randomSourceDirForNode(WorkflowNode node, String... subDirs)
Creates a random temporary directory inside the given source directory of the node.default File
randomSourceDirForTrigger(WorkflowTrigger trigger, String... subDirs)
Creates a random temporary directory inside the given source directory of the trigger.default File
randomTargetDirForNode(WorkflowNode node, String... subDirs)
Creates a random temporary directory inside the given target directory of the node.default File
randomTargetDirForTrigger(WorkflowTrigger trigger, String... subDirs)
Creates a random temporary directory inside the given target directory of the trigger.File
randomTempDirForNode(WorkflowNode node, String... subDirs)
Creates a random temporary directory inside the given subdirectory for the node.File
randomTempDirForTrigger(WorkflowTrigger trigger, String... subDirs)
Creates a random temporary directory inside the given subdirectory for the trigger.IResolvedAttachmentList
resolveReferencedAttachments(WorkflowNode node, IReferencedAttachmentList attachmentList, IAttachmentSearchOptions options)
Returns the attachments represented by the given descriptor.IResolvedFileList
resolveReferencedFiles(WorkflowNode node, IReferencedFileList fileList, IFileSearchOptions options)
Returns the files represented by the given descriptor.default String
sanitizeFilename(String fileName)
String
sanitizeFilename(String fileName, IPlaceholderEscaper placeholderEscaper)
default File
sourceDirForNode(WorkflowNode node, String... subDirs)
Shortcut forgetTempDirForNode(node, "source")
.default File
sourceDirForTrigger(WorkflowTrigger trigger, String... subDirs)
Shortcut forgetTempDirForTrigger(trigger, "source")
.default File
sourceFileForNode(WorkflowNode node, String... pathSegments)
Shortcut forgetTempFileForNode(node, "source")
.default File
sourceFileForNode(WorkflowTrigger trigger, String... pathSegments)
Shortcut forgetTempFileForTrigger(trigger, "source")
.default File
subDirectory(File baseDir, Iterable<String> subDirs)
Starting at the given base directory, accesses the given subdirectories, creates that subdirectory if necessary, and returns a file corresponding to that subdirectory.File
subDirectory(File baseDir, String... subDirs)
Starting at the given base directory, accesses the given subdirectories, creates that subdirectory if necessary, and returns a file corresponding to that subdirectory.default File
subFile(File baseDir, Iterable<String> subDirs)
Similar tosubDirectory(File, String...)
, but with the different that this method does not create a directory for the last item in the givensubDirs
.File
subFile(File baseDir, String... subDirs)
Similar tosubDirectory(File, String...)
, but with the different that this method does not create a directory for the last item in the givensubDirs
.default File
targetDirForNode(WorkflowNode node, String... subDirs)
Shortcut forgetTempDirForNode(node, "target")
.default File
targetDirForTrigger(WorkflowTrigger trigger, String... subDirs)
Shortcut forgetTempDirForTrigger(trigger, "target")
.default File
targetFileForNode(WorkflowNode node, String... subDirs)
Shortcut forgetTempFileForNode(node, "target")
.default File
targetFileForTrigger(WorkflowTrigger trigger, String... subDirs)
Shortcut forgetTempFileForTrigger(trigger, "target")
.File
tempDirForNode(WorkflowNode node, String... subDirs)
Path to the temporary target directory for the given workflow node.File
tempDirForTrigger(WorkflowTrigger trigger, String... subDirs)
Path to the temporary target directory for the given workflow trigger.File
tempDirShared(String... subDirs)
Return a path to the temporary directory shared by all workflow nodes.File
tempFileForNode(WorkflowNode node, String... subDirs)
Returns the path to a file in the temporary target directory for the given workflow node.File
tempFileForTrigger(WorkflowTrigger trigger, String... subDirs)
Returns the path to a file in the temporary target directory for the given workflow trigger.File
tempFileShared(String... subDirs)
Return a file within to the temporary directory shared by all workflow nodes.File
withExtension(File file, String newExtension)
Changes the extension of the file name to the given extension.String
withExtension(String fileName, String newExtension)
Changes the extension of the file name to the given extension.default File
writeToSourceDir(WorkflowNode node, byte[] data, String... path)
Writes the given binary data to a file in thesourceDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowNode node, IFileProviding<?,? extends IFileDataEntity<?>> providing, String... subDirs)
Writes the given binary data to a file in thesourceDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowNode node, File data, String... path)
Writes the given binary data to a file in thesourceDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowNode node, InputStream data, String... path)
Writes the given binary data to a file in thesourceDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowTrigger trigger, byte[] data, String... path)
Writes the given binary data to a file in thesourceDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowTrigger trigger, IFileProviding<?,? extends IFileDataEntity<?>> providing, String... subDirs)
Writes the given binary data to a file in thesourceDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowTrigger trigger, File data, String... path)
Writes the given binary data to a file in thesourceDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToSourceDir(WorkflowTrigger trigger, InputStream data, String... path)
Writes the given binary data to a file in thesourceDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowNode node, byte[] data, String... path)
Writes the given binary data to a file in thetargetDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowNode node, IFileProviding<?,? extends IFileDataEntity<?>> providing, String... subDirs)
Writes the given binary data to a file in thetargetDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowNode node, File data, String... path)
Writes the given binary data to a file in thetargetDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowNode node, InputStream data, String... path)
Writes the given binary data to a file in thetargetDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowTrigger trigger, byte[] data, String... path)
Writes the given binary data to a file in thetargetDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowTrigger trigger, IFileProviding<?,? extends IFileDataEntity<?>> providing, String... subDirs)
Writes the given binary data to a file in thetargetDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowTrigger trigger, File data, String... path)
Writes the given binary data to a file in thetargetDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToTargetDir(WorkflowTrigger trigger, InputStream data, String... path)
Writes the given binary data to a file in thetargetDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToTempDir(WorkflowNode node, byte[] data, String... path)
Writes the given binary data to a file in thetempDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.File
writeToTempDir(WorkflowNode node, IFileProviding<?,? extends IFileDataEntity<?>> providing, String... subDirs)
Writes the given binary data to a file in thetempDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToTempDir(WorkflowNode node, File data, String... path)
Writes the given binary data to a file in thetempDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.File
writeToTempDir(WorkflowNode node, InputStream data, String... path)
Writes the given binary data to a file in thetempDirForNode(WorkflowNode, String...)
of the given node, and returns a file pointing to the newly created file.default File
writeToTempDir(WorkflowTrigger trigger, byte[] data, String... path)
Writes the given binary data to a file in thetempDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.File
writeToTempDir(WorkflowTrigger trigger, IFileProviding<?,? extends IFileDataEntity<?>> providing, String... subDirs)
Writes the given binary data to a file in thetempDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.default File
writeToTempDir(WorkflowTrigger trigger, File data, String... path)
Writes the given binary data to a file in thetempDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.File
writeToTempDir(WorkflowTrigger trigger, InputStream data, String... path)
Writes the given binary data to a file in thetempDirForTrigger(WorkflowTrigger, String...)
of the given trigger, and returns a file pointing to the newly created file.
-
-
-
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 theUserMgmtUtils.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 theUserMgmtUtils.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 theUserMgmtUtils.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.
-
copyFileTo
File copyFileTo(File sourceFile, File targetFile, EFileConflictMode mode) throws IOException
Copies the given file to the target directory and file name. When the target file exists already, the file is either overwritten when the conflict mode is set toEFileConflictMode.OVERWRITE
or renamed when the conflict mode is set toEFileConflictMode.RENAME
. Parent directories of the target file are created if they do not exist yet.- Parameters:
sourceFile
- An existing file to copy. This must point to an existing file, not a directory.targetFile
- Target to which to copy the file. This must not be an existing directory.mode
- How to proceed when the target file exists already.- Returns:
- The copied file. This is identical to the target file when the conflict mode is set to
EFileConflictMode.OVERWRITE
. - Throws:
IOException
- When the file could not be copied.- Since:
- 7.0.5
- See Also:
, if you want to copy a file to a directory without having to specify a file name.
-
copyFilesToDir
@Deprecated @Nullable default File copyFilesToDir(File sourceFileOrDirectory, File targetDir) throws IOException
Deprecated.Copies the source files to the given target directory. If thesource
points to a directory, all files in that directory are copied (non-recursively) to thetarget
. 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 thesource
points to a directory, all files in that directory are copied (non-recursively) to thetarget
. 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
Deprecated.Copies the source files to the given target directory. If thesource
points to a directory, all files in that directory are copied (non-recursively) to thetarget
. 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 thesource
points to a directory, all files in that directory are copied (non-recursively) to thetarget
. 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
Deprecated.Copies the source files to the given target directory. If thesource
points to a directory, all files in that directory are copied (non-recursively) to thetarget
. 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 thesource
points to a directory, all files in that directory are copied (non-recursively) to thetarget
. 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
- theVorgang
formDataAdapter
- aIFormDataAdapter
- 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 whichgetFilesFromCurrentNodes(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 whichgetFilesFromCurrentTriggers(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 whichgetFilesFromPreviousNodes(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 whichgetFilesFromPreviousTriggers(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.
-
getFileSingle
@Deprecated IResolvedFile getFileSingle(WorkflowNode node, ISingleFileProviding singleFile, IFileSearchOptions options) throws MalformedURLException, FileNotFoundException, FileFormatException, IOException, IllegalArgumentException
Returns the file 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.This will throw when
ISingleFileProviding.getResource()
isnull
. If the resource is optional, check for that case before you call this 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...)
orrandomTempDirForNode(WorkflowNode, String...)
when you need write output our temporary files.- Parameters:
node
- Node that requested the files. Used to determine an appropriate temporary directory.singleFile
- File descriptor for a single file.options
- Options for searching files. Whennull
, a reasonable default is used.- Returns:
- The file represented by the given descriptor.
null
when no file is found. - Throws:
MalformedURLException
- When a URL resource is selected and the URL is invalid.FileNotFoundException
- When the given singleFile has notresource
selected; or when no matching resource could be found; such as when no file for an upload element with the configured name exists; or when the selected workflow node was not executed or does not exist anymore.FileFormatException
- When searching for a form record attachment and one is found, but it does not match the filter (extension) configured by the user.IOException
- When a file could not be read from the file system or a resource could not be read from the network.IllegalArgumentException
- When the givenISingleFileProviding
is invalid (and should not have passed the workflow validation process).
-
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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForTrigger(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...)
orrandomTempDirForTrigger(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 asgetFilesFromUploadElements(List)
, but takes the parameters from the givenIUploadConsuming
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...)
orrandomTempDirForNode(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...)
orrandomTempDirForNode(WorkflowNode, String...)
when you need write output our temporary files.- Parameters:
uploadElements
- Upload elements the given action required. Must contain theFormElement.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.
-
getFilesMulti
@Deprecated IResolvedMultiFile getFilesMulti(WorkflowNode node, IMultiFileProviding multiFile, IFileSearchOptions options) throws MalformedURLException, FileNotFoundException, FileFormatException, IOException, IllegalArgumentException
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.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...)
orrandomTempDirForNode(WorkflowNode, String...)
when you need write output our temporary files.- Parameters:
node
- Node that requested the files. Used to determine an appropriate temporary directory.multiFile
- File descriptor for multiple files.options
- Options for searching files. Whennull
, a reasonable default is used.- Returns:
- The resolved multi files, with the original file names and the directory containing the files.
- Throws:
MalformedURLException
- When a URL resource is selected and the URL is invalid.FileNotFoundException
- When no matching resource could be found. Such as when no file for an upload element with the configured name exists; or when the selected workflow node was not executed or does not exist anymore.FileFormatException
- When searching for a form record attachment and one is found, but it does not match the filter (extension) configured by the user.IOException
- When a file could not be read from the file system or a resource could not be read from the network.IllegalArgumentException
- When the givenISingleFileProviding
is invalid (and should not have passed the workflow validation process).
-
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, returnsapplication/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 Throwable> IHandleFileProvisionResult handleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, File... files) throws E extends Throwable
Applies the configuration of the givenIFileProvision
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 useINodeExecutionParams.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 Throwable> IHandleFileProvisionResult handleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, Path... files) throws E extends Throwable
Applies the configuration of the givenIFileProvision
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 useINodeExecutionParams.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 Throwable> IHandleFileProvisionResult handleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, Stream<Path> files) throws E extends Throwable
Applies the configuration of the givenIFileProvision
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 useINodeExecutionParams.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 Throwable> IHandleFileProvisionResult handleFileProvision(IFileProvision provision, IFileProvisionOptions<E> options, Iterable<Path> files) throws E extends Throwable
Applies the configuration of the givenIFileProvision
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 useINodeExecutionParams.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 arenull
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 arenull
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 arenull
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 arenull
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 givendirectory
is aFile.isFile()
, a singleton list with that file is returned, or an empty list if the file does not match the extension. Ifrecursive
is enabled, this method walks all directories recursively and only returns the files they contain.The returned list only contains
files
, neverdirectories
.- 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. Whennull
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 givendirectory
is aFile.isFile()
, a singleton list with that file is returned. Ifrecursive
is enabled, this method walks all directories recursively and only returns the files they contain.The returned list only contains
files
, neverdirectories
.- 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. Whennull
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 givendirectory
is aFile.isFile()
, that file is returned in the resulting list. Ifrecursive
is enabled, this method walks all directories recursively and only returns the files they contain.The returned list only contains
files
, neverdirectories
.- 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. Whennull
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 givendirectory
is aFile.isFile()
, that file is returned in the resulting list. Ifrecursive
is enabled, this method walks all directories recursively and only returns the files they contain.The returned list only contains
files
, neverdirectories
.- 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. Whennull
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 givendirectory
is aFile.isFile()
, that file is returned in the resulting list. Ifrecursive
is enabled, this method walks all directories recursively and only returns the files they contain.The returned list only contains
files
, neverdirectories
.- 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. Whennull
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 givendirectory
is aFile.isFile()
, that file is returned in the resulting list. Ifrecursive
is enabled, this method walks all directories recursively and only returns the files they contain.The returned list only contains
files
, neverdirectories
.- 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. Whennull
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 bysourceDirForNode
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 bysourceDirForTrigger
- 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 bytargetDirForNode
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 bytargetDirForTrigger
- 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 bytempDirForNode
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 bytempDirForTrigger
- 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 usecollectResult
together with thestandardAttachmentErrorsSingle
orstandardAttachmentErrorsMultiple
method fromINodeExecutionParams
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. Whennull
, 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 usecollectResult
together with thestandardFileErrorsSingle
orstandardFileErrorsMultiple
method fromINodeExecutionParams
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...)
orrandomTempDirForNode(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. Whennull
, 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
- Whennull
, no placeholders are escaped. When notnull
, 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 forgetTempDirForNode(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 forgetTempDirForTrigger(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 forgetTempFileForNode(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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you callsourceDirForNode(node, "foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
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 forgetTempFileForTrigger(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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you callsourceDirForTrigger(trigger, "foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
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
containsn
non-empty items, it is guaranteed that thebaseDir
is thenth
parent of the returneddirectory
. 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
containsn
non-empty items, it is guaranteed that thebaseDir
is thenth
parent of the returneddirectory
. 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 tosubDirectory(File, String...)
, but with the different that this method does not create a directory for the last item in the givensubDirs
. So if you callsubDir("path/to/base/dir". "foo", "bar.txt
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thenode
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 givensubDirs
). - Throws:
IOException
- When the subdirectory could not be created.
-
subFile
File subFile(File baseDir, String... subDirs) throws IOException
Similar tosubDirectory(File, String...)
, but with the different that this method does not create a directory for the last item in the givensubDirs
. So if you callsubDir("path/to/base/dir". "foo", "bar.txt
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thenode
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 givensubDirs
). - Throws:
IOException
- When the subdirectory could not be created.
-
targetDirForNode
default File targetDirForNode(WorkflowNode node, String... subDirs) throws IOException
Shortcut forgetTempDirForNode(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 forgetTempDirForTrigger(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 forgetTempFileForNode(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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you calltargetDirForNode(node, "foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
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 forgetTempFileForTrigger(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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you calltargetDirForTrigger(trigger, "foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
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, usetempDirForNode(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 ifsubDirs
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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you calltempDirForNode(node, "foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you calltempDirForTrigger(trigger, "foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
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, usetempDirForNode(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 ofsubDirs
as a file and does not attempt to create a directory for that. E.g. if you calltempDirShared("foo", "bar.txt"
, it would attempt to create the directoriesfoo
andbar.txt
. This method only creates thefoo
directory.- Parameters:
subDirs
- Optional path segments to access a subdirectory, or a subdirectory ifsubDirs
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 thesourceDirForNode(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 thesourceDirForNode(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 thesourceDirForNode(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 givenproviding
.- 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 thesourceDirForNode(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 thesourceDirForTrigger(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 thesourceDirForTrigger(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 thesourceDirForTrigger(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 givenproviding
.- 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 thesourceDirForTrigger(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 thetargetDirForNode(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 thetargetDirForNode(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 thetargetDirForNode(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 givenproviding
.- 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 thetargetDirForNode(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 thetargetDirForTrigger(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 thetargetDirForTrigger(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 thetargetDirForTrigger(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 givenproviding
.- 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 thetargetDirForTrigger(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 thetempDirForNode(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 thetempDirForNode(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 thetempDirForNode(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 givenproviding
.- 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 thetempDirForNode(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 thetempDirForTrigger(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 thetempDirForTrigger(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 thetempDirForTrigger(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 givenproviding
.- 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 thetempDirForTrigger(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.
-
-