Uploader

Uploader

The Uploader performs the upload operations for a job. It catches events from the underlying network plugin, wraps them in JobStatus objects, and writes them to STDOUT and STDERR to communicate with the parent process.

param {Job} - The job to run. The job object must contain at at least one UploadOperation, or the upload will do nothing.

Constructor

new Uploader(job)

Parameters:
Name Type Description
job Job
Source:

Methods

doUpload(uploadOp) → {Array.<Promise>}

doUpload initiates a single upload operation and returns an array of promises. If a single operation includes multiple source files, it will upload them in parallel. This returns one promise per source file.

Because each upload resets the exitCode, the caller should ignore the final exitCode and check the results of all of the promises instead. [This needs a more elegant fix.]

Parameters:
Name Type Description
uploadOp UploadOperation

An upload operation containing one or more source files.

Source:

getProvider() → {Plugin}

This returns the first network provider plugin that implements the S3 protocol. If it can't find a plugin for the S3 protocol, it throws an exception.

Source:

run() → {Array.<Promise>}

This runs all of the job's upload operations. It returns an array of promises. This runs all uploads in parallel.

Source:

validateParams() → {Array.<string>}

This checks to ensure that the UploadOperation includes a target and at least one source file. It also ensures that the specified source files exist. It returns an array of strings decribing the validation errors.

Source: