AbstractFileSystemService
On this page
- AbstractFileSystemService ⇐
Abstract- AbstractFileSystemService()
- readFile(filePath, options) ⇒
Promise - writeFile(filePath, content, options) ⇒
Promise - deleteFile(filePath) ⇒
Promise - copyFile(filePathSrc, filePathDest) ⇒
Promise - moveFile(filePathSrc, filePathDest) ⇒
Promise - listDirectoryFiles(path) ⇒
Promise - createDirectory(path) ⇒
Promise - deleteDirectory(path) ⇒
Promise - copyDirectory(dirPathSrc, dirPathDest) ⇒
Promise - dirname(path) ⇒
string - buildPathSync(…pathParts) ⇒
string - exists(path) ⇒
Promise.<boolean> - getFreeSpace() ⇒
Promise - getUsedSpace() ⇒
Promise
AbstractFileSystemService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Service:
- AbstractFileSystemService ⇐
Abstract- new AbstractFileSystemService()
- .readFile(filePath, options) ⇒
Promise - .writeFile(filePath, content, options) ⇒
Promise - .deleteFile(filePath) ⇒
Promise - .copyFile(filePathSrc, filePathDest) ⇒
Promise - .moveFile(filePathSrc, filePathDest) ⇒
Promise - .listDirectoryFiles(path) ⇒
Promise - .createDirectory(path) ⇒
Promise - .deleteDirectory(path) ⇒
Promise - .copyDirectory(dirPathSrc, dirPathDest) ⇒
Promise - .dirname(path) ⇒
string - .buildPathSync(…pathParts) ⇒
string - .exists(path) ⇒
Promise.<boolean> - .getFreeSpace() ⇒
Promise - .getUsedSpace() ⇒
Promise
AbstractFileSystemService()
The File System api is used to manipulate files in the STB.
readFile(filePath, options) ⇒ Promise
Read the content of a file.
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| filePath | string | the path of the file to get. |
| options | object | some options |
| options.encoding | string | encoding to use when reading content. Values can be : utf-8, binary. Default value is utf-8. |
writeFile(filePath, content, options) ⇒ Promise
Write content into a file.Create the file if it doesn’t exist.
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| filePath | string | the path of the file to set. |
| content | string | content to write in file. |
| options | object | some options |
| options.encoding | string | encoding to use when writing content. Values can be : utf-8, binary. Default value is utf-8. |
deleteFile(filePath) ⇒ Promise
Remove a file.
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| filePath | string | the path of the file to set. |
copyFile(filePathSrc, filePathDest) ⇒ Promise
Copy file from source path to destination path
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| filePathSrc | string | the path of the source. |
| filePathDest | string | the path of the destination. |
moveFile(filePathSrc, filePathDest) ⇒ Promise
Move file from source path to destination path
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| filePathSrc | string | the path of the source. |
| filePathDest | string | the path of the destination. |
listDirectoryFiles(path) ⇒ Promise
Do a listing of the directory
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| path | string | the path of the directory. |
createDirectory(path) ⇒ Promise
Create a new directory.
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| path | string | the path of the directory. |
deleteDirectory(path) ⇒ Promise
Remove a directory and all of its content.
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| path | string | the path of the directory. |
copyDirectory(dirPathSrc, dirPathDest) ⇒ Promise
Copy a directory and all its files and subdirectories to another
Kind: instance method of AbstractFileSystemService
| Param | Type | Description |
|---|---|---|
| dirPathSrc | string | The directory path to copy |
| dirPathDest | string | The path where to copy the directory |
dirname(path) ⇒ string
Return the directory name of a path
Kind: instance method of AbstractFileSystemService
Returns: string - directory name of a path
| Param | Type | Description |
|---|---|---|
| path | string | of file or directory |
buildPathSync(…pathParts) ⇒ string
Build a path from various path parts (SYNC).
Kind: instance method of AbstractFileSystemService
Returns: string - the complete path
| Param | Type | Description |
|---|---|---|
| ...pathParts | string | parts of path to join together to build a valid path |
exists(path) ⇒ Promise.<boolean>
Check if a path exists
Kind: instance method of AbstractFileSystemService
Returns: Promise.<boolean> - true if path exists, else false
| Param | Type | Description |
|---|---|---|
| path | string | the path to test |
getFreeSpace() ⇒ Promise
Get the free space available. size is in bytes.
Kind: instance method of AbstractFileSystemService
getUsedSpace() ⇒ Promise
Get the used space . size is in bytes.
Kind: instance method of AbstractFileSystemService