upload

abstract fun upload(path: String, file: File): S3Object

Uploads the specified file to this container at the given path, overwriting any object presently at that path.

Return

An S3Object instance handle on the target object.

Parameters

path

Path to the object to create/overwrite in this container.

file

Local file to upload.

Throws

If the given local file does not exist.

If the given local file handle points to a directory.

If this bucket or the bucket in which this object container resides no longer exists.

If an implementation specific exception is thrown. The implementation specific exception will be set to the thrown exception's 'cause' value.


abstract fun upload(path: String, action: FileUploadParams.() -> Unit): S3Object

Uploads the configured file to this container at the configured path, overwriting any object presently at that path.

Return

An S3Object instance handle on the target object.

Parameters

action

Action used to configure the backing S3 operation.

Throws

If the localFile value is not set on the configured parameters, or if the localFile value points to a directory.

If the configured local file does not exist.

If this bucket or the bucket in which this object container resides no longer exists.

If an implementation specific exception is thrown. The implementation specific exception will be set to the thrown exception's 'cause' value.


abstract fun upload(path: String, params: FileUploadParams): S3Object

Uploads the configured file to this container at the configured path, overwriting any object presently at that path.

Return

An S3Object instance handle on the target object.

Parameters

params

Parameters for the backing S3 operation.

Throws

If the localFile value is not set on the configured parameters, or if the localFile value points to a directory.

If the configured local file does not exist.

If this bucket or the bucket in which this object container resides no longer exists.

If an implementation specific exception is thrown. The implementation specific exception will be set to the thrown exception's 'cause' value.