Class: FileImporter

FileImporter()

Abstract class for importing files to a drive. Make sure you use setWorkerPath() with the correct worker script.

Constructor

new FileImporter()

Source:

Classes

FileImporter

Methods

close()

Close the importer and associated resources
Source:

getWorkerPath() → {string}

Get the current worker script path
Source:
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
Source:
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
Source:

isRunning() → {boolean}

True if importer is currently running a job.
Source:
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
Source:

stop()

Stops all current importing tasks
Source: