Skip to main content
Version: 4.46.0

File API

This component allows you to recursively scrape a directory on a filesystem or retrieve the metadata of a single file In order to access the local filesystem, the XILL4_WORKDIRS environment variable must be set to the path of the directory to be accessed.

Configuration

Example configuration of root directories to scrape:

{
"rootName": {
"path": "C:\\Windows",
"recursive": true
},
"secondRootName": {
"path": "C:\\Drivers",
"recursive": true
}
}

The keys rootName and secondRootName are descriptive and can have any value as long as they are unique. The recursive parameter is passed through to each result output in order to be able determine if recursion is enabled for the configured root directory.

To retrieve the metadata of a single file, no configuration is required. Use the fullPath key in an message to specify the path of the file to retrieve the metadata of.

Rate Limiting

By default, rate limiting is enabled with 10 jobs per 100ms. The limit and interval can be changed in the configuration. Rate limiting can be disabled by setting these values to 0.

Request limit

The max amount of requests during the interval.

Interval

The interval in milliseconds in which the requests happen. Should be a multiple of 250.

Inputs

Input

This input takes objects that have a fullPath key that contains the path to scrape. This can either be a path to a file or a directory.

If the recursive key is set to false, only the current directory entries will be output. If the recursive key is set to true, all directory entries of the sub-folders will be output as well. Note when fullPath is a file, the recursive key is ignored and can be omitted.

Example:

{
"fullPath" : "C:/Users",
"recursive": true
}

If the incoming data doesn't have fullPath defined, the component will check for the configuration. At least one of the two is required.

Outputs

Output

Output the input data and the metadata of the filesystem objects including the configurational information required for recursion and parent determination.

Example:

{
result: {
"fullPath" : "C:\\Users\\Bob",
"recursive": true
},
value:{
"root": "C:\\Users\\Bob",
"parentPath": "C:\\Users\\Bob\\Downloads",
"fullPath": "C:\\Users\\Bob\\Downloads\\stream.js",
"name": "stream.js",
"isDirectory": false,
"isSymbolicLink": false,
"isFile": true,
"created": 2021-03-03 12:18:28,
"modified": 1985-10-26 09:15:00,
"accessed": 2021-07-13 14:53:34,
"size": 36,
"rawExtension": ".js",
"extension": ".js",
"statusChanged": 2021-06-23 13:26:09
}
}