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 JavaDoc Snippets for BlobClient and BlobAsyncClient #4544

Merged
merged 14 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from 12 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

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.StorageClient;
import com.azure.storage.blob.StorageClientBuilder;

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.StorageClient;
import com.azure.storage.blob.StorageClientBuilder;
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.StorageClient;
import com.azure.storage.blob.StorageClientBuilder;
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.StorageClient;
import com.azure.storage.blob.StorageClientBuilder;
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.StorageClient;
import com.azure.storage.blob.StorageClientBuilder;
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