Constructor
new FileCommander()
Instantiate a new file commander object.
Classes
Methods
areJobsStopped() → {boolean}
Check if all jobs are stopped.
Returns:
True if jobs are stopped
- Type
- boolean
cancel()
Cancel all jobs.
close()
Close the commander and associated resources.
(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 |
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. |
(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 |
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. |
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 |
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.
Returns:
True if the file search is currently running.
- Type
- boolean
isFileSearcherStopped() → {boolean}
Check if file search stopped.
Returns:
True if file search stopped.
- Type
- boolean
isRunning() → {boolean}
Check if jobs are currently running.
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 |
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 |
(async) search(dir, terms, optionsopt) → {Promise.<Array.<IVirtualFile>>}
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 |
Returns:
An array with all the results found.
- Type
- Promise.<Array.<IVirtualFile>>
stopFileSearch()
Stop file search.