Classes
Methods
close()
Close the importer and associated resources
getWorkerPath() → {string}
Get the current worker script path
Returns:
The path
- Type
- string
(async) importFile(fileToImport, dir, optionsopt) → {Promise.<(IVirtualFile|null)>}
Imports a real file into the drive.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fileToImport |
IFile | The source file that will be imported in to the drive. | |
dir |
IFile | The target directory in the drive that the file will be imported | |
options |
FileImportOptions |
<optional> |
Options |
Returns:
A promise which resolves to a virtual file or null
- Type
- Promise.<(IVirtualFile|null)>
initialize(bufferSize, threads)
Initiliazes a file importer that can be used to import files to the drive
Parameters:
Name | Type | Default | Description |
---|---|---|---|
bufferSize |
Uint8Array | 0 | Buffer size to be used when encrypting files. If using integrity this value has to be a multiple of the Chunk size. If not using integrity it should be a multiple of the AES block size for better performance |
threads |
number | 1 | The threads |
isRunning() → {boolean}
True if importer is currently running a job.
Returns:
True if running
- Type
- boolean
setWorkerPath(path)
Set the path to the worker script to use
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The path |
stop()
Stops all current importing tasks