AbstractFileSystemService

AbstractFileSystemService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Service:

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

ParamTypeDescription
filePathstring

the path of the file to get.

optionsobject

some options

options.encodingstring

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

ParamTypeDescription
filePathstring

the path of the file to set.

contentstring

content to write in file.

optionsobject

some options

options.encodingstring

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

ParamTypeDescription
filePathstring

the path of the file to set.

copyFile(filePathSrc, filePathDest) ⇒ Promise

Copy file from source path to destination path

Kind: instance method of AbstractFileSystemService

ParamTypeDescription
filePathSrcstring

the path of the source.

filePathDeststring

the path of the destination.

moveFile(filePathSrc, filePathDest) ⇒ Promise

Move file from source path to destination path

Kind: instance method of AbstractFileSystemService

ParamTypeDescription
filePathSrcstring

the path of the source.

filePathDeststring

the path of the destination.

listDirectoryFiles(path) ⇒ Promise

Do a listing of the directory

Kind: instance method of AbstractFileSystemService

ParamTypeDescription
pathstring

the path of the directory.

createDirectory(path) ⇒ Promise

Create a new directory.

Kind: instance method of AbstractFileSystemService

ParamTypeDescription
pathstring

the path of the directory.

deleteDirectory(path) ⇒ Promise

Remove a directory and all of its content.

Kind: instance method of AbstractFileSystemService

ParamTypeDescription
pathstring

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

ParamTypeDescription
dirPathSrcstring

The directory path to copy

dirPathDeststring

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

ParamTypeDescription
pathstring

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

ParamTypeDescription
...pathPartsstring

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

ParamTypeDescription
pathstring

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