Perform File Operation
This handler (com.rierino.handler.FSEventHandler) provides ability to interact with local and remote file systems for directory and file operations.
Handler Parameters
systems
Comma separated list of file system names to use
imageFs,cdnFs
-
role.source
System name for sourcing files from for sync file role calls
imageFs
-
role.target
System name for pushing files to for sync file role calls
cdnFs
-
role.fromRegex
Regex for filtering source files
/source/(?<folder>\\w+)/(?<file>\\w+)
-
role.toPattern
Pattern for converting source paths to target paths
/target/${folder}/${file}
-
role.move
Whether role calls should move files or just copy
true
false
Actions
MakeDir
Creates a new directory in given file system. Event metadata fields applicable for this action are as follows:
domain
Name of the file system to use
imageFs
-
With event metadata parameters as:
pathPath
Json path in payload for directory path to create
filePath
path
List / ListPath
Lists files and directories for given path. Event metadata fields applicable for this action are as follows:
domain
Name of the file system to use
imageFs
-
With event metadata parameters as:
pathPath
Json path in payload for directory path to list
filePath
path
Delete / DeletePath
Deletes a file or directory in given file system. Event metadata fields applicable for this action are as follows:
domain
Name of the file system to use
imageFs
-
With event metadata parameters as:
pathPath
Json path in payload for file/directory path to delete
filePath
path
recursive
Whether deletion should include sub-directories
true
false
Rename / RenamePath
Renames a file or directory in given file system. Event metadata fields applicable for this action are as follows:
domain
Name of the file system to use
imageFs
-
With event metadata parameters as:
pathPath
Json path in payload for file/directory to rename
filePath
path
toPath
Json path in payload for new file/directory name
newPath
to
CopyFile
Copies or moves a file from one file system to another. Event metadata fields applicable for this action are as follows:
domain
Name of the source file system to use
imageFs
-
With event metadata parameters as:
target
Name of the target file system
cdnFs
-
pathPath
Json path in payload for file/directory to copy
filePath
path
toPath
Json path in payload for target file/directory
newPath
to
move
Whether file should be deleted from the source
true
false
Write / WriteFile
Writes contents to a single file or a set of files for a given file system:
domain
Name of the file system to write to
dataLakeFs
-
With event metadata parameters as:
pathPath
Json path in payload for directory path to list (from payload root)
parameters.id
path
mode
Type of file(s) to output (, )
sequence
single
prefix
Prefix to add to each file's name (for sequence mode output)
tracking/views
-
suffix
Suffix to add to each file's name (for sequence mode output)
_out.json
-
content
Event contents to write to file (for sequence mode, , or )
request
payload
overwrite
Whether to overwrite or append contents to output (for single mode output)
true
false
For sequence output mode, this handler uses a path writer, which is responsible for generating unique sequence file paths/names for wrting contents to. The writer can be configured by adding path.* parameters to file system definition.
Using "[uuid]" in prefix or suffix allows generation of globally unique paths and file names, as this entry is replaced with a UUID value generated.
Read / ReadFile
Reads and returns contents of a file (in a cachable manner):
domain
Name of the file system to read from
contentsFs
-
With event metadata parameters as:
pathPath
Json path in payload for directory path to list
id
path
format
Format of the file contents to retrieve (json,text)
json
text
Roles
syncFile
Uses pulse records to trigger delete, copy or move of files from one file system to another, based on handler role parameters.
Last updated