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
IProvidingFileHandler
UserMgmtUtils.SYSTEM
user.addAttachment
in interface IProvidingFileHandler
file
- 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
IProvidingFileHandler
attachFilesFromActionToFormRecord
in interface IProvidingFileHandler
actionId
- Aktion.getId()
of the action whose files are to be attached.IOException
public void attachFilesFromCurrentActionToFormRecord(Aktion action) throws IOException
IProvidingFileHandler
attachFilesFromCurrentActionToFormRecord
in interface IProvidingFileHandler
action
- The current action whose files are to be attached.IOException
public File getExportDirectory(String exportDirectory, boolean useProcessId) throws IOException
IProvidingFileHandler
IProviding
. When enabled, creates a sub directory with the name of the
current process ID.getExportDirectory
in interface IProvidingFileHandler
exportDirectory
- 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
IProvidingFileHandler
saveFilesFromActionToFileSystem
in interface IProvidingFileHandler
actionId
- Aktion.getId()
of the action whose files are to be saved.outputDir
- The directory to which the files are saved.IOException
public void saveFileToFileSystem(File srcFile, File outputDir) throws IOException
IProvidingFileHandler
saveFileToFileSystem
in interface IProvidingFileHandler
srcFile
- File to be saved to the file system.outputDir
- Directory to which the file is saved.IOException
- When the file cannot be copied.Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.