Class: FileHandler

GPUdb.FileHandler(gpuDBopt)

FileHandler API object that provides access to KIFS server functions.

Constructor

new FileHandler(gpuDBopt)

Creates a FileHandler object
Parameters:
Name Type Attributes Description
gpuDB Object <optional>
GPUdb API object that provides access to GPUdb server functions.
Source:

Methods

download(filenames, options) → {Promise}

Downloads the list of files from KIFS to local filesystem.
Parameters:
Name Type Description
filenames Array Filepaths for KIFS files to be downloaded.
options Map Download options. A placeholder for future options.
Source:
Returns:
A promise that will be fulfilled with object, if no callback function is provided. Returns an array containing base64 file data.
Type
Promise

upload(filenames, destination, options, progress_callback, callback) → {Promise}

Uploads the list of files from local filesystem to KIFS.
Parameters:
Name Type Description
filenames Object Files to be uploaded. Can be a single string or multiple strings containing the full path of the files, or file objects (single or multiple) containing the file data.
destination String Destination kifs path
options Map Upload options. A placeholder for future options.
progress_callback function Optional callback that receives one arg which is the upload progress as a percentage of 100. Only called for multi part uploads.
callback function callback function which is called after the file upload operation is completed to indicate the completion to the caller of this function.
Source:
Returns:
A promise that will be fulfilled with true for success and false for failure (if no callback function is provided).
Type
Promise

upload_multipart(file, destination, chunk_size, options, progress_callback, callback) → {Promise}

Uploads the list of files from local filesystem to KIFS.
Parameters:
Name Type Description
file Object File to be uploaded. Can be a single file object containing the file data.
destination String Destination kifs
chunk_size number Size of each chunk
options Map Upload options A placeholder for future options. Currently unused.
progress_callback function Optional callback that receives one arg which is the upload progress as a percentage of 100.
callback function Optional callback function that receives one argument which is the uuid of the current file upload operation.
Source:
Returns:
A promise that will be fulfilled with true for success and false for failure.
Type
Promise