Class: FileCommander

FileCommander()

Facade class for file operations.

Constructor

new FileCommander()

Instantiate a new file commander object.
Source:

Classes

FileCommander

Methods

areJobsStopped() → {boolean}

Check if all jobs are stopped.
Source:
Returns:
True if jobs are stopped
Type
boolean

cancel()

Cancel all jobs.
Source:

close()

Close the commander and associated resources.
Source:

(async) copyFiles(filesToCopy, dir, optionsopt)

Copy files to another directory.
Parameters:
Name Type Attributes Description
filesToCopy Array.<IVirtualFile> The array of files to copy.
dir IVirtualFile The target directory.
options BatchCopyOptions <optional>
The options
Source:
Throws:
Exception When a error during copying occurs.

(async) deleteFiles(filesToDelete, optionsopt)

Delete files from a drive.
Parameters:
Name Type Attributes Description
filesToDelete Array.<IVirtualFile> The files to delete.
options BatchDeleteOptions <optional>
The options.
Source:

(async) exportFiles(filesToExport, exportDir, optionsopt) → {Promise.<Array.<IFile>>}

Export a file from a drive.
Parameters:
Name Type Attributes Description
filesToExport Array.<IVirtualFile> The files to export.
exportDir IFile The export target directory
options BatchExportOptions <optional>
The options
Source:
Throws:
Exception
Returns:
The exported files
Type
Promise.<Array.<IFile>>

(async) getFiles(files) → {Promise.<number>}

Get number of files recursively for the files provided.
Parameters:
Name Type Description
files Array.<IVirtualFile> The files and directories.
Source:
Returns:
Total number of files and files under subdirectories.
Type
Promise.<number>

(async) importFiles(filesToImport, importDir, optionsopt) → {Promise.<Array.<IVirtualFile>>}

Import files to the drive.
Parameters:
Name Type Attributes Description
filesToImport Array.<IFile> The files to import.
importDir IVirtualFile The target directory.
options BatchImportOptions <optional>
The options
Source:
Throws:
Exception If there was an error during import
Returns:
The imported files if completes successfully.
Type
Promise.<Array.<IVirtualFile>>

isFileSearcherRunning() → {boolean}

Check if the file search is currently running.
Source:
Returns:
True if the file search is currently running.
Type
boolean

isFileSearcherStopped() → {boolean}

Check if file search stopped.
Source:
Returns:
True if file search stopped.
Type
boolean

isRunning() → {boolean}

Check if jobs are currently running.
Source:
Returns:
True if jobs are currently running.
Type
boolean

onError(ex) → {boolean}

Handle the error.
Parameters:
Name Type Description
ex Error | unknown | null The error
Source:
Returns:
True if handled
Type
boolean

(async) renameFile(file, newFilename)

Rename an encrypted file
Parameters:
Name Type Description
file IVirtualFile The file
newFilename string The new filename
Source:
Search
Parameters:
Name Type Attributes Description
dir IVirtualFile The directory to start the search.
terms string The terms to search for.
options SearchOptions <optional>
The options
Source:
Returns:
An array with all the results found.
Type
Promise.<Array.<IVirtualFile>>

stopFileSearch()

Stop file search.
Source: