rmdir

abstract fun rmdir(path: String)

Recursively removes all contents in the target directory.

Example

Given the container state:

foo/bar/bazz.txt
foo/bar/fizz.txt
foo/buzz.txt
food/world.png

The operation:

container.rmdir("foo")

Will result in the state:

food/world.png

Parameters

path

Path to the target directory that will be removed.

Throws

If some or all of the directory's contents could not be deleted.

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 rmdir(path: String, action: DirectoryDeleteParams.() -> Unit)

Recursively removes all contents in the target directory.

Example

Given the container state:

foo/bar/bazz.txt
foo/bar/fizz.txt
foo/buzz.txt
food/world.png

The operation:

container.rmdir("foo")

Will result in the state:

food/world.png

Parameters

action

Action used to configure the backing S3 operation.

Throws

If path value is not set on the configured parameters.

If some or all of the directory's contents could not be deleted.

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 rmdir(path: String, params: DirectoryDeleteParams)

Recursively removes all contents in the target directory.

Example

Given the container state:

foo/bar/bazz.txt
foo/bar/fizz.txt
foo/buzz.txt
food/world.png

The operation:

container.rmdir("foo")

Will result in the state:

food/world.png

Parameters

params

Parameters for the backing S3 operation.

Throws

If the path value is not set on the configured parameters.

If some or all of the directory's contents could not be deleted.

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.