Constructor
new S3Client(storageService)
Creates a new S3Client.
Parameters:
Name | Type | Description |
---|---|---|
storageService |
StorageService |
A StorageService record that includes information about how to connect to a remote S3 service. This record includes the host URL, default bucket, and connection credentials. |
- Source:
Methods
(static) description() → {PluginDefinition}
Returns a PluginDefinition object describing this plugin.
- Source:
download(filepath, keyname)
Downloads a file from the remote bucket. The name of the remote bucket is determined by 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 key (object) to download from the S3 bucket. |
- Source:
exists(key) → {bool}
Checks to see whether a file already exists on the storage provider. NOT YET IMPLEMENTED.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
The key whose existence you want to check. |
- Source:
list()
Lists files in a remote S3 bucket. NOT YET IMPLEMENTED.
- Source:
upload(filepath, keyname)
Uploads a file to the remote bucket. The name of the remote bucket is determined by the StorageService passed in to this class' constructor.
Parameters:
Name | Type | Description |
---|---|---|
filepath |
string |
The path to the local file to be uploaded to S3. |
keyname |
string |
This name of the key to put into the remote bucket. 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: