Filesystem
Allows multiple operations over files on the filesystem.
Categories: helpers
Type: filesystem/v1
Actions
Read File
Name: readFile
Reads all data from a specified file path and outputs it in file entry format.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
filename | File path | STRING | TEXT | The path of the file to read. | true |
Output
Type: FILE_ENTRY
Properties
Name | Type | Control Type |
---|---|---|
extension | STRING | TEXT |
mimeType | STRING | TEXT |
name | STRING | TEXT |
url | STRING | TEXT |
JSON Example
{ "label" : "Read File", "name" : "readFile", "parameters" : { "filename" : "" }, "type" : "filesystem/v1/readFile"}
Write to File
Name: writeFile
null
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
fileEntry | File | FILE_ENTRY | FILE_ENTRY | File entry object to be written. | true |
filename | File path | STRING | TEXT | The path to which the file should be written. | true |
Output
Sample Output:
{bytes=1024}
Type: OBJECT
Properties
Name | Type | Control Type |
---|---|---|
bytes | INTEGER | INTEGER |
JSON Example
{ "label" : "Write to File", "name" : "writeFile", "parameters" : { "fileEntry" : { "extension" : "", "mimeType" : "", "name" : "", "url" : "" }, "filename" : "" }, "type" : "filesystem/v1/writeFile"}
Create Temp Directory
Name: createTempDir
Creates a file in the temporary directory on the filesystem. Returns the created directory’s full path.
Output
Sample Output:
/sample_tmp_dir
Type: STRING
JSON Example
{ "label" : "Create Temp Directory", "name" : "createTempDir", "type" : "filesystem/v1/createTempDir"}
Get Parent Folder
Name: getFilePath
Gets the path of the parent folder of the file. If the file doesn’t exist, it throws an error.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
filename | File path | STRING | TEXT | The path to full filename. | true |
Output
Sample Output:
/sample_data
Type: STRING
JSON Example
{ "label" : "Get Parent Folder", "name" : "getFilePath", "parameters" : { "filename" : "" }, "type" : "filesystem/v1/getFilePath"}
List
Name: ls
Lists the content of a directory for the given path.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
path | Path | STRING | TEXT | The path of a directory. | true |
recursive | Recursive | BOOLEAN Optionstrue, false | SELECT | Should the subdirectories be included? | null |
Output
Type: ARRAY
Properties
Name | Type | Control Type |
---|---|---|
OBJECT Properties{STRING(fileName), STRING(relativePath), INTEGER(size)} | OBJECT_BUILDER |
JSON Example
{ "label" : "List", "name" : "ls", "parameters" : { "path" : "", "recursive" : false }, "type" : "filesystem/v1/ls"}
Create
Name: mkdir
Creates a directory.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
path | Path | STRING | TEXT | The path of a directory. | true |
Output
Sample Output:
/sample_data
Type: STRING
JSON Example
{ "label" : "Create", "name" : "mkdir", "parameters" : { "path" : "" }, "type" : "filesystem/v1/mkdir"}
Remove
Name: rm
Permanently removes the content of a directory.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
path | Path | STRING | TEXT | The path of a directory. | true |
Output
Sample Output:
true
Type: BOOLEAN
JSON Example
{ "label" : "Remove", "name" : "rm", "parameters" : { "path" : "" }, "type" : "filesystem/v1/rm"}