public class FileSystemActor<F,FS extends IBasicFileSystem<F>> extends Object implements IOutputStreamingSupport
FileSystemPipe
and FileSystemSender
.action
, filename overrides attribute filename
. If not present, the input message is used., destination destination for action rename
and move
. Overrides attribute destination
., contents contents for action write
and append
., inputFolder folder for actions list
, mkdir
and rmdir
. This is a sub folder of baseFolder. Overrides attribute inputFolder
. If not present, the input message is used.Modifier and Type | Class and Description |
---|---|
static class |
FileSystemActor.FileSystemAction |
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_APPEND |
static String |
ACTION_COPY |
static String |
ACTION_CREATE |
static String |
ACTION_DELETE |
static String |
ACTION_FORWARD |
static String |
ACTION_INFO |
static String |
ACTION_LIST |
static String |
ACTION_LIST_ATTACHMENTS |
static String |
ACTION_MKDIR |
static String |
ACTION_MOVE |
static String |
ACTION_READ_DELETE |
static String |
ACTION_READ1 |
static String |
ACTION_READ2 |
static String |
ACTION_RENAME |
static String |
ACTION_RMDIR |
static String |
ACTION_WRITE1 |
static String |
ACTION_WRITE2 |
static FileSystemActor.FileSystemAction[] |
ACTIONS_BASIC |
static FileSystemActor.FileSystemAction[] |
ACTIONS_MAIL_FS |
static FileSystemActor.FileSystemAction[] |
ACTIONS_WRITABLE_FS |
protected org.apache.logging.log4j.Logger |
log |
static String |
PARAMETER_ACTION |
static String |
PARAMETER_CONTENTS1 |
static String |
PARAMETER_CONTENTS2 |
static String |
PARAMETER_DESTINATION |
static String |
PARAMETER_FILENAME |
static String |
PARAMETER_INPUTFOLDER |
Constructor and Description |
---|
FileSystemActor() |
Modifier and Type | Method and Description |
---|---|
protected void |
actionRequiresAtLeastOneOfTwoParametersOrAttribute(INamedObject owner,
ParameterList parameterList,
FileSystemActor.FileSystemAction configuredAction,
FileSystemActor.FileSystemAction action,
String parameter1,
String parameter2,
String attributeName,
String attributeValue) |
protected void |
addActions(List<FileSystemActor.FileSystemAction> specificActions) |
protected OutputStream |
augmentOutputStream(OutputStream out) |
protected boolean |
canProvideOutputStream() |
void |
configure(FS fileSystem,
ParameterList parameterList,
IConfigurable owner) |
Message |
doAction(Message input,
ParameterValueList pvl,
PipeLineSession session) |
void |
open() |
MessageOutputStream |
provideOutputStream(PipeLineSession session,
IForwardTarget next)
return a
MessageOutputStream that can be used to write a message to, that then will be processed in a streaming way. |
void |
setAction(FileSystemActor.FileSystemAction action)
If parameter ["action"] is set, then the attribute action value will be overridden with the value of the parameter.
|
void |
setBase64(Base64Pipe.Direction base64)
Deprecated.
|
void |
setCharset(String charset)
|
void |
setCreateFolder(boolean createFolder)
If set
true , the folder to create, write, move or copy the file to is created if it does not exist |
void |
setDeleteEmptyFolder(boolean deleteEmptyFolder)
If set to true then the folder will be deleted if it is empty after processing the action.
|
void |
setDestination(String destination)
|
void |
setExcludeWildcard(String excludeWildcard)
Filter of files to be excluded when looking in inputFolder.
|
void |
setExcludeWildCard(String excludeWildcard)
Deprecated.
|
void |
setFilename(String filename)
Filename to operate on.
|
void |
setInputFolder(String inputFolder)
Folder that is scanned for files when action="list".
|
void |
setNumberOfBackups(int numberOfBackups)
|
void |
setOutputFormat(DocumentFormat outputFormat)
OutputFormat
|
void |
setOverwrite(boolean overwrite)
|
void |
setRemoveNonEmptyFolder(boolean removeNonEmptyFolder)
If set to
true then the folder and the content of the non empty folder will be deleted. |
void |
setRotateDays(int rotateDays)
For action="append": If set to a positive number, the file is rotated each day, and this number of files is kept.
|
void |
setRotateSize(int rotateSize)
For action="append": If set to a positive number, the file is rotated when it has reached the specified size, and the number of files specified in numberOfBackups is kept.
|
void |
setWildcard(String wildcard)
Filter of files to look for in inputFolder e.g.
|
void |
setWildCard(String wildcard)
Deprecated.
|
void |
setWriteLineSeparator(boolean writeLineSeparator)
If set to
true then the system specific line separator will be appended to the file after executing the action. |
boolean |
supportsOutputStreamPassThrough()
Implementations should return
true when they do not require an OutputStream, but can
provide one to the preceding pipe if they are themselves provided with one from the next pipe. |
protected org.apache.logging.log4j.Logger log
public static final String ACTION_CREATE
public static final String ACTION_LIST
public static final String ACTION_INFO
public static final String ACTION_READ1
public static final String ACTION_READ2
public static final String ACTION_READ_DELETE
public static final String ACTION_MOVE
public static final String ACTION_COPY
public static final String ACTION_DELETE
public static final String ACTION_MKDIR
public static final String ACTION_RMDIR
public static final String ACTION_WRITE1
public static final String ACTION_WRITE2
public static final String ACTION_APPEND
public static final String ACTION_RENAME
public static final String ACTION_FORWARD
public static final String ACTION_LIST_ATTACHMENTS
public static final String PARAMETER_ACTION
public static final String PARAMETER_CONTENTS1
public static final String PARAMETER_CONTENTS2
public static final String PARAMETER_FILENAME
public static final String PARAMETER_INPUTFOLDER
public static final String PARAMETER_DESTINATION
public static final FileSystemActor.FileSystemAction[] ACTIONS_BASIC
public static final FileSystemActor.FileSystemAction[] ACTIONS_WRITABLE_FS
public static final FileSystemActor.FileSystemAction[] ACTIONS_MAIL_FS
public void configure(FS fileSystem, ParameterList parameterList, IConfigurable owner) throws ConfigurationException
ConfigurationException
protected void actionRequiresAtLeastOneOfTwoParametersOrAttribute(INamedObject owner, ParameterList parameterList, FileSystemActor.FileSystemAction configuredAction, FileSystemActor.FileSystemAction action, String parameter1, String parameter2, String attributeName, String attributeValue) throws ConfigurationException
ConfigurationException
public void open() throws FileSystemException
FileSystemException
public Message doAction(@Nonnull Message input, ParameterValueList pvl, @Nonnull PipeLineSession session) throws FileSystemException, TimeoutException
FileSystemException
TimeoutException
protected boolean canProvideOutputStream()
public boolean supportsOutputStreamPassThrough()
IOutputStreamingSupport
true
when they do not require an OutputStream, but can
provide one to the preceding pipe if they are themselves provided with one from the next pipe.supportsOutputStreamPassThrough
in interface IOutputStreamingSupport
protected OutputStream augmentOutputStream(OutputStream out)
public MessageOutputStream provideOutputStream(PipeLineSession session, IForwardTarget next) throws StreamingException
IOutputStreamingSupport
MessageOutputStream
that can be used to write a message to, that then will be processed in a streaming way.
If a target MessageOutputStream is required to stream output to, this can be obtained from next
, if specified.
If the implementor of this method is a pipe, and it is the last one in the chain of streaming pipes, it must provide the appropriate
forward in the provide MessageOutputStream.
If the class cannot provide an outputstream, it must return null.
If the provider of an outputstream is a pipe itself, it must provide a proper pipeforward in the provided outputstreamprovideOutputStream
in interface IOutputStreamingSupport
StreamingException
protected void addActions(List<FileSystemActor.FileSystemAction> specificActions)
public void setAction(FileSystemActor.FileSystemAction action)
public void setInputFolder(String inputFolder)
public void setCreateFolder(boolean createFolder)
true
, the folder to create, write, move or copy the file to is created if it does not existpublic void setOverwrite(boolean overwrite)
true
, for actions "create", "move", "copy" or "rename", the destination file is overwritten if it already existspublic void setFilename(String filename)
public void setDestination(String destination)
public void setRotateDays(int rotateDays)
public void setRotateSize(int rotateSize)
public void setNumberOfBackups(int numberOfBackups)
@Deprecated public void setBase64(Base64Pipe.Direction base64)
@Deprecated @ConfigurationWarning(value="attribute \'wildCard\' has been renamed to \'wildcard\'") public void setWildCard(String wildcard)
public void setWildcard(String wildcard)
@Deprecated @ConfigurationWarning(value="attribute \'excludeWildCard\' has been renamed to \'excludeWildcard\'") public void setExcludeWildCard(String excludeWildcard)
public void setExcludeWildcard(String excludeWildcard)
public void setRemoveNonEmptyFolder(boolean removeNonEmptyFolder)
true
then the folder and the content of the non empty folder will be deleted.public void setWriteLineSeparator(boolean writeLineSeparator)
true
then the system specific line separator will be appended to the file after executing the action. Works with actions "write" and "append"public void setCharset(String charset)
public void setDeleteEmptyFolder(boolean deleteEmptyFolder)
public void setOutputFormat(DocumentFormat outputFormat)
Copyright © 2023 Frank!Framework. All rights reserved.