SFTPClient

SFTPClient

new SFTPClient(storageService)

Creates a new SFTPClient.

Parameters:
Name Type Description
storageService StorageService

A StorageService record that includes information about how to connect to a remote SFTP service. This record includes the host URL, default folder, and connection credentials.

Source:

Methods

(static) description() → {PluginDefinition}

Returns a PluginDefinition object describing this plugin.

Source:

_loadPrivateKey()

Loads a private key to be used in establishing an SFTP connection.

Source:

download(filepath, keyname)

Downloads a file from the remote server. The name of the default directory on the remote server is determined by the bucket property of the StorageService passed in to this class' constructor.

Parameters:
Name Type Description
filepath string

The local path to which we should save the downloaded file.

keyname string

This name of the file to download from the remote server.

Source:

list()

Lists files on a remote SFTP server. NOT YET IMPLEMENTED.

Source:

upload(filepathOrBuffer, keyname)

Uploads a file to the remote server. The name of the directory into which the file will be uploaded is determined by the bucket property of the StorageService passed in to this class' constructor.

Parameters:
Name Type Description
filepathOrBuffer string

The path to the local file, or a data buffer to be uploaded to the SFTP server.

keyname string

This name to assign the file on the remote server. This parameter is optional. If not specified, it defaults to the basename of filepath. That is, /path/to/bagOfPhotos.tar would default to bagOfPhotos.tar.

Source: