Skip to content

Commit

Permalink
Add JavaDoc Snippets for BlobClient and BlobAsyncClient (#4544)
Browse files Browse the repository at this point in the history
* Storage SAS implementation (#4404)

* SAS implementation

* Fixed some minor formatting issues

* Fixed checkstyle problems and test issue

* Remove RawClients from Blobs (#4375)

Removes RawClients from Storage Blobs

* Add deleteContainer to StorageClient and getBlobClient with Snapshot to ContainerClient (#4376)

* Removed raw clients

* Added deleteContainer to StorageClient

* Added getAppendBlob with snapshot to ContainerClient

* Storage queue linting, builder refactor, tests (#4383)

* Initial check in for storage queue

* Beginning of code snippets for BlobAsyncClient

* JavaDoc snippets for BlobAsyncClient and BlobClient

* Added links to REST API docs for BlobAsyncClient and BlobClient, fixed JavaDoc issues, fix unit test issues

* Removed invalid import
  • Loading branch information
alzimmermsft authored Jul 30, 2019
1 parent 77a6462 commit 8f9e52f
Show file tree
Hide file tree
Showing 14 changed files with 1,409 additions and 142 deletions.

Large diffs are not rendered by default.

376 changes: 306 additions & 70 deletions storage/client/blob/src/main/java/com/azure/storage/blob/BlobClient.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
* {@code DownloadAsyncResponse} wraps the protocol-layer response from {@link BlobAsyncClient#download(BlobRange,
* BlobAccessConditions, boolean, ReliableDownloadOptions)} to automatically retry failed reads from the body as
* ReliableDownloadOptions, BlobAccessConditions, boolean)} to automatically retry failed reads from the body as
* appropriate. If the download is interrupted, the {@code DownloadAsyncResponse} will make a request to resume the download
* from where it left off, allowing the user to consume the data as one continuous stream, for any interruptions are
* hidden. The retry behavior is defined by the options passed to the {@link #body(ReliableDownloadOptions)}. The
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob;

import com.azure.identity.credential.DefaultAzureCredential;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import com.azure.storage.blob.BlockBlobClient;
import com.azure.storage.blob.ContainerClient;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
package com.azure.storage.blob;

import com.azure.storage.common.credentials.SharedKeyCredential;

import java.io.ByteArrayInputStream;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import com.azure.storage.blob.BlockBlobClient;
import com.azure.storage.blob.ContainerClient;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
package com.azure.storage.blob;

import com.azure.storage.common.credentials.SharedKeyCredential;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob;

import java.net.MalformedURLException;
import java.net.URL;

final class JavaDocCodeSnippetsHelpers {
static ContainerAsyncClient getContainerAsyncClient() {
return new ContainerClientBuilder().buildAsyncClient();
}

static BlobAsyncClient getBlobAsyncClient(String blobName) {
return getContainerAsyncClient().getBlobAsyncClient(blobName);
}

static BlobClient getBlobClient(String blobName) {
return new BlobClient(getBlobAsyncClient(blobName));
}

static URL generateURL(String urlString) {
try {
return new URL(urlString);
} catch (MalformedURLException ex) {
throw new RuntimeException(ex);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
package com.azure.storage.blob;

import com.azure.storage.common.credentials.SharedKeyCredential;

import java.util.Locale;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob;

import com.azure.core.util.configuration.ConfigurationManager;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import com.azure.storage.blob.BlockBlobClient;
import com.azure.storage.blob.ContainerClient;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
package com.azure.storage.blob;

import com.azure.storage.blob.models.BlobHTTPHeaders;
import com.azure.storage.blob.models.Metadata;
import com.azure.storage.common.credentials.SharedKeyCredential;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob;

import com.azure.core.http.HttpResponse;
import com.azure.storage.blob.ContainerClient;
import com.azure.storage.blob.ContainerClientBuilder;
import com.azure.storage.blob.StorageException;
import com.azure.storage.blob.models.StorageErrorCode;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class BlobAPITest extends APISpec {

when:
def outStream = new ByteArrayOutputStream()
bu.download(outStream, null, range, null, false, null)
bu.download(outStream, range, null, null, false, null)
String bodyStr = outStream.toString()

then:
Expand Down Expand Up @@ -208,7 +208,7 @@ class BlobAPITest extends APISpec {

def "Download md5"() {
when:
VoidResponse response = bu.download(new ByteArrayOutputStream(), null, new BlobRange(0 ,3), null, true, null)
VoidResponse response = bu.download(new ByteArrayOutputStream(), new BlobRange(0 ,3), null, null, true, null)
byte[] contentMD5 = response.headers().value("content-md5").getBytes()

then:
Expand Down

0 comments on commit 8f9e52f

Please sign in to comment.