deleteRecursive

abstract fun deleteRecursive(name: BucketName)

Deletes the target bucket and all of its contents.

If the target bucket does not exist, this method does nothing.

This is a 'complex operation' in that it happens in multiple phases. The phases are as follows:

  1. Fetch a list of all the contents of the target bucket.

  2. Delete all the contents of the target bucket.

  3. Delete the bucket itself.

Due to the nature of S3 operations, there exists the possibility of a race condition where additional objects are inserted into the bucket after phase 1 or 2 which will cause the bucket delete operation to fail with an S3ErrorCode.BucketNotEmpty error.

Parameters

name

Name of the bucket to delete.

Throws

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


abstract fun deleteRecursive(name: BucketName, action: RecursiveBucketDeleteParams.() -> Unit)

Deletes the target bucket and all of its contents.

If the target bucket does not exist, this method does nothing.

This is a 'complex operation' in that it happens in multiple phases. The phases are as follows:

  1. Fetch a list of all the contents of the target bucket.

  2. Delete all the contents of the target bucket.

  3. Delete the bucket itself.

Due to the nature of S3 operations, there exists the possibility of a race condition where additional objects are inserted into the bucket after phase 1 or 2 which will cause the bucket delete operation to fail with an S3ErrorCode.BucketNotEmpty error.

Parameters

action

Action used to configure the S3 operation parameters.

Throws

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


Deletes the target bucket and all of its contents.

If the target bucket does not exist, this method does nothing.

This is a 'complex operation' in that it happens in multiple phases. The phases are as follows:

  1. Fetch a list of all the contents of the target bucket.

  2. Delete all the contents of the target bucket.

  3. Delete the bucket itself.

Due to the nature of S3 operations, there exists the possibility of a race condition where additional objects are inserted into the bucket after phase 1 or 2 which will cause the bucket delete operation to fail with an S3ErrorCode.BucketNotEmpty error.

Parameters

params

S3 operation parameters.

Throws

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