Calls related to interactions with the filesystem
- Since:
- 2.1
- Source:
Methods
(static) list(path, paramsopt) → {Promise.<(Array.<String>|Error)>}
List of files available at the given directory.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string | Relative or absolute directory path. Must reside in qz data directory or a white-listed location. | ||||||||||||||||
params |
Object |
<optional> |
Object containing file access parameters
Properties
|
- Source:
Returns:
Array of files at the given path
- Type
- Promise.<(Array.<String>|Error)>
(static) read(path, paramsopt) → {Promise.<(String|Error)>}
Reads contents of file at the given path.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string | Relative or absolute file path. Must reside in qz data directory or a white-listed location. | |||||||||||||||||||||
params |
Object |
<optional> |
Object containing file access parameters
Properties
|
- Source:
Returns:
String containing the file contents
- Type
- Promise.<(String|Error)>
(static) remove(path, paramsopt) → {Promise.<(null|Error)>}
Deletes a file at given path.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string | Relative or absolute file path. Must reside in qz data directory or a white-listed location. | ||||||||||||||||
params |
Object |
<optional> |
Object containing file access parameters
Properties
|
- Source:
Returns:
- Type
- Promise.<(null|Error)>
(static) setFileCallbacks(calls)
List of functions called for any response from a file listener.
For ERROR types event data will contain,
{string} message
.
For ACTION types event data will contain, {string} file {string} eventType {string} [data]
.
Parameters:
Name | Type | Description |
---|---|---|
calls |
function | Array.<function()> | Single or array of Function({Object} eventData) calls. |
- Since:
- 2.1.0
- Source:
(static) startListening(path, paramsopt) → {Promise.<(null|Error)>}
Provides a continuous stream of events (and optionally data) from a local file.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string | Relative or absolute directory path. Must reside in qz data directory or a white-listed location. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
params |
Object |
<optional> |
Object containing file access parameters
Properties
|
- Since:
- 2.1.0
- Source:
- See:
Returns:
- Type
- Promise.<(null|Error)>
(static) stopListening(pathopt, paramsopt) → {Promise.<(null|Error)>}
Closes listeners with the provided settings. Omitting the path parameter will result in all listeners closing.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string |
<optional> |
Previously opened directory path of listener to close, or omit to close all. | |||||||||||||||
params |
Object |
<optional> |
Object containing file access parameters
Properties
|
- Source:
Returns:
- Type
- Promise.<(null|Error)>
(static) write(path, params) → {Promise.<(null|Error)>}
Writes data to the file at the given path.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Due to security reasons, paths are limited to the qz data directory unless overridden via properties file.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string | Relative or absolute file path. Must reside in qz data directory or a white-listed location. | ||||||||||||||||||||||||||||||
params |
Object | Object containing file access parameters
Properties
|
- Source:
Returns:
- Type
- Promise.<(null|Error)>