Skip to content

Commit 8f9e52f

Browse files
authored
Add JavaDoc Snippets for BlobClient and BlobAsyncClient (#4544)
* 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
1 parent 77a6462 commit 8f9e52f

14 files changed

+1409
-142
lines changed

storage/client/blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java

Lines changed: 280 additions & 50 deletions
Large diffs are not rendered by default.

storage/client/blob/src/main/java/com/azure/storage/blob/BlobClient.java

Lines changed: 306 additions & 70 deletions
Large diffs are not rendered by default.

storage/client/blob/src/main/java/com/azure/storage/blob/DownloadAsyncResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/**
2020
* {@code DownloadAsyncResponse} wraps the protocol-layer response from {@link BlobAsyncClient#download(BlobRange,
21-
* BlobAccessConditions, boolean, ReliableDownloadOptions)} to automatically retry failed reads from the body as
21+
* ReliableDownloadOptions, BlobAccessConditions, boolean)} to automatically retry failed reads from the body as
2222
* appropriate. If the download is interrupted, the {@code DownloadAsyncResponse} will make a request to resume the download
2323
* from where it left off, allowing the user to consume the data as one continuous stream, for any interruptions are
2424
* hidden. The retry behavior is defined by the options passed to the {@link #body(ReliableDownloadOptions)}. The

storage/client/blob/src/samples/java/AzureIdentityExample.java renamed to storage/client/blob/src/samples/java/com/azure/storage/blob/AzureIdentityExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
package com.azure.storage.blob;
5+
46
import com.azure.identity.credential.DefaultAzureCredential;
5-
import com.azure.storage.blob.BlobServiceClient;
6-
import com.azure.storage.blob.BlobServiceClientBuilder;
77

88
import java.util.Locale;
99

storage/client/blob/src/samples/java/BasicExample.java renamed to storage/client/blob/src/samples/java/com/azure/storage/blob/BasicExample.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import com.azure.storage.blob.BlockBlobClient;
5-
import com.azure.storage.blob.ContainerClient;
6-
import com.azure.storage.blob.BlobServiceClient;
7-
import com.azure.storage.blob.BlobServiceClientBuilder;
4+
package com.azure.storage.blob;
5+
86
import com.azure.storage.common.credentials.SharedKeyCredential;
97

108
import java.io.ByteArrayInputStream;

storage/client/blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java

Lines changed: 390 additions & 0 deletions
Large diffs are not rendered by default.

storage/client/blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java

Lines changed: 387 additions & 0 deletions
Large diffs are not rendered by default.

storage/client/blob/src/samples/java/FileTransferExample.java renamed to storage/client/blob/src/samples/java/com/azure/storage/blob/FileTransferExample.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import com.azure.storage.blob.BlockBlobClient;
5-
import com.azure.storage.blob.ContainerClient;
6-
import com.azure.storage.blob.BlobServiceClient;
7-
import com.azure.storage.blob.BlobServiceClientBuilder;
4+
package com.azure.storage.blob;
5+
86
import com.azure.storage.common.credentials.SharedKeyCredential;
97

108
import java.io.File;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package com.azure.storage.blob;
5+
6+
import java.net.MalformedURLException;
7+
import java.net.URL;
8+
9+
final class JavaDocCodeSnippetsHelpers {
10+
static ContainerAsyncClient getContainerAsyncClient() {
11+
return new ContainerClientBuilder().buildAsyncClient();
12+
}
13+
14+
static BlobAsyncClient getBlobAsyncClient(String blobName) {
15+
return getContainerAsyncClient().getBlobAsyncClient(blobName);
16+
}
17+
18+
static BlobClient getBlobClient(String blobName) {
19+
return new BlobClient(getBlobAsyncClient(blobName));
20+
}
21+
22+
static URL generateURL(String urlString) {
23+
try {
24+
return new URL(urlString);
25+
} catch (MalformedURLException ex) {
26+
throw new RuntimeException(ex);
27+
}
28+
}
29+
}

storage/client/blob/src/samples/java/ListContainersExample.java renamed to storage/client/blob/src/samples/java/com/azure/storage/blob/ListContainersExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import com.azure.storage.blob.BlobServiceClient;
5-
import com.azure.storage.blob.BlobServiceClientBuilder;
4+
package com.azure.storage.blob;
5+
66
import com.azure.storage.common.credentials.SharedKeyCredential;
77

88
import java.util.Locale;

0 commit comments

Comments
 (0)