Filesystem
Allows multiple operations over files on the filesystem.
Categories: helpers
Type: filesystem/v1
Actions
Create Temp Directory
Name: createTempDir
Creates a file in the temporary directory on the filesystem. Returns the created directory’s full path.
Example JSON Structure
{ "label" : "Create Temp Directory", "name" : "createTempDir", "type" : "filesystem/v1/createTempDir"}
Output
Sample Output:
/sample_tmp_dir
Type: STRING
Create
Name: mkdir
Creates a directory.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
path | Path | STRING | The path of a directory. | true |
Example JSON Structure
{ "label" : "Create", "name" : "mkdir", "parameters" : { "path" : "" }, "type" : "filesystem/v1/mkdir"}
Output
Sample Output:
/sample_data
Type: STRING
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 | Description | Required |
---|---|---|---|---|
filename | File path | STRING | The path to full filename. | true |
Example JSON Structure
{ "label" : "Get Parent Folder", "name" : "getFilePath", "parameters" : { "filename" : "" }, "type" : "filesystem/v1/getFilePath"}
Output
Sample Output:
/sample_data
Type: STRING
List
Name: ls
Lists the content of a directory for the given path.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
path | Path | STRING | The path of a directory. | true |
recursive | Recursive | BOOLEAN Optionstrue, false | Should the subdirectories be included? | null |
Example JSON Structure
{ "label" : "List", "name" : "ls", "parameters" : { "path" : "", "recursive" : false }, "type" : "filesystem/v1/ls"}
Output
Type: ARRAY
Items Type: OBJECT
Properties
Name | Type | Description |
---|---|---|
filename | STRING | Name of the file. |
relativePath | STRING | Relative path of the file. |
size | INTEGER | Size of the file. |
Output Example
[ { "filename" : "", "relativePath" : "", "size" : 1} ]
Read File
Name: readFile
Reads all data from a specified file path and outputs it in file entry format.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
filename | File path | STRING | The path of the file to read. | true |
Example JSON Structure
{ "label" : "Read File", "name" : "readFile", "parameters" : { "filename" : "" }, "type" : "filesystem/v1/readFile"}
Output
Type: FILE_ENTRY
Properties
Name | Type | Description |
---|---|---|
extension | STRING | |
mimeType | STRING | |
name | STRING | |
url | STRING |
Output Example
{ "extension" : "", "mimeType" : "", "name" : "", "url" : ""}
Remove
Name: rm
Permanently removes the content of a directory.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
path | Path | STRING | The path of a directory. | true |
Example JSON Structure
{ "label" : "Remove", "name" : "rm", "parameters" : { "path" : "" }, "type" : "filesystem/v1/rm"}
Output
Sample Output:
true
Type: BOOLEAN
Write to File
Name: writeFile
null
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
fileEntry | File | FILE_ENTRY | File entry object to be written. | true |
filename | File path | STRING | The path to which the file should be written. | true |
Example JSON Structure
{ "label" : "Write to File", "name" : "writeFile", "parameters" : { "fileEntry" : { "extension" : "", "mimeType" : "", "name" : "", "url" : "" }, "filename" : "" }, "type" : "filesystem/v1/writeFile"}
Output
Sample Output:
{bytes=1024}
Type: OBJECT
Properties
Name | Type | Description |
---|---|---|
bytes | INTEGER | Number of bytes written. |
Output Example
{ "bytes" : 1}