public class ProvidingFileHandlerImpl extends Object implements IProvidingFileHandler
IProviding. Contains methods such as attaching
files to the form record or saving files to the file system.| Constructor and Description |
|---|
ProvidingFileHandlerImpl(IWorkflowProcessingContext wfpc) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachment(File file)
Attaches the given file to the current form record of the workflow processing context.
|
void |
attachFilesFromActionToFormRecord(long actionId)
For a given action, attaches the files produced by that action to the current form record.
|
void |
attachFilesFromCurrentActionToFormRecord(Aktion action)
For a workflow action that provides files, takes the files it produces and attaches those files to the current form
record.
|
File |
getExportDirectory(String exportDirectory,
boolean useProcessId)
Returns the export directory for a
IProviding. |
void |
saveFilesFromActionToFileSystem(long actionId,
File outputDir)
For a given action, saves the files produced by that action to the file system.
|
void |
saveFileToFileSystem(File srcFile,
File outputDir)
Saves the given file to the file system, ie. copies it to the given directory.
|
public ProvidingFileHandlerImpl(IWorkflowProcessingContext wfpc)
public void addAttachment(File file) throws IOException
IProvidingFileHandlerUserMgmtUtils.SYSTEM user.addAttachment in interface IProvidingFileHandlerfile - File to be attached to the form record. Must not be a directory.IOException - When the file data could not be read.public void attachFilesFromActionToFormRecord(long actionId)
throws IOException
IProvidingFileHandlerattachFilesFromActionToFormRecord in interface IProvidingFileHandleractionId - Aktion.getId() of the action whose files are to be attached.IOExceptionpublic void attachFilesFromCurrentActionToFormRecord(Aktion action) throws IOException
IProvidingFileHandlerattachFilesFromCurrentActionToFormRecord in interface IProvidingFileHandleraction - The current action whose files are to be attached.IOExceptionpublic File getExportDirectory(String exportDirectory, boolean useProcessId) throws IOException
IProvidingFileHandlerIProviding. When enabled, creates a sub directory with the name of the
current process ID.getExportDirectory in interface IProvidingFileHandlerexportDirectory - Base export directory.useProcessId - Whether a sub directory with the process ID is created.null if the given export directory is blank.IOException - When the directory could not be created.public void saveFilesFromActionToFileSystem(long actionId,
File outputDir)
throws IOException
IProvidingFileHandlersaveFilesFromActionToFileSystem in interface IProvidingFileHandleractionId - Aktion.getId() of the action whose files are to be saved.outputDir - The directory to which the files are saved.IOExceptionpublic void saveFileToFileSystem(File srcFile, File outputDir) throws IOException
IProvidingFileHandlersaveFileToFileSystem in interface IProvidingFileHandlersrcFile - File to be saved to the file system.outputDir - Directory to which the file is saved.IOException - When the file cannot be copied.Copyright © 2020 XIMA MEDIA GmbH. All rights reserved.