Skip to content

Commit b507f4a

Browse files
authored
Docs updates (Azure#22453)
* Docs updates * Undo changes to BlobsGetPropertiesHeaders * pr feedback
1 parent 0289af2 commit b507f4a

File tree

10 files changed

+55
-21
lines changed

10 files changed

+55
-21
lines changed

sdk/storage/azure-storage-blob-cryptography/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Unstructured data is data that does not adhere to a particular data model or
66
definition, such as text or binary data.
77
This package supports client side encryption for blob storage.
88

9+
[Source code][source] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] | [Samples][samples]
10+
911
## Getting started
1012

1113
### Prerequisites
@@ -133,18 +135,20 @@ EncryptedBlobClient client = new EncryptedBlobClientBuilder()
133135

134136
Create a `BlobServiceClient` using a connection string.
135137

136-
<!-- embedme ./src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java#L50-L54 -->
138+
<!-- embedme ./src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java#L52-L58 -->
137139
```java
138140
EncryptedBlobClient client = new EncryptedBlobClientBuilder()
139141
.key(key, keyWrapAlgorithm)
140142
.keyResolver(keyResolver)
141143
.connectionString(connectionString)
144+
.containerName(containerName)
145+
.blobName(blobName)
142146
.buildEncryptedBlobClient();
143147
```
144148

145149
### Use a local `KeyEncryptionKey`
146150

147-
<!-- embedme ./src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java#L58-L67 -->
151+
<!-- embedme ./src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java#L62-L73 -->
148152
```java
149153
JsonWebKey localKey = JsonWebKey.fromAes(new SecretKeySpec(keyBytes, secretKeyAlgorithm),
150154
Arrays.asList(KeyOperation.WRAP_KEY, KeyOperation.UNWRAP_KEY))
@@ -154,13 +158,16 @@ AsyncKeyEncryptionKey akek = new KeyEncryptionKeyClientBuilder()
154158

155159
EncryptedBlobClient client = new EncryptedBlobClientBuilder()
156160
.key(akek, keyWrapAlgorithm)
161+
.keyResolver(keyResolver)
157162
.connectionString(connectionString)
163+
.containerName(containerName)
164+
.blobName(blobName)
158165
.buildEncryptedBlobClient();
159166
```
160167

161168
### Use a `KeyVaultKey`
162169

163-
<!-- embedme ./src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java#L71-L86 -->
170+
<!-- embedme ./src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java#L77-L94 -->
164171
```java
165172
KeyClient keyClient = new KeyClientBuilder()
166173
.vaultUrl(keyVaultUrl)
@@ -176,7 +183,10 @@ AsyncKeyEncryptionKey akek = new KeyEncryptionKeyClientBuilder()
176183

177184
EncryptedBlobClient client = new EncryptedBlobClientBuilder()
178185
.key(akek, keyWrapAlgorithm)
186+
.keyResolver(keyResolver)
179187
.connectionString(connectionString)
188+
.containerName(containerName)
189+
.blobName(blobName)
180190
.buildEncryptedBlobClient();
181191
```
182192

@@ -209,6 +219,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
209219
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob-cryptography%2FREADME.png)
210220

