Package org.frankframework.filesystem
Class FileSystemActor<F,S extends IBasicFileSystem<F>>
java.lang.Object
org.frankframework.filesystem.FileSystemActor<F,S>
Worker class for
AbstractFileSystemPipe and AbstractFileSystemSender.- Author:
- Gerrit van Brakel
- Specific parameters
- action Overrides attribute
action, filename Overrides attributefilename. If not present, the input message is used., destination Destination for actionrenameandmove. Overrides attributedestination., contents Content for actionwriteandappend., inputFolder Folder for actionslist,mkdirandrmdir. This is a sub folder of baseFolder. Overrides attributeinputFolder. If not present, the input message is used., typeFilter Filter for actionlist. SpecifyFILES_ONLY,FOLDERS_ONLYorFILES_AND_FOLDERS. By default, only files are listed.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final FileSystemActor.FileSystemAction[]static final FileSystemActor.FileSystemAction[]static final FileSystemActor.FileSystemAction[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactionRequiresAtLeastOneOfTwoParametersOrAttribute(HasName owner, ParameterList parameterList, FileSystemActor.FileSystemAction configuredAction, FileSystemActor.FileSystemAction action, String parameter1, String parameter2, String attributeName, String attributeValue) protected voidaddActions(List<FileSystemActor.FileSystemAction> specificActions) voidconfigure(S fileSystem, ParameterList parameterList, FrankElement owner) doAction(Message input, ParameterValueList pvl, PipeLineSession session) voidopen()voidIf parameter ["action"<F,S extends IBasicFileSystem<F>>] is set, then the attribute action value will be overridden with the value of the parameter. voidsetCharset(String charset) Charset to be used for "read"<F,S extends IBasicFileSystem<F>> and "write"<F, S extends IBasicFileSystem<F>> action voidsetCreateFolder(boolean createFolder) Iftrue: if a non-existing folder is part of the fileName, it will be created.voidsetDeleteEmptyFolder(boolean deleteEmptyFolder) If set to true then the folder will be deleted if it is empty after processing the action.voidsetDestination(String destination) Destination for "move"<F,S extends IBasicFileSystem<F>>, "copy"<F, S extends IBasicFileSystem<F>> or "rename"<F, S extends IBasicFileSystem<F>>. voidsetExcludeWildcard(String excludeWildcard) Filter of files to be excluded when looking in inputFolder.voidsetFilename(String filename) Filename to operate on.voidsetInputFolder(String inputFolder) voidsetNumberOfBackups(int numberOfBackups) For the actions "write"<F,S extends IBasicFileSystem<F>> and "append"<F, S extends IBasicFileSystem<F>>, with rotateSize>0: the number of backup files that is kept. voidsetOutputFormat(DocumentFormat outputFormat) Sets the outputFormat.voidsetOverwrite(boolean overwrite) If settrue, for actions "create"<F,S extends IBasicFileSystem<F>>, "write"<F, S extends IBasicFileSystem<F>>, "move"<F, S extends IBasicFileSystem<F>>, "copy"<F, S extends IBasicFileSystem<F>> or "rename"<F, S extends IBasicFileSystem<F>>, the destination file is overwritten if it already exists voidsetRemoveNonEmptyFolder(boolean removeNonEmptyFolder) If set totruethen the folder and the content of the non empty folder will be deleted.voidsetRotateDays(int rotateDays) For action="append"<F,S extends IBasicFileSystem<F>>: If set to a positive number, the file is rotated each day, and this number of files is kept. voidsetRotateSize(int rotateSize) For action="append"<F,S extends IBasicFileSystem<F>>: 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. voidsetTypeFilter(TypeFilter typeFilter) Filter for actionlist.voidsetWildcard(String wildcard) Filter of files to look for in inputFolder e.g. '*.inp'.voidsetWriteLineSeparator(boolean writeLineSeparator) If set totruethen the system specific line separator will be appended to the file after executing the action.
-
Field Details
-
ACTION_CREATE
- See Also:
-
ACTION_LIST
- See Also:
-
ACTION_INFO
- See Also:
-
ACTION_READ1
- See Also:
-
ACTION_READ2
- See Also:
-
ACTION_READ_DELETE
- See Also:
-
ACTION_MOVE
- See Also:
-
ACTION_COPY
- See Also:
-
ACTION_DELETE
- See Also:
-
ACTION_MKDIR
- See Also:
-
ACTION_RMDIR
- See Also:
-
ACTION_WRITE1
- See Also:
-
ACTION_WRITE2
- See Also:
-
ACTION_APPEND
- See Also:
-
ACTION_RENAME
- See Also:
-
ACTION_FORWARD
- See Also:
-
ACTION_LIST_ATTACHMENTS
- See Also:
-
PARAMETER_ACTION
- See Also:
-
PARAMETER_CONTENTS1
- See Also:
-
PARAMETER_CONTENTS2
- See Also:
-
PARAMETER_FILENAME
- See Also:
-
PARAMETER_INPUTFOLDER
- See Also:
-
PARAMETER_DESTINATION
- See Also:
-
PARAMETER_TYPEFILTER
- See Also:
-
ACTIONS_BASIC
-
ACTIONS_WRITABLE_FS
-
ACTIONS_MAIL_FS
-
-
Constructor Details
-
FileSystemActor
public FileSystemActor()
-
-
Method Details
-
configure
public void configure(@Nonnull S fileSystem, @Nonnull ParameterList parameterList, @Nonnull FrankElement owner) throws ConfigurationException - Throws:
ConfigurationException
-
actionRequiresAtLeastOneOfTwoParametersOrAttribute
protected void actionRequiresAtLeastOneOfTwoParametersOrAttribute(@Nonnull HasName owner, @Nonnull ParameterList parameterList, FileSystemActor.FileSystemAction configuredAction, FileSystemActor.FileSystemAction action, String parameter1, String parameter2, String attributeName, String attributeValue) throws ConfigurationException - Throws:
ConfigurationException
-
open
- Throws:
FileSystemException
-
doAction
public Message doAction(@Nonnull Message input, ParameterValueList pvl, @Nonnull PipeLineSession session) throws FileSystemException - Throws:
FileSystemException
-
addActions
-
setAction
If parameter ["action"<F,S extends IBasicFileSystem<F>>] is set, then the attribute action value will be overridden with the value of the parameter. -
setInputFolder
Folder that is scanned for files when action="list"<F,S extends IBasicFileSystem<F>>. When not set, the root is scanned -
setCreateFolder
public void setCreateFolder(boolean createFolder) Iftrue: if a non-existing folder is part of the fileName, it will be created.- Default value
- false
-
setOverwrite
public void setOverwrite(boolean overwrite) If settrue, for actions "create"<F,S extends IBasicFileSystem<F>>, "write"<F, S extends IBasicFileSystem<F>>, "move"<F, S extends IBasicFileSystem<F>>, "copy"<F, S extends IBasicFileSystem<F>> or "rename"<F, S extends IBasicFileSystem<F>>, the destination file is overwritten if it already exists - Default value
- false
-
setFilename
Filename to operate on. If not set, the parameter "filename"<F,S extends IBasicFileSystem<F>> is used. If that is not set either, the input is used -
setDestination
Destination for "move"<F,S extends IBasicFileSystem<F>>, "copy"<F, S extends IBasicFileSystem<F>> or "rename"<F, S extends IBasicFileSystem<F>>. If not set, the parameter "destination"<F, S extends IBasicFileSystem<F>> is used. If that is not set either, the input is used -
setRotateDays
public void setRotateDays(int rotateDays) For action="append"<F,S extends IBasicFileSystem<F>>: If set to a positive number, the file is rotated each day, and this number of files is kept. The inputFolder must point to the directory where the file resides - Default value
- 0
-
setRotateSize
public void setRotateSize(int rotateSize) For action="append"<F,S extends IBasicFileSystem<F>>: 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. Size is specified in plain bytes, suffixes like 'K', 'M' or 'G' are not recognized. The inputFolder must point to the directory where the file resides - Default value
- 0
-
setNumberOfBackups
public void setNumberOfBackups(int numberOfBackups) For the actions "write"<F,S extends IBasicFileSystem<F>> and "append"<F, S extends IBasicFileSystem<F>>, with rotateSize>0: the number of backup files that is kept. The inputFolder must point to the directory where the file resides - Default value
- 0
-
setWildcard
Filter of files to look for in inputFolder e.g. '*.inp'. Works with actions "move"<F,S extends IBasicFileSystem<F>>, "copy"<F, S extends IBasicFileSystem<F>>, "delete"<F, S extends IBasicFileSystem<F>> and "list"<F, S extends IBasicFileSystem<F>> -
setExcludeWildcard
Filter of files to be excluded when looking in inputFolder. Works with actions "move"<F,S extends IBasicFileSystem<F>>, "copy"<F, S extends IBasicFileSystem<F>>, "delete"<F, S extends IBasicFileSystem<F>> and "list"<F, S extends IBasicFileSystem<F>> -
setRemoveNonEmptyFolder
public void setRemoveNonEmptyFolder(boolean removeNonEmptyFolder) If set totruethen the folder and the content of the non empty folder will be deleted. -
setWriteLineSeparator
public void setWriteLineSeparator(boolean writeLineSeparator) If set totruethen the system specific line separator will be appended to the file after executing the action. Works with actions "write"<F,S extends IBasicFileSystem<F>> and "append"<F, S extends IBasicFileSystem<F>> - Default value
- false
-
setCharset
Charset to be used for "read"<F,S extends IBasicFileSystem<F>> and "write"<F, S extends IBasicFileSystem<F>> action -
setDeleteEmptyFolder
public void setDeleteEmptyFolder(boolean deleteEmptyFolder) If set to true then the folder will be deleted if it is empty after processing the action. Works with actions "delete"<F,S extends IBasicFileSystem<F>>, "readDelete"<F, S extends IBasicFileSystem<F>> and "move"<F, S extends IBasicFileSystem<F>> -
setOutputFormat
Sets the outputFormat. This ignored when reading a file. Is applicable to actions which return information about file(s). Relevant for: 'info', 'list', 'append', 'move', 'delete' and 'copy' actions.- Default value
- XML
-
setTypeFilter
Filter for actionlist. SpecifyFILES_ONLY,FOLDERS_ONLYorFILES_AND_FOLDERS.- Default value
- FILES_ONLY
-