touch

abstract fun touch(path: String): S3Object

Creates an empty object at the specified path if one does not already exist.

Unlike the other object put methods, if an object already exists at the given path it will not be overwritten, in that case this method will do nothing.

Return

A handle on the newly created object.

Parameters

path

Path/key for the empty object to create.

Throws

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 touch(path: String, action: ObjectTouchParams.() -> Unit): S3Object

Creates an empty object at the specified path if one does not already exist.

Unlike the other object put methods, if an object already exists at the given path it will not be overwritten, in that case this method will do nothing.

Parameters

action

Action used to configure the backing S3 operation.

Throws

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 touch(path: String, params: ObjectTouchParams): S3Object

Creates an empty object at the specified path if one does not already exist.

Unlike the other object put methods, if an object already exists at the given path it will not be overwritten, in that case this method will do nothing.

Parameters

params

Parameters for the backing S3 operation.

Throws

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.