211221
[jdk]: https://docs.microsoft.com/java/azure/jdk/
222+
[source]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/storage/azure-storage-blob-cryptography/src
223+
[docs]: https://azure.github.io/azure-sdk-for-java/
224+
[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api
225+
[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview
226+
[samples]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/storage/azure-storage-blob-cryptography/src/samples
212227
[azure_subscription]: https://azure.microsoft.com/free/
213228
[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal
214229
[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli

sdk/storage/azure-storage-blob-cryptography/src/samples/java/com/azure/storage/blob/specialized/cryptography/ReadmeSamples.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class ReadmeSamples {
2929

3030
private BlobClient blobClient;
3131
private String connectionString;
32+
private String containerName;
33+
private String blobName;
3234
private AsyncKeyEncryptionKey key;
3335
private AsyncKeyEncryptionKeyResolver keyResolver;
3436
private String keyWrapAlgorithm;
@@ -51,6 +53,8 @@ public void getEncryptedBlobClient() {
5153
.key(key, keyWrapAlgorithm)
5254
.keyResolver(keyResolver)
5355
.connectionString(connectionString)
56+
.containerName(containerName)
57+
.blobName(blobName)
5458
.buildEncryptedBlobClient();
5559
}
5660

@@ -64,6 +68,8 @@ public void getClientLocalKey() {
6468
EncryptedBlobClient client = new EncryptedBlobClientBuilder()
6569
.key(akek, keyWrapAlgorithm)
6670
.connectionString(connectionString)
71+
.containerName(containerName)
72+
.blobName(blobName)
6773
.buildEncryptedBlobClient();
6874
}
6975

@@ -83,9 +89,9 @@ public void getClientKeyVaultKey() {
8389
EncryptedBlobClient client = new EncryptedBlobClientBuilder()
8490
.key(akek, keyWrapAlgorithm)
8591
.connectionString(connectionString)
92+
.containerName(containerName)
93+
.blobName(blobName)
8694
.buildEncryptedBlobClient();
8795
}
88-
89-
9096
}
9197

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobHttpHeaders.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public BlobHttpHeaders setContentType(String contentType) {
101101

102102
/**
103103
* Get the contentMd5 property: Optional. An MD5 hash of the blob content. Note that this hash is not validated, as
104-
* the hashes for the individual blocks were validated when each was uploaded.
104+
* the hashes for the individual blocks were validated when each was uploaded. The value does not need to be base64
105+
* encoded as the SDK will perform the encoding.
105106
*
106107
* @return the contentMd5 value.
107108
*/
@@ -111,7 +112,8 @@ public byte[] getContentMd5() {
111112

112113
/**
113114
* Set the contentMd5 property: Optional. An MD5 hash of the blob content. Note that this hash is not validated, as
114-
* the hashes for the individual blocks were validated when each was uploaded.
115+
* the hashes for the individual blocks were validated when each was uploaded. The value does not need to be base64
116+
* encoded as the SDK will perform the encoding.
115117
*
116118
* @param contentMd5 the contentMd5 value to set.
117119
* @return the BlobHttpHeaders object itself.

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public final class BlobItem {
6565
private List<ObjectReplicationPolicy> objectReplicationSourcePolicies;
6666

6767
/*
68-
* The isPrefix property.
68+
* The isPrefix property. If blobs are named to mimic a directory hierarchy (i.e. path elements separated by a
69+
* delimiter), this property may be used to determine if the {@code BlobItem} is a virtual directory.
6970
*/
7071
@JsonProperty(value = "IsPrefix")
7172
private Boolean isPrefix;
@@ -254,7 +255,8 @@ public BlobItem setObjectReplicationSourcePolicies(List<ObjectReplicationPolicy>
254255
}
255256

256257
/**
257-
* Get the isPrefix property: The isPrefix property.
258+
* Get the isPrefix property: If blobs are named to mimic a directory hierarchy (i.e. path elements separated by a
259+
* delimiter), this property may be used to determine if the {@code BlobItem} is a virtual directory.
258260
*
259261
* @return the isPrefix value.
260262
*/

sdk/storage/azure-storage-blob/swagger/src/main/java/com/azure/storage/blob/customization/BlobStorageCustomization.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ public void customize(LibraryCustomization customization) {
118118
ClassCustomization blobHttpHeaders = models.getClass("BlobHttpHeaders");
119119
blobHttpHeaders.removeAnnotation("@JacksonXmlRootElement(localName = \"BlobHttpHeaders\")");
120120
blobHttpHeaders.addAnnotation("@JacksonXmlRootElement(localName = \"blob-http-headers\")");
121+
blobHttpHeaders.getMethod("getContentMd5").getJavadoc().setDescription("Get the contentMd5 property: " +
122+
"Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for " +
123+
"the individual blocks were validated when each was uploaded. The value does not need to be base64 " +
124+
"encoded as the SDK will perform the encoding.");
125+
blobHttpHeaders.getMethod("setContentMd5").getJavadoc().setDescription("Set the contentMd5 property: " +
126+
"Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for " +
127+
"the individual blocks were validated when each was uploaded. The value does not need to be base64 " +
128+
"encoded as the SDK will perform the encoding.");
121129

122130
ClassCustomization blobContainerEncryptionScope = models.getClass("BlobContainerEncryptionScope");
123131
blobContainerEncryptionScope.removeAnnotation("@JacksonXmlRootElement(localName = \"BlobContainerEncryptionScope\")");

sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryAsyncClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ public PagedFlux<PathItem> listPaths() {
549549
* If "false", the values will be returned as Azure Active Directory Object IDs.
550550
* The default value is false. Note that group and application Object IDs are not translated because they do not
551551
* have unique friendly names.
552-
* @param maxResults Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the
553-
* request does not specify maxResults or specifies a value greater than 5,000, the server will return up to
554-
* 5,000 items.
552+
* @param maxResults Specifies the maximum number of blobs to return per page, including all BlobPrefix elements. If
553+
* the request does not specify maxResults or specifies a value greater than 5,000, the server will return up to
554+
* 5,000 items per page.
555555
* @return A reactive response emitting the list of files/directories.
556556
*/
557557
@ServiceMethod(returns = ReturnType.COLLECTION)

sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeDirectoryClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,10 @@ public PagedIterable<PathItem> listPaths() {
476476
* If "false", the values will be returned as Azure Active Directory Object IDs.
477477
* The default value is false. Note that group and application Object IDs are not translated because they do not
478478
* have unique friendly names.
479-
* @param maxResults Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the
480-
* request does not specify maxResults or specifies a value greater than 5,000, the server will return up to
481-
* 5,000 items. If iterating by page, the page size passed to byPage methods such as
482-
* * {@link PagedIterable#iterableByPage(int)} will be preferred over this value.
479+
* @param maxResults Specifies the maximum number of blobs to return per page, including all BlobPrefix elements. If
480+
* the request does not specify maxResults or specifies a value greater than 5,000, the server will return up to
481+
* 5,000 items per page. If iterating by page, the page size passed to byPage methods such as
482+
* {@link PagedIterable#iterableByPage(int)} will be preferred over this value.
483483
* @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised.
484484
* @return The list of files/directories.
485485
*/

sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ListPathsOptions.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public ListPathsOptions setUserPrincipalNameReturned(boolean isUserPrincipalName
9898
}
9999

100100
/**
101-
* Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not
102-
* specify maxResults or specifies a value greater than 5,000, the server will return up to 5,000 items.
101+
* Specifies the maximum number of blobs to return per page, including all BlobPrefix elements. If the request does
102+
* not specify maxResults or specifies a value greater than 5,000, the server will return up to 5,000 items per
103+
* page.
103104
*
104105
* @return the number of containers to be returned in a single response
105106
*/

sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareServiceJavaDocCodeSamples.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void createShareWithMetadata() {
115115
ShareServiceClient fileServiceClient = createClientWithSASToken();
116116
// BEGIN: ShareServiceClient.createShareWithResponse#string-map-integer-duration-context
117117
Response<ShareClient> response = fileServiceClient.createShareWithResponse("test",
118-
Collections.singletonMap("share", "metadata"), null, Duration.ofSeconds(1),
118+
Collections.singletonMap("share", "metadata"), null, Duration.ofSeconds(5),
119119
new Context(key1, value1));
120120
System.out.printf("Creating the share completed with status code %d", response.getStatusCode());
121121
// END: ShareServiceClient.createShareWithResponse#string-map-integer-duration-context
@@ -130,7 +130,7 @@ public void createShareWithOptions() {
130130
// BEGIN: ShareServiceClient.createShareWithResponse#String-ShareCreateOptions-Duration-Context
131131
Response<ShareClient> response = fileServiceClient.createShareWithResponse("test",
132132
new ShareCreateOptions().setMetadata(Collections.singletonMap("share", "metadata")).setQuotaInGb(1)
133-
.setAccessTier(ShareAccessTier.HOT), Duration.ofSeconds(1), new Context(key1, value1));
133+
.setAccessTier(ShareAccessTier.HOT), Duration.ofSeconds(5), new Context(key1, value1));
134134
System.out.printf("Creating the share completed with status code %d", response.getStatusCode());
135135
// END: ShareServiceClient.createShareWithResponse#String-ShareCreateOptions-Duration-Context
136136
}

sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/ReadmeSamples.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void getQueueListInAccount() {
131131
// @param options: Filter for queue selection
132132
// @param timeout: An optional timeout applied to the operation.
133133
// @param context: Additional context that is passed through the Http pipeline during the service call.
134-
queueServiceClient.listQueues(markers, options, timeout, context).stream().forEach(queueItem -> {
134+
queueServiceClient.listQueues(options, timeout, context).stream().forEach(queueItem -> {
135135
System.out.printf("Queue %s exists in the account.", queueItem.getName());
136136
});
137137
}

0 commit comments

Comments
 (0)