withObject

abstract fun <R> withObject(path: String, action: S3Object.() -> R): R

Executes the given action on the target object.

Parameters

path

Path/key to the target object.

action

Action that will be called on the S3Object handle on the target object.

Throws

If the target object 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.