Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deleteContainer to StorageClient and getBlobClient with Snapshot to ContainerClient #4376

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ public Mono<Response<String>> startCopyFromURL(URL sourceURL) {
* @param destAccessConditions {@link BlobAccessConditions} against the destination.
* @return A reactive response containing the copy ID for the long running operation.
*/
public Mono<Response<String>> startCopyFromURL(URL sourceURL, Metadata metadata,
ModifiedAccessConditions sourceModifiedAccessConditions, BlobAccessConditions destAccessConditions) {
public Mono<Response<String>> startCopyFromURL(URL sourceURL, Metadata metadata, ModifiedAccessConditions sourceModifiedAccessConditions, BlobAccessConditions destAccessConditions) {
metadata = metadata == null ? new Metadata() : metadata;
sourceModifiedAccessConditions = sourceModifiedAccessConditions == null
? new ModifiedAccessConditions() : sourceModifiedAccessConditions;
Expand Down Expand Up @@ -262,8 +261,7 @@ public Mono<Response<String>> copyFromURL(URL copySource) {
* @param destAccessConditions {@link BlobAccessConditions} against the destination.
* @return A reactive response containing the copy ID for the long running operation.
*/
public Mono<Response<String>> copyFromURL(URL copySource, Metadata metadata,
ModifiedAccessConditions sourceModifiedAccessConditions, BlobAccessConditions destAccessConditions) {
public Mono<Response<String>> copyFromURL(URL copySource, Metadata metadata, ModifiedAccessConditions sourceModifiedAccessConditions, BlobAccessConditions destAccessConditions) {
metadata = metadata == null ? new Metadata() : metadata;
sourceModifiedAccessConditions = sourceModifiedAccessConditions == null
? new ModifiedAccessConditions() : sourceModifiedAccessConditions;
Expand Down Expand Up @@ -302,8 +300,7 @@ public Mono<Response<Flux<ByteBuffer>>> download() {
* @param options {@link ReliableDownloadOptions}
* @return A reactive response containing the blob data.
*/
public Mono<Response<Flux<ByteBuffer>>> download(BlobRange range, BlobAccessConditions accessConditions,
boolean rangeGetContentMD5, ReliableDownloadOptions options) {
public Mono<Response<Flux<ByteBuffer>>> download(BlobRange range, BlobAccessConditions accessConditions, boolean rangeGetContentMD5, ReliableDownloadOptions options) {
return this.download(range, accessConditions, rangeGetContentMD5)
.map(response -> new SimpleResponse<>(
response.rawResponse(),
Expand Down Expand Up @@ -457,8 +454,7 @@ public Mono<VoidResponse> delete() {
* @param accessConditions {@link BlobAccessConditions}
* @return A reactive response signalling completion.
*/
public Mono<VoidResponse> delete(DeleteSnapshotsOptionType deleteBlobSnapshotOptions,
BlobAccessConditions accessConditions) {
public Mono<VoidResponse> delete(DeleteSnapshotsOptionType deleteBlobSnapshotOptions, BlobAccessConditions accessConditions) {
accessConditions = accessConditions == null ? new BlobAccessConditions() : accessConditions;

return postProcessResponse(this.azureBlobStorage.blobs().deleteWithRestResponseAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,7 @@ public Mono<VoidResponse> setMetadata(Metadata metadata) {
* @throws UnsupportedOperationException If {@link ContainerAccessConditions#modifiedAccessConditions()} has
* anything set other than {@link ModifiedAccessConditions#ifModifiedSince()}.
*/
public Mono<VoidResponse> setMetadata(Metadata metadata,
ContainerAccessConditions accessConditions) {
public Mono<VoidResponse> setMetadata(Metadata metadata, ContainerAccessConditions accessConditions) {
metadata = metadata == null ? new Metadata() : metadata;
accessConditions = accessConditions == null ? new ContainerAccessConditions() : accessConditions;
if (!validateNoEtag(accessConditions.modifiedAccessConditions())
Expand Down Expand Up @@ -434,8 +433,7 @@ public Mono<VoidResponse> setAccessPolicy(PublicAccessType accessType,
* @throws UnsupportedOperationException If {@link ContainerAccessConditions#modifiedAccessConditions()} has either
* {@link ModifiedAccessConditions#ifMatch()} or {@link ModifiedAccessConditions#ifNoneMatch()} set.
*/
public Mono<VoidResponse> setAccessPolicy(PublicAccessType accessType,
List<SignedIdentifier> identifiers, ContainerAccessConditions accessConditions) {
public Mono<VoidResponse> setAccessPolicy(PublicAccessType accessType, List<SignedIdentifier> identifiers, ContainerAccessConditions accessConditions) {
accessConditions = accessConditions == null ? new ContainerAccessConditions() : accessConditions;

if (!validateNoEtag(accessConditions.modifiedAccessConditions())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ public Mono<Response<ContainerAsyncClient>> createContainer(String containerName
.map(response -> new SimpleResponse<>(response, containerAsyncClient));
}

/**
* Deletes the specified container in the storage account. If the container doesn't exist the operation fails. For
* more information see the <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container">Azure Docs</a>.
*
* @param containerName Name of the container to delete
* @return A response containing status code and HTTP headers
*/
public Mono<VoidResponse> deleteContainer(String containerName) {
return getContainerAsyncClient(containerName).delete();
}

/**
* Gets the URL of the storage account represented by this client.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ public Response<ContainerClient> createContainer(String containerName, Metadata
return new SimpleResponse<>(client.create(metadata, accessType, null), client);
}

/**
* Deletes the specified container in the storage account. If the container doesn't exist the operation fails. For
* more information see the <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container">Azure Docs</a>.
*
* @param containerName Name of the container to delete
* @return A response containing status code and HTTP headers
*/
public VoidResponse deleteContainer(String containerName) {
return storageAsyncClient.deleteContainer(containerName).block();
}

/**
* Gets the URL of the storage account represented by this client.
*
Expand Down