BucketContainer

interface BucketContainer

S3 Bucket Container

Represents the root of an S3 store on which bucket operations may be performed.

Managing Bucket Tags

This interface does not define any methods for managing bucket tags. To work with bucket tags use one of the bucket access methods contained in this type, such as withBucket or get which give access to an S3Bucket instance without performing any additional operations.

Example:

container.withBucket("my-bucket") {
tags.put("something", "some value")
}

container["my-bucket"].tags.put("something", "some value")

Functions

Link copied to clipboard
abstract fun create(name: BucketName): S3Bucket

Attempts to create a bucket with the given name.

abstract fun create(name: BucketName, action: BucketPutParams.() -> Unit): S3Bucket

Attempts to create a bucket with the given name with the operation configured by the given action.

abstract fun create(name: BucketName, params: BucketPutParams): S3Bucket

Attempts to create a bucket with the given name with the operation configured by the given params.

Link copied to clipboard
abstract fun createIfNotExists(name: BucketName, action: BucketUpsertParams.() -> Unit): S3Bucket

Attempts to create a bucket with the given name if it does not already exist in the S3 instance.

Link copied to clipboard
abstract fun delete(name: BucketName)
abstract fun delete(name: BucketName, action: BucketDeleteParams.() -> Unit)
abstract fun delete(name: BucketName, params: BucketDeleteParams)

Deletes the target bucket from the S3 instance.

Link copied to clipboard
abstract fun deleteRecursive(name: BucketName)
abstract fun deleteRecursive(name: BucketName, action: RecursiveBucketDeleteParams.() -> Unit)

Deletes the target bucket and all of its contents.

Link copied to clipboard
abstract fun exists(name: BucketName): Boolean

Tests for the existence of a bucket with the given name.

abstract fun exists(name: BucketName, action: BucketExistsParams.() -> Unit): Boolean

Tests for the existence of a bucket with the operation configured by the given action.

abstract fun exists(name: BucketName, params: BucketExistsParams): Boolean

Tests for the existence of a bucket with the operation configured by the given params.

Link copied to clipboard
abstract operator fun get(name: BucketName): S3Bucket?
abstract fun get(name: BucketName, action: BucketGetParams.() -> Unit): S3Bucket?
abstract fun get(name: BucketName, params: BucketGetParams): S3Bucket?

Creates a new S3Bucket instance wrapping the target S3 bucket.

Link copied to clipboard
abstract fun list(): BucketList
abstract fun list(action: BucketListParams.() -> Unit): BucketList
abstract fun list(params: BucketListParams): BucketList

Fetches a list of all buckets available on the target S3 instance.

Link copied to clipboard
abstract fun <R> withBucket(name: BucketName, action: S3Bucket.() -> R): R

Executes the given action on the target bucket.