diff --git a/eng/pipelines/patch-release.yml b/eng/pipelines/patch-release.yml index d9559a5bd3103..458d35d72d9d2 100644 --- a/eng/pipelines/patch-release.yml +++ b/eng/pipelines/patch-release.yml @@ -4,16 +4,42 @@ extends: template: /eng/pipelines/templates/stages/archetype-sdk-client-patch.yml parameters: artifacts: - - name: azure-sdk-template + - name: azure-storage-file-datalake groupId: com.azure - safeName: azuresdktemplate - ServiceDirectory: template - - name: azure-sdk-template-two + safeName: azurestoragefiledatalake + ServiceDirectory: storage + - name: azure-storage-blob-cryptography groupId: com.azure - safeName: azuresdktemplatetwo - ServiceDirectory: template - - name: azure-sdk-template-three + safeName: azurestorageblobcryptography + ServiceDirectory: storage + - name: azure-storage-internal-avro groupId: com.azure - safeName: azuresdktemplatethree - ServiceDirectory: template + safeName: azurestorageinternalavro + skipPublishDocMs: true + skipPublishDocGithubIo: true + ServiceDirectory: storage + - name: azure-storage-queue + groupId: com.azure + safeName: azurestoragequeue + ServiceDirectory: storage + - name: azure-storage-blob + groupId: com.azure + safeName: azurestorageblob + ServiceDirectory: storage + - name: azure-storage-common + groupId: com.azure + safeName: azurestoragecommon + ServiceDirectory: storage + - name: azure-storage-blob-batch + groupId: com.azure + safeName: azurestorageblobbatch + ServiceDirectory: storage + - name: azure-storage-file-share + groupId: com.azure + safeName: azurestoragefileshare + ServiceDirectory: storage + - name: azure-messaging-eventhubs-checkpointstore-blob + groupId: com.azure + safeName: azuremessagingeventhubscheckpointstoreblob + ServiceDirectory: eventhubs diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5d91fecd79163..8730506e7f139 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -153,7 +153,7 @@ com.azure:azure-messaging-eventgrid;4.27.0;4.28.0-beta.1 com.azure:azure-messaging-eventgrid-namespaces;1.1.1;1.2.0-beta.1 com.azure:azure-messaging-eventgrid-cloudnative-cloudevents;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-messaging-eventhubs;5.19.2;5.20.0-beta.1 -com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.20.2;1.21.0-beta.1 +com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.20.2;1.20.3 com.azure:azure-messaging-eventhubs-checkpointstore-jedis;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-messaging-eventhubs-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track2-perf;1.0.0-beta.1;1.0.0-beta.1 @@ -186,17 +186,17 @@ com.azure:azure-security-keyvault-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template;1.1.1234;1.2.2-beta.1 com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template-three;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-blob;12.29.0;12.30.0-beta.1 -com.azure:azure-storage-blob-batch;12.25.0;12.26.0-beta.1 +com.azure:azure-storage-blob;12.29.0;12.29.1 +com.azure:azure-storage-blob-batch;12.25.0;12.25.1 com.azure:azure-storage-blob-changefeed;12.0.0-beta.27;12.0.0-beta.28 -com.azure:azure-storage-blob-cryptography;12.28.0;12.29.0-beta.1 +com.azure:azure-storage-blob-cryptography;12.28.0;12.28.1 com.azure:azure-storage-blob-nio;12.0.0-beta.28;12.0.0-beta.29 -com.azure:azure-storage-common;12.28.0;12.29.0-beta.1 -com.azure:azure-storage-file-share;12.25.1;12.26.0-beta.1 -com.azure:azure-storage-file-datalake;12.22.0;12.23.0-beta.1 -com.azure:azure-storage-internal-avro;12.14.0;12.15.0-beta.1 +com.azure:azure-storage-common;12.28.0;12.28.1 +com.azure:azure-storage-file-share;12.25.1;12.25.2 +com.azure:azure-storage-file-datalake;12.22.0;12.22.1 +com.azure:azure-storage-internal-avro;12.14.0;12.14.1 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-queue;12.24.0;12.25.0-beta.1 +com.azure:azure-storage-queue;12.24.0;12.24.1 com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-template-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-verticals-agrifood-farming;1.0.0-beta.3;1.0.0-beta.4 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md index ef0ad7d5d02b1..5550e923fdcab 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md @@ -1,14 +1,13 @@ # Release History -## 1.21.0-beta.1 (Unreleased) +## 1.20.3 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-messaging-eventhubs` from `5.19.2` to version `5.20.0-beta.1`. -### Other Changes ## 1.20.2 (2024-12-04) @@ -19,6 +18,7 @@ - Upgraded `azure-storage-blob` from `12.28.1` to version `12.29.0`. - Upgraded `azure-messaging-eventhubs` from `5.19.1` to version `5.20.0-beta.1`. + ## 1.20.1 (2024-10-27) ### Other Changes diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md index 6f086680ea854..1d9395c15f9ed 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md @@ -60,7 +60,7 @@ add the direct dependency to your project as follows. com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.20.0 + 1.20.3 ``` [//]: # ({x-version-update-end}) @@ -181,10 +181,10 @@ Guidelines](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/ [api_documentation]: https://azure.github.io/azure-sdk-for-java -[event_hubs_create]: https://learn.microsoft.com/azure/event-hubs/event-hubs-create -[event_hubs_product_docs]: https://learn.microsoft.com/azure/event-hubs/ +[event_hubs_create]: https://docs.microsoft.com/azure/event-hubs/event-hubs-create +[event_hubs_product_docs]: https://docs.microsoft.com/azure/event-hubs/ [java_8_sdk_javadocs]: https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html -[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable +[jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable [logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK [maven]: https://maven.apache.org/ [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning @@ -195,11 +195,11 @@ Guidelines](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/ [sample_event_processor]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/samples/java/com/azure/messaging/eventhubs/checkpointstore/blob/EventProcessorBlobCheckpointStoreSample.java [sample_checkpointstore_custom_storage_version]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/samples/java/com/azure/messaging/eventhubs/checkpointstore/blob/EventProcessorWithCustomStorageVersion.java [sample_examples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/samples/java/com/azure/messaging/eventhubs/checkpointstore/blob -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 [source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/ [source_eventprocessorclient]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventProcessorClient.java [source_blobcheckpointstore]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/main/java/com/azure/messaging/eventhubs/checkpointstore/blob/BlobCheckpointStore.java [source_loglevels]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/.https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Feventhubs%2Fazure-messaging-eventhubs-checkpointstore-blob%2FREADME.png) diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index deba90676c053..669ced431fb9b 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -17,7 +17,7 @@ com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.21.0-beta.1 + 1.20.3 Microsoft Azure client library for storing checkpoints in Storage Blobs Library for using storing checkpoints in Storage Blobs @@ -67,6 +67,12 @@ azure-core-test 1.27.0-beta.4 test + + + com.azure + azure-core-http-jdk-httpclient + + com.azure @@ -95,4 +101,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.19 + test + + + + diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/test/java/com/azure/messaging/eventhubs/checkpointstore/blob/BlobCheckpointStoreTests.java b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/test/java/com/azure/messaging/eventhubs/checkpointstore/blob/BlobCheckpointStoreTests.java index 5d0c3cc69e55b..49815f731af76 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/test/java/com/azure/messaging/eventhubs/checkpointstore/blob/BlobCheckpointStoreTests.java +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/src/test/java/com/azure/messaging/eventhubs/checkpointstore/blob/BlobCheckpointStoreTests.java @@ -22,8 +22,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnJre; -import org.junit.jupiter.api.condition.JRE; import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.Mockito; @@ -58,7 +56,6 @@ /** * Unit tests for {@link BlobCheckpointStore}. */ -@DisabledOnJre(JRE.JAVA_8) public class BlobCheckpointStoreTests { @Mock diff --git a/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml index c3296f8c962a7..289af5bad4349 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml @@ -48,7 +48,7 @@ com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.21.0-beta.1 + 1.20.3 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml index 463a23ea1db53..3d6bb2a38d34a 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml @@ -29,7 +29,7 @@ com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.21.0-beta.1 + 1.20.3 com.azure diff --git a/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml index bad1eede4b07d..e3a84d399550d 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml @@ -20,7 +20,7 @@ com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.21.0-beta.1 + 1.20.3 io.projectreactor diff --git a/sdk/storage/azure-storage-blob-batch/CHANGELOG.md b/sdk/storage/azure-storage-blob-batch/CHANGELOG.md index 0d29574139296..dd65476bddeba 100644 --- a/sdk/storage/azure-storage-blob-batch/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-batch/CHANGELOG.md @@ -1,14 +1,15 @@ # Release History -## 12.26.0-beta.1 (Unreleased) +## 12.25.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-storage-blob` from `12.29.0` to version `12.29.1`. +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. -### Other Changes ## 12.25.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-blob-batch/README.md b/sdk/storage/azure-storage-blob-batch/README.md index f8d651b9d385a..e4cc72503463c 100644 --- a/sdk/storage/azure-storage-blob-batch/README.md +++ b/sdk/storage/azure-storage-blob-batch/README.md @@ -56,7 +56,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-blob-batch - 12.25.0 + 12.25.1 ``` [//]: # ({x-version-update-end}) @@ -196,16 +196,16 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope [source]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-batch/src/main/java [docs]: https://azure.github.io/azure-sdk-for-java/ -[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview [samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-batch/src/samples -[jdk]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable +[jdk]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_portal]: https://learn.microsoft.com/azure/storage/common/storage-account-create?tabs=azure-portal -[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_portal]: https://docs.microsoft.com/azure/storage/common/storage-account-create?tabs=azure-portal +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli [blob_service_client]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-blob#create-a-storage-account -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes [blob_samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-batch/src/samples/README.md [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/storage/azure-storage-blob-batch/pom.xml b/sdk/storage/azure-storage-blob-batch/pom.xml index a5b1d8cf6a28b..9bed1afd5c603 100644 --- a/sdk/storage/azure-storage-blob-batch/pom.xml +++ b/sdk/storage/azure-storage-blob-batch/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob-batch - 12.26.0-beta.1 + 12.25.1 Microsoft Azure client library for Blob Storage batching This module contains client library for Microsoft Azure Blob Storage batching. @@ -49,6 +49,7 @@ false spotbugs-exclude.xml + - @@ -70,7 +71,7 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-blob-batch/src/main/java/com/azure/storage/blob/batch/options/BlobBatchSetBlobAccessTierOptions.java b/sdk/storage/azure-storage-blob-batch/src/main/java/com/azure/storage/blob/batch/options/BlobBatchSetBlobAccessTierOptions.java index c5be9d7549c22..c0b906dcfbc7c 100644 --- a/sdk/storage/azure-storage-blob-batch/src/main/java/com/azure/storage/blob/batch/options/BlobBatchSetBlobAccessTierOptions.java +++ b/sdk/storage/azure-storage-blob-batch/src/main/java/com/azure/storage/blob/batch/options/BlobBatchSetBlobAccessTierOptions.java @@ -16,6 +16,7 @@ */ @Fluent public class BlobBatchSetBlobAccessTierOptions { + private static final ClientLogger LOGGER = new ClientLogger(BlobBatchSetBlobAccessTierOptions.class); private final BlobUrlParts blobUrlParts; @@ -25,11 +26,8 @@ public class BlobBatchSetBlobAccessTierOptions { private String tagsConditions; /** - * Creates a new instance of {@link BlobBatchSetBlobAccessTierOptions}. - * * @param blobUrl Url of the blob to set access tier. Blob names must be encoded to UTF-8. * @param tier {@link AccessTier} to set on each blob. - * @throws NullPointerException If {@code blobUrl} or {@code tier} is null. */ public BlobBatchSetBlobAccessTierOptions(String blobUrl, AccessTier tier) { StorageImplUtils.assertNotNull("blobUrl", blobUrl); @@ -39,12 +37,9 @@ public BlobBatchSetBlobAccessTierOptions(String blobUrl, AccessTier tier) { } /** - * Creates a new instance of {@link BlobBatchSetBlobAccessTierOptions}. - * * @param containerName Name of the container to set access tier. * @param blobName Name of the blob to set access tier. Blob names must be encoded to UTF-8. * @param tier {@link AccessTier} to set on each blob. - * @throws NullPointerException If {@code containerName}, {@code blobName}, or {@code tier} is null. */ public BlobBatchSetBlobAccessTierOptions(String containerName, String blobName, AccessTier tier) { StorageImplUtils.assertNotNull("containerName", containerName); @@ -57,8 +52,6 @@ public BlobBatchSetBlobAccessTierOptions(String containerName, String blobName, } /** - * Get the URL of the blob to set its access tier. - * * @return Url of the blob to set its access tier. */ public String getBlobUrl() { @@ -66,8 +59,6 @@ public String getBlobUrl() { } /** - * Gets the container name of the blob to set its access tier. - * * @return Container of the blob to set its access tier. */ public String getBlobContainerName() { @@ -75,8 +66,6 @@ public String getBlobContainerName() { } /** - * Gets the name of the blob to set its access tier. - * * @return Name of the blob to set its access tier. */ public String getBlobName() { @@ -84,8 +73,6 @@ public String getBlobName() { } /** - * Gets the identifier of the blob to set its access tier. - * * @return Identifier of the blob to set its access tier. */ public String getBlobIdentifier() { @@ -107,8 +94,6 @@ public String getBlobIdentifier() { } /** - * Gets the version id of the blob to set its access tier. - * * @return Version id of the blob to set its access tier. */ public String getVersionId() { @@ -116,8 +101,6 @@ public String getVersionId() { } /** - * Sets the version id of the blob to set its access tier. - * * @param versionId Version id of the blob to set its access tier. * @return The updated BlobBatchSetBlobsAccessTierOptions. */ @@ -127,8 +110,6 @@ public BlobBatchSetBlobAccessTierOptions setVersionId(String versionId) { } /** - * Gets the snapshot of the blob to set its access tier. - * * @return Snapshot of the blob to set its access tier. */ public String getSnapshot() { @@ -136,8 +117,6 @@ public String getSnapshot() { } /** - * Sets the snapshot of the blob to set its access tier. - * * @param snapshot Snapshot of the blob to set its access tier. * @return The updated BlobBatchSetBlobsAccessTierOptions. */ @@ -147,8 +126,6 @@ public BlobBatchSetBlobAccessTierOptions setSnapshot(String snapshot) { } /** - * Gets the tier to set for the blob. - * * @return The new tier for the blob. */ public AccessTier getTier() { @@ -156,8 +133,6 @@ public AccessTier getTier() { } /** - * Gets the priority to set for re-hydrating blob. - * * @return Priority to set for re-hydrating blob. */ public RehydratePriority getPriority() { @@ -165,8 +140,6 @@ public RehydratePriority getPriority() { } /** - * Sets the priority to set for re-hydrating blob. - * * @param priority Priority to set for re-hydrating blob. * @return The updated BlobBatchSetBlobsAccessTierOptions. */ @@ -176,8 +149,6 @@ public BlobBatchSetBlobAccessTierOptions setPriority(RehydratePriority priority) } /** - * Gets the lease ID the active lease on the blob must match. - * * @return The lease ID the active lease on the blob must match. */ public String getLeaseId() { @@ -185,8 +156,6 @@ public String getLeaseId() { } /** - * Sets the lease ID the active lease on the blobs must match. - * * @param leaseId The lease ID the active lease on the blobs must match. * @return The updated BlobBatchSetBlobsAccessTierOptions. */ @@ -196,8 +165,6 @@ public BlobBatchSetBlobAccessTierOptions setLeaseId(String leaseId) { } /** - * Gets the SQL statement that apply to the tags of the blob. - * * @return The SQL statement that apply to the tags of the blob. */ public String getTagsConditions() { @@ -205,8 +172,6 @@ public String getTagsConditions() { } /** - * Sets the SQL statement that apply to the tags of the blob. - * * @param tagsConditions The SQL statement that apply to the tags of the blob. * @return The updated BlobBatchSetBlobsAccessTierOptions. */ diff --git a/sdk/storage/azure-storage-blob-batch/src/samples/README.md b/sdk/storage/azure-storage-blob-batch/src/samples/README.md index ca869dca1ee98..cdae701605fc9 100644 --- a/sdk/storage/azure-storage-blob-batch/src/samples/README.md +++ b/sdk/storage/azure-storage-blob-batch/src/samples/README.md @@ -48,7 +48,7 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [BATCH_SDK_README]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-batch/README.md [SDK_README_CONTRIBUTING]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-batch/README.md#contributing [samples_basic]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-batch/src/samples/java/com/azure/storage/blob/batch/ReadmeSamples.java -[storageblob_rest]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[storageblob_rest]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob-batch%2Fsrc%2Fsamples%2FREADME.png) diff --git a/sdk/storage/azure-storage-blob-changefeed/pom.xml b/sdk/storage/azure-storage-blob-changefeed/pom.xml index 7de70e9891a23..f9064795db95d 100644 --- a/sdk/storage/azure-storage-blob-changefeed/pom.xml +++ b/sdk/storage/azure-storage-blob-changefeed/pom.xml @@ -82,7 +82,7 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md b/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md index 04c3d7520adb0..49c00230a01e3 100644 --- a/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md @@ -1,14 +1,15 @@ # Release History -## 12.29.0-beta.1 (Unreleased) +## 12.28.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-storage-blob` from `12.29.0` to version `12.30.0-beta.1`. -### Other Changes ## 12.28.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-blob-cryptography/README.md b/sdk/storage/azure-storage-blob-cryptography/README.md index 0567921c12d10..485e9aaa714e4 100644 --- a/sdk/storage/azure-storage-blob-cryptography/README.md +++ b/sdk/storage/azure-storage-blob-cryptography/README.md @@ -58,7 +58,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-blob-cryptography - 12.28.0 + 12.28.1 ``` [//]: # ({x-version-update-end}) @@ -247,21 +247,21 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob-cryptography%2FREADME.png) -[jdk]: https://learn.microsoft.com/java/azure/jdk/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ [source]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-cryptography/src [docs]: https://azure.github.io/azure-sdk-for-java/ -[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview [samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob-cryptography/src/samples [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 [source]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/storage/azure-storage-blob-cryptography/src/main/java [docs]: https://azure.github.io/azure-sdk-for-java/ -[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview [samples]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/storage/azure-storage-blob-cryptography/src/samples -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning diff --git a/sdk/storage/azure-storage-blob-cryptography/assets.json b/sdk/storage/azure-storage-blob-cryptography/assets.json index 35c0ddf9061ea..5660ada3bfc97 100644 --- a/sdk/storage/azure-storage-blob-cryptography/assets.json +++ b/sdk/storage/azure-storage-blob-cryptography/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/storage/azure-storage-blob-cryptography", - "Tag": "java/storage/azure-storage-blob-cryptography_711783cf82" + "Tag": "java/storage/azure-storage-blob-cryptography_1e962e6002" } diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index 52d2dc430ec7d..cb806f8660e75 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob-cryptography - 12.29.0-beta.1 + 12.28.1 Microsoft Azure client library for Blob Storage cryptography This module contains client library for Microsoft Azure Blob Storage cryptography. @@ -50,6 +50,7 @@ false spotbugs-exclude.xml + - @@ -76,13 +77,13 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/BlobClientSideEncryptionOptions.java b/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/BlobClientSideEncryptionOptions.java index 54103cf94e09a..15d31eca2c821 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/BlobClientSideEncryptionOptions.java +++ b/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/BlobClientSideEncryptionOptions.java @@ -15,12 +15,6 @@ public class BlobClientSideEncryptionOptions { // default value for authenticatedRegionDataLength is 4MB private long authenticatedRegionDataLength = GCM_ENCRYPTION_REGION_LENGTH; - /** - * Creates a new instance of {@link BlobClientSideEncryptionOptions}. - */ - public BlobClientSideEncryptionOptions() { - } - /** * Gets the length of the authenticated region data. * @return the length of the authenticated region data. diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml index 57f44b73fd7b4..a7f1f2b5e0249 100644 --- a/sdk/storage/azure-storage-blob-nio/pom.xml +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -68,13 +68,13 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-blob-stress/pom.xml b/sdk/storage/azure-storage-blob-stress/pom.xml index 2a7d11f1cad0f..86b07bea354f4 100644 --- a/sdk/storage/azure-storage-blob-stress/pom.xml +++ b/sdk/storage/azure-storage-blob-stress/pom.xml @@ -40,7 +40,7 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 com.azure diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 14c697cad9c84..5d6f8f94e01d8 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,14 +1,16 @@ # Release History -## 12.30.0-beta.1 (Unreleased) +## 12.29.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-storage-internal-avro` from `12.14.0` to version `12.14.1`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-storage-common` from `12.28.0` to version `12.29.0-beta.1`. -### Other Changes ## 12.29.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index d81e456ebaaae..bb7e98b450120 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -56,7 +56,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-blob - 12.29.0 + 12.29.1 ``` [//]: # ({x-version-update-end}) @@ -611,16 +611,16 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [source]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src [samples_readme]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/samples/README.md [docs]: https://azure.github.io/azure-sdk-for-java/ -[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api -[product_docs]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 -[jdk]: https://learn.microsoft.com/java/azure/jdk/ +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/README.md -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/samples [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ diff --git a/sdk/storage/azure-storage-blob/assets.json b/sdk/storage/azure-storage-blob/assets.json index 3c9c429e8a829..eb1c45e022b4b 100644 --- a/sdk/storage/azure-storage-blob/assets.json +++ b/sdk/storage/azure-storage-blob/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/storage/azure-storage-blob", - "Tag": "java/storage/azure-storage-blob_f223d6f99b" + "Tag": "java/storage/azure-storage-blob_4863e111dc" } diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index d6207e092e7ca..15c8a882bb566 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 Microsoft Azure client library for Blob Storage This module contains client library for Microsoft Azure Blob Storage. @@ -64,6 +64,7 @@ false spotbugs-exclude.xml + - @@ -85,12 +86,12 @@ com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 com.azure azure-storage-internal-avro - 12.15.0-beta.1 + 12.14.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java index 66731774d9e00..c97d851b57940 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java @@ -103,9 +103,6 @@ public BlobServiceClientBuilder() { } /** - * Creates a {@link BlobServiceClient} based on options set in the builder. Every time {@code buildClient()} is - * called, a new instance of {@link BlobServiceClient} is created. - * * @return a {@link BlobServiceClient} created from the configurations in this builder. * @throws IllegalArgumentException If no credentials are provided. * @throws IllegalStateException If multiple credentials have been specified. @@ -155,9 +152,6 @@ private HttpPipeline constructPipeline() { } /** - * Creates a {@link BlobServiceAsyncClient} based on options set in the builder. Every time - * {@code buildAsyncClient()} is called, a new instance of {@link BlobServiceAsyncClient} is created. - * * @return a {@link BlobServiceAsyncClient} created from the configurations in this builder. * @throws IllegalArgumentException If no credentials are provided. * @throws IllegalStateException If multiple credentials have been specified. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/HttpGetterInfo.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/HttpGetterInfo.java index ba677659dba20..9c0fa81cf2577 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/HttpGetterInfo.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/HttpGetterInfo.java @@ -15,18 +15,12 @@ */ public final class HttpGetterInfo { private long offset = 0; + private Long count = null; - private String eTag = null; - /** - * Creates a new instance of {@link HttpGetterInfo}. - */ - public HttpGetterInfo() { - } + private String eTag = null; /** - * Gets the start offset that is used when creating the Range header. If unchanged this will default to 0. - * * @return the start offset used when creating the Range header. Defaults to 0. */ public long getOffset() { @@ -45,19 +39,16 @@ public HttpGetterInfo setOffset(long offset) { } /** - * Gets the count of bytes used to calculate the end offset when creating the Range header. null is the default and - * indicates that the entire rest of the blob should be retrieved. - * - * @return the count of bytes used to calculate the end offset when creating the Range header. null is the default - * and indicates that the entire rest of the blob should be retrieved. + * @return the count of bytes used to calculate the end offset when creating the Range header. {@code} null is the + * default and indicates that the entire rest of the blob should be retrieved. */ public Long getCount() { return count; } /** - * Sets the count of bytes used to calculate the end offset when creating the Range header. null is the default and - * indicates that the entire rest of the blob should be retrieved. + * Sets the count of bytes used to calculate the end offset when creating the Range header. {@code} null is the + * default and indicates that the entire rest of the blob should be retrieved. * * @param count Count of bytes * @return the updated HttpGetterInfo object @@ -71,15 +62,9 @@ public HttpGetterInfo setCount(Long count) { } /** - * Gets the eTag used when creating If-Match header. eTag is returned with any operation that modifies the resource - * and when retrieving - * {@link BlobClient#getPropertiesWithResponse(BlobRequestConditions, Duration, Context) properties}. Defaults to - * null. - * * @return the eTag used when creating If-Match header. eTag is returned with any operation that modifies the - * resource and when retrieving - * {@link BlobClient#getPropertiesWithResponse(BlobRequestConditions, Duration, Context) properties}. Defaults to - * null. + * resource and when retrieving {@link BlobClient#getPropertiesWithResponse(BlobRequestConditions, Duration, + * Context) properties}. Defaults to null. */ public String getETag() { return eTag; @@ -87,9 +72,8 @@ public String getETag() { /** * Sets the eTag used when creating If-Match header. eTag is returned with any operation that modifies the resource - * and when retrieving - * {@link BlobClient#getPropertiesWithResponse(BlobRequestConditions, Duration, Context) properties}. Defaults to - * null. + * and when retrieving {@link BlobClient#getPropertiesWithResponse(BlobRequestConditions, Duration, Context) + * properties}. Defaults to null. * * @param eTag Resource's eTag * @return the updated HttpGetterInfo object diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ProgressReporter.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ProgressReporter.java index 7ea4ced7c0ebb..60d8698b7c539 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ProgressReporter.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/ProgressReporter.java @@ -17,12 +17,6 @@ @Deprecated public final class ProgressReporter { - /** - * Creates a new instance of {@link ProgressReporter}. - */ - public ProgressReporter() { - } - private abstract static class ProgressReporterImpl implements ProgressReceiver { long blockProgress; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobFlatListSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobFlatListSegment.java index 61e3c970a95f9..e81eb6d3082e1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobFlatListSegment.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobFlatListSegment.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation.models; import com.azure.core.annotation.Fluent; @@ -20,6 +19,7 @@ */ @Fluent public final class BlobFlatListSegment implements XmlSerializable { + /* * The BlobItems property. */ @@ -33,7 +33,7 @@ public BlobFlatListSegment() { /** * Get the blobItems property: The BlobItems property. - * + * * @return the blobItems value. */ public List getBlobItems() { @@ -42,7 +42,7 @@ public List getBlobItems() { /** * Set the blobItems property: The BlobItems property. - * + * * @param blobItems the blobItems value to set. * @return the BlobFlatListSegment object itself. */ @@ -70,7 +70,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of BlobFlatListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of BlobFlatListSegment if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -82,7 +82,7 @@ public static BlobFlatListSegment fromXml(XmlReader xmlReader) throws XMLStreamE /** * Reads an instance of BlobFlatListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -96,14 +96,15 @@ public static BlobFlatListSegment fromXml(XmlReader xmlReader, String rootElemen BlobFlatListSegment deserializedBlobFlatListSegment = new BlobFlatListSegment(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Blob".equals(elementName.getLocalPart())) { + if (deserializedBlobFlatListSegment.blobItems == null) { + deserializedBlobFlatListSegment.blobItems = new ArrayList<>(); + } deserializedBlobFlatListSegment.blobItems.add(BlobItemInternal.fromXml(reader, "Blob")); } else { reader.skipElement(); } } - return deserializedBlobFlatListSegment; }); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java index bf9bf05b8dfd7..03a3c9b1e051c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.blob.implementation.models; import com.azure.core.annotation.Fluent; @@ -20,6 +19,7 @@ */ @Fluent public final class BlobHierarchyListSegment implements XmlSerializable { + /* * The BlobPrefixes property. */ @@ -38,7 +38,7 @@ public BlobHierarchyListSegment() { /** * Get the blobPrefixes property: The BlobPrefixes property. - * + * * @return the blobPrefixes value. */ public List getBlobPrefixes() { @@ -47,7 +47,7 @@ public List getBlobPrefixes() { /** * Set the blobPrefixes property: The BlobPrefixes property. - * + * * @param blobPrefixes the blobPrefixes value to set. * @return the BlobHierarchyListSegment object itself. */ @@ -58,7 +58,7 @@ public BlobHierarchyListSegment setBlobPrefixes(List blobPre /** * Get the blobItems property: The BlobItems property. - * + * * @return the blobItems value. */ public List getBlobItems() { @@ -67,7 +67,7 @@ public List getBlobItems() { /** * Set the blobItems property: The BlobItems property. - * + * * @param blobItems the blobItems value to set. * @return the BlobHierarchyListSegment object itself. */ @@ -100,7 +100,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of BlobHierarchyListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of BlobHierarchyListSegment if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. @@ -112,7 +112,7 @@ public static BlobHierarchyListSegment fromXml(XmlReader xmlReader) throws XMLSt /** * Reads an instance of BlobHierarchyListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -127,17 +127,21 @@ public static BlobHierarchyListSegment fromXml(XmlReader xmlReader, String rootE BlobHierarchyListSegment deserializedBlobHierarchyListSegment = new BlobHierarchyListSegment(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("BlobPrefix".equals(elementName.getLocalPart())) { + if (deserializedBlobHierarchyListSegment.blobPrefixes == null) { + deserializedBlobHierarchyListSegment.blobPrefixes = new ArrayList<>(); + } deserializedBlobHierarchyListSegment.blobPrefixes .add(BlobPrefixInternal.fromXml(reader, "BlobPrefix")); } else if ("Blob".equals(elementName.getLocalPart())) { + if (deserializedBlobHierarchyListSegment.blobItems == null) { + deserializedBlobHierarchyListSegment.blobItems = new ArrayList<>(); + } deserializedBlobHierarchyListSegment.blobItems.add(BlobItemInternal.fromXml(reader, "Blob")); } else { reader.skipElement(); } } - return deserializedBlobHierarchyListSegment; }); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsDownloadHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsDownloadHeaders.java index 62a866f505bf2..382bfc5cf0018 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsDownloadHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsDownloadHeaders.java @@ -17,7 +17,7 @@ import com.azure.storage.blob.models.LeaseStatusType; import java.time.OffsetDateTime; import java.util.Base64; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -443,8 +443,8 @@ public BlobsDownloadHeaders(HttpHeaders rawHeaders) { this.contentLanguage = rawHeaders.getValue(HttpHeaderName.CONTENT_LANGUAGE); this.xMsClientRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_CLIENT_REQUEST_ID); this.xMsEncryptionScope = rawHeaders.getValue(X_MS_ENCRYPTION_SCOPE); - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); - Map xMsOrHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); + Map xMsOrHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetPropertiesHeaders.java index 1baedc1a91de1..1a6853f096951 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetPropertiesHeaders.java @@ -18,7 +18,7 @@ import com.azure.storage.blob.models.LeaseStatusType; import java.time.OffsetDateTime; import java.util.Base64; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -478,8 +478,8 @@ public BlobsGetPropertiesHeaders(HttpHeaders rawHeaders) { this.xMsCopyStatus = CopyStatusType.fromString(xMsCopyStatus); } this.xMsArchiveStatus = rawHeaders.getValue(X_MS_ARCHIVE_STATUS); - Map xMsOrHeaderCollection = new LinkedHashMap<>(); - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsOrHeaderCollection = new HashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsQueryHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsQueryHeaders.java index 3a976acbc4b37..7ef9d33b079ef 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsQueryHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsQueryHeaders.java @@ -17,7 +17,7 @@ import com.azure.storage.blob.models.LeaseStatusType; import java.time.OffsetDateTime; import java.util.Base64; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -315,7 +315,7 @@ public BlobsQueryHeaders(HttpHeaders rawHeaders) { this.contentLanguage = rawHeaders.getValue(HttpHeaderName.CONTENT_LANGUAGE); this.xMsClientRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_CLIENT_REQUEST_ID); this.xMsEncryptionScope = rawHeaders.getValue(X_MS_ENCRYPTION_SCOPE); - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java index 1fa24cb6d6d24..58d2d7bbb6236 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java @@ -14,7 +14,7 @@ import com.azure.storage.blob.models.LeaseStatusType; import com.azure.storage.blob.models.PublicAccessType; import java.time.OffsetDateTime; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -180,7 +180,7 @@ public ContainersGetPropertiesHeaders(HttpHeaders rawHeaders) { } this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); this.xMsClientRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_CLIENT_REQUEST_ID); - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryRequest.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryRequest.java index 5ac5a8f5e87d3..3f516cc5dc0fc 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryRequest.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryRequest.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.storage.blob.implementation.models; import com.azure.core.annotation.Fluent; @@ -17,7 +18,6 @@ */ @Fluent public final class QueryRequest implements XmlSerializable { - /* * Required. The type of the provided query expression. */ @@ -46,16 +46,27 @@ public QueryRequest() { /** * Get the queryType property: Required. The type of the provided query expression. - * + * * @return the queryType value. */ public String getQueryType() { return this.queryType; } + /** + * Set the queryType property: Required. The type of the provided query expression. + * + * @param queryType the queryType value to set. + * @return the QueryRequest object itself. + */ + public QueryRequest setQueryType(String queryType) { + this.queryType = queryType; + return this; + } + /** * Get the expression property: The query expression in SQL. The maximum size of the query expression is 256KiB. - * + * * @return the expression value. */ public String getExpression() { @@ -64,7 +75,7 @@ public String getExpression() { /** * Set the expression property: The query expression in SQL. The maximum size of the query expression is 256KiB. - * + * * @param expression the expression value to set. * @return the QueryRequest object itself. */ @@ -75,7 +86,7 @@ public QueryRequest setExpression(String expression) { /** * Get the inputSerialization property: The InputSerialization property. - * + * * @return the inputSerialization value. */ public QuerySerialization getInputSerialization() { @@ -84,7 +95,7 @@ public QuerySerialization getInputSerialization() { /** * Set the inputSerialization property: The InputSerialization property. - * + * * @param inputSerialization the inputSerialization value to set. * @return the QueryRequest object itself. */ @@ -95,7 +106,7 @@ public QueryRequest setInputSerialization(QuerySerialization inputSerialization) /** * Get the outputSerialization property: The OutputSerialization property. - * + * * @return the outputSerialization value. */ public QuerySerialization getOutputSerialization() { @@ -104,7 +115,7 @@ public QuerySerialization getOutputSerialization() { /** * Set the outputSerialization property: The OutputSerialization property. - * + * * @param outputSerialization the outputSerialization value to set. * @return the QueryRequest object itself. */ @@ -131,7 +142,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of QueryRequest from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of QueryRequest if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -143,7 +154,7 @@ public static QueryRequest fromXml(XmlReader xmlReader) throws XMLStreamExceptio /** * Reads an instance of QueryRequest from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -157,6 +168,7 @@ public static QueryRequest fromXml(XmlReader xmlReader, String rootElementName) QueryRequest deserializedQueryRequest = new QueryRequest(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); + if ("QueryType".equals(elementName.getLocalPart())) { deserializedQueryRequest.queryType = reader.getStringElement(); } else if ("Expression".equals(elementName.getLocalPart())) { @@ -171,18 +183,8 @@ public static QueryRequest fromXml(XmlReader xmlReader, String rootElementName) reader.skipElement(); } } + return deserializedQueryRequest; }); } - - /** - * Set the queryType property: Required. The type of the provided query expression. - * - * @param queryType the queryType value to set. - * @return the QueryRequest object itself. - */ - public QueryRequest setQueryType(String queryType) { - this.queryType = queryType; - return this; - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobItem.java index 8acbf7de2813f..fee462d2bdabb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobItem.java @@ -88,8 +88,6 @@ public AppendBlobItem(final String eTag, final OffsetDateTime lastModified, fina } /** - * Gets the eTag of the append blob. - * * @return the eTag of the append blob */ public String getETag() { @@ -97,8 +95,6 @@ public String getETag() { } /** - * Gets the time this append blob was last modified. - * * @return the time this append blob was last modified */ public OffsetDateTime getLastModified() { @@ -106,8 +102,6 @@ public OffsetDateTime getLastModified() { }; /** - * Gets the encryption status of the append blob on the server. - * * @return the encryption status of the append blob on the server */ public boolean isServerEncrypted() { @@ -115,8 +109,6 @@ public boolean isServerEncrypted() { } /** - * Gets the key that was used to encrypt the append blob. - * * @return the key that was used to encrypt the append blob */ public String getEncryptionKeySha256() { @@ -124,8 +116,6 @@ public String getEncryptionKeySha256() { } /** - * Gets the encryption scope that was used to encrypt the append blob. - * * @return the encryption scope that was used to encrypt the append blob */ public String getEncryptionScope() { @@ -133,8 +123,6 @@ public String getEncryptionScope() { } /** - * Gets the calculated MD5 of the append blob. - * * @return the calculated MD5 of the append blob */ public byte[] getContentMd5() { @@ -142,8 +130,6 @@ public byte[] getContentMd5() { } /** - * Gets the offset of the append blob. - * * @return the offset of the append blob */ public String getBlobAppendOffset() { @@ -151,8 +137,6 @@ public String getBlobAppendOffset() { } /** - * Gets the number of committed blocks in the append blob. - * * @return the number of committed blocks in the append blob */ public Integer getBlobCommittedBlockCount() { @@ -160,8 +144,6 @@ public Integer getBlobCommittedBlockCount() { } /** - * Gets the version identifier of the append blob. - * * @return the version identifier of the append blob */ public String getVersionId() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobRequestConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobRequestConditions.java index dbec22904040b..0d659222fe2d0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobRequestConditions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AppendBlobRequestConditions.java @@ -20,12 +20,6 @@ public final class AppendBlobRequestConditions extends BlobRequestConditions { private Long maxSize; private Long appendPosition; - /** - * Creates a new instance of {@link AppendBlobRequestConditions}. - */ - public AppendBlobRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAudience.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAudience.java index 296201bcb4097..c2c7188043d6f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAudience.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobAudience.java @@ -57,8 +57,6 @@ public static BlobAudience fromString(String audience) { } /** - * Get the known BlobAudience values. - * * @return known BlobAudience values. */ public static Collection values() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBeginCopySourceRequestConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBeginCopySourceRequestConditions.java index 5cdaeeb5cbeaa..1db939674849b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBeginCopySourceRequestConditions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobBeginCopySourceRequestConditions.java @@ -16,12 +16,6 @@ public class BlobBeginCopySourceRequestConditions extends RequestConditions { private String tagsConditions; - /** - * Creates a new instance of {@link BlobBeginCopySourceRequestConditions}. - */ - public BlobBeginCopySourceRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerAccessPolicies.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerAccessPolicies.java index ec800a3daefa1..0e07274bc6c63 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerAccessPolicies.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerAccessPolicies.java @@ -27,8 +27,6 @@ public BlobContainerAccessPolicies(PublicAccessType blobAccessType, List getIdentifiers() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerListDetails.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerListDetails.java index 8ea187737d44f..7514e309a1e14 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerListDetails.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerListDetails.java @@ -84,8 +84,6 @@ public BlobContainerListDetails setRetrieveSystemContainers(boolean retrieveSyst } /** - * Gets the listing flags. - * * @return the listing flags * @deprecated {@link BlobContainerListDetails} now contains multiple options. * This will only convert result of {{@link #setRetrieveMetadata(boolean)}} for backwards compatibility. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java index 5302d4098fde0..fac2cefd6c366 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerProperties.java @@ -109,8 +109,6 @@ public BlobContainerProperties(final Map metadata, final String } /** - * Gets the metadata associated with the container. - * * @return the metadata associated with the container */ public Map getMetadata() { @@ -118,8 +116,6 @@ public Map getMetadata() { } /** - * Gets the eTag of the container. - * * @return the eTag of the container */ public String getETag() { @@ -127,8 +123,6 @@ public String getETag() { } /** - * Gets the time the container was last modified. - * * @return the time the container was last modified */ public OffsetDateTime getLastModified() { @@ -136,8 +130,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the type of lease on the container. - * * @return the type of lease on the container */ public LeaseDurationType getLeaseDuration() { @@ -145,8 +137,6 @@ public LeaseDurationType getLeaseDuration() { } /** - * Gets the lease state of the container. - * * @return the lease state of the container */ public LeaseStateType getLeaseState() { @@ -154,8 +144,6 @@ public LeaseStateType getLeaseState() { } /** - * Gets the lease status of the container. - * * @return the lease status of the container */ public LeaseStatusType getLeaseStatus() { @@ -163,8 +151,6 @@ public LeaseStatusType getLeaseStatus() { } /** - * Gets the access type for the container. - * * @return the access type for the container */ public PublicAccessType getBlobPublicAccess() { @@ -172,8 +158,6 @@ public PublicAccessType getBlobPublicAccess() { } /** - * Gets the immutability status for the container. - * * @return the immutability status for the container */ public boolean hasImmutabilityPolicy() { @@ -181,8 +165,6 @@ public boolean hasImmutabilityPolicy() { } /** - * Gets the legal hold status for the container. - * * @return the legal hold status for the container */ public boolean hasLegalHold() { @@ -190,8 +172,6 @@ public boolean hasLegalHold() { } /** - * Gets the container's default encryption scope. - * * @return the container's default encryption scope */ public String getDefaultEncryptionScope() { @@ -199,8 +179,6 @@ public String getDefaultEncryptionScope() { } /** - * Gets the container's deny encryption scope override property. - * * @return the container's deny encryption scope override property. */ public Boolean isEncryptionScopeOverridePrevented() { @@ -208,9 +186,7 @@ public Boolean isEncryptionScopeOverridePrevented() { } /** - * Gets whether immutable storage with versioning is enabled on this container. - * - * @return Whether immutable storage with versioning is enabled on this container. + * @return Whether or not immutable storage with versioning is enabled on this container. */ public Boolean isImmutableStorageWithVersioningEnabled() { return isImmutableStorageWithVersioningEnabled; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyInfo.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyInfo.java index 045ba5eea545f..d92090e21574f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyInfo.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobCopyInfo.java @@ -36,8 +36,9 @@ public class BlobCopyInfo { * @param copyStatus The status of the copy operation. * @param error An error message for the copy operation. {@code null} if there are no errors. * @param eTag If the copy is completed, contains the ETag of the destination blob. If the copy is not complete, - * contains the ETag of the empty blob created. + * contains the ETag of the empty blob created. * @param lastModified The date/time that the copy operation to the destination blob completed. + * * @throws NullPointerException If {@code copyId}, {@code copySource}, {@code eTag}, or {@code copyStatus} is null. */ public BlobCopyInfo(String copySource, String copyId, CopyStatusType copyStatus, String eTag, @@ -53,9 +54,10 @@ public BlobCopyInfo(String copySource, String copyId, CopyStatusType copyStatus, * @param copyStatus The status of the copy operation. * @param error An error message for the copy operation. {@code null} if there are no errors. * @param eTag If the copy is completed, contains the ETag of the destination blob. If the copy is not complete, - * contains the ETag of the empty blob created. + * contains the ETag of the empty blob created. * @param lastModified The date/time that the copy operation to the destination blob completed. * @param versionId The version identifier of the destination blob. + * * @throws NullPointerException If {@code copyId}, {@code copySource}, {@code eTag}, or {@code copyStatus} is null. */ public BlobCopyInfo(String copySource, String copyId, CopyStatusType copyStatus, String eTag, @@ -71,10 +73,11 @@ public BlobCopyInfo(String copySource, String copyId, CopyStatusType copyStatus, * @param copyStatus The status of the copy operation. * @param error An error message for the copy operation. {@code null} if there are no errors. * @param eTag If the copy is completed, contains the ETag of the destination blob. If the copy is not complete, - * contains the ETag of the empty blob created. + * contains the ETag of the empty blob created. * @param lastModified The date/time that the copy operation to the destination blob completed. * @param versionId The version identifier of the destination blob. * @param encryptionScope The encryptionScope that will be applied to the destination blob. + * * @throws NullPointerException If {@code copyId}, {@code copySource}, {@code eTag}, or {@code copyStatus} is null. */ public BlobCopyInfo(String copySource, String copyId, CopyStatusType copyStatus, String eTag, @@ -120,7 +123,7 @@ public CopyStatusType getCopyStatus() { * Gets an error description associated with the copy operation. * * @return An error description associated with the copy, or {@code null} if there is no error associated with this - * copy operation. + * copy operation. */ public String getError() { return error; @@ -138,7 +141,7 @@ public OffsetDateTime getLastModified() { /** * If the copy is complete, contains the ETag of the destination blob. If the copy isn't complete, contains the * ETag of the empty blob created at the start of the copy. - *

+ * * The ETag value will be in quotes. * * @return The ETag for the copy. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobImmutabilityPolicy.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobImmutabilityPolicy.java index edb18e7328fc1..c146ca0bafac2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobImmutabilityPolicy.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobImmutabilityPolicy.java @@ -9,18 +9,11 @@ * Optional parameters for setting the immutability policy of a blob, blob snapshot or blob version. */ public final class BlobImmutabilityPolicy { + private OffsetDateTime expiryTime; private BlobImmutabilityPolicyMode policyMode; /** - * Creates an instance of {@link BlobImmutabilityPolicy}. - */ - public BlobImmutabilityPolicy() { - } - - /** - * Gets the time when the immutability policy expires. - * * @return The time when the immutability policy expires. */ public OffsetDateTime getExpiryTime() { @@ -28,8 +21,6 @@ public OffsetDateTime getExpiryTime() { } /** - * Sets the time when the immutability policy expires. - * * @param expiryTime The time when the immutability policy expires. * @return The updated BlobImmutabilityPolicy */ @@ -39,8 +30,6 @@ public BlobImmutabilityPolicy setExpiryTime(OffsetDateTime expiryTime) { } /** - * Gets the immutability policy mode. - * * @return The immutability policy mode. */ public BlobImmutabilityPolicyMode getPolicyMode() { @@ -48,8 +37,6 @@ public BlobImmutabilityPolicyMode getPolicyMode() { } /** - * Sets the immutability policy mode. - * * @param policyMode The immutability policy mode. * @return The updated BlobImmutabilityPolicy */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java index 7b3558005a5ea..11c9ed3c1dc03 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java @@ -43,8 +43,11 @@ public BlobItem() { } private String convertedName; + private BlobItemProperties convertedProperties; + private Map convertedTags; + private List convertedObjectReplicationSourcePolicies; /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLeaseRequestConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLeaseRequestConditions.java index 5d85b00936c92..1186142eb7573 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLeaseRequestConditions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLeaseRequestConditions.java @@ -16,12 +16,6 @@ public class BlobLeaseRequestConditions extends RequestConditions { private String tagsConditions; - /** - * Creates a new instance of {@link BlobLeaseRequestConditions}. - */ - public BlobLeaseRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java index 1f0dfcaaad7c0..a174a24933c2a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobLegalHoldResult.java @@ -7,10 +7,9 @@ * The blob legal hold result. */ public interface BlobLegalHoldResult { + /** - * Gets whether a legal hold is enabled on the blob. - * - * @return whether a legal hold is enabled on the blob. + * @return whether or not a legal hold is enabled on the blob. */ boolean hasLegalHold(); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java index 0604674640503..c1b36ec712a06 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java @@ -236,8 +236,6 @@ public BlobListDetails setRetrieveLegalHold(boolean retrieveLegalHold) { } /** - * Gets the list of flags set to true. - * * @return a list of the flag set to true */ public ArrayList toList() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobPrefix.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobPrefix.java index 6ee8ae5579da7..ad8fe1134aeeb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobPrefix.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobPrefix.java @@ -22,12 +22,6 @@ public final class BlobPrefix implements XmlSerializable { */ private String name; - /** - * Creates an instance of BlobPrefix. - */ - public BlobPrefix() { - } - /** * Get the name property: The Name property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java index b62ecc33861ac..c7526cc46cfb4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobProperties.java @@ -453,8 +453,6 @@ public BlobProperties(final OffsetDateTime creationTime, final OffsetDateTime la } /** - * Gets the time when the blob was created. - * * @return the time when the blob was created */ public OffsetDateTime getCreationTime() { @@ -462,8 +460,6 @@ public OffsetDateTime getCreationTime() { } /** - * Gets the time when the blob was last modified. - * * @return the time when the blob was last modified */ public OffsetDateTime getLastModified() { @@ -471,8 +467,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the eTag of the blob. - * * @return the eTag of the blob */ public String getETag() { @@ -480,8 +474,6 @@ public String getETag() { } /** - * Gets the size of the blob in bytes. - * * @return the size of the blob in bytes */ public long getBlobSize() { @@ -489,8 +481,6 @@ public long getBlobSize() { } /** - * Gets the content type of the blob. - * * @return the content type of the blob */ public String getContentType() { @@ -498,8 +488,6 @@ public String getContentType() { } /** - * Gets the MD5 of the blob's content. - * * @return the MD5 of the blob's content */ public byte[] getContentMd5() { @@ -507,8 +495,6 @@ public byte[] getContentMd5() { } /** - * Gets the content encoding of the blob. - * * @return the content encoding of the blob */ public String getContentEncoding() { @@ -516,8 +502,6 @@ public String getContentEncoding() { } /** - * Gets the content disposition of the blob. - * * @return the content disposition of the blob */ public String getContentDisposition() { @@ -525,8 +509,6 @@ public String getContentDisposition() { } /** - * Gets the content language of the blob. - * * @return the content language of the blob */ public String getContentLanguage() { @@ -534,8 +516,6 @@ public String getContentLanguage() { } /** - * Gets the cache control of the blob. - * * @return the cache control of the blob */ public String getCacheControl() { @@ -543,8 +523,6 @@ public String getCacheControl() { } /** - * Gets the current sequence number of the page blob. This is only returned for page blobs. - * * @return the current sequence number of the page blob. This is only returned for page blobs. */ public Long getBlobSequenceNumber() { @@ -552,8 +530,6 @@ public Long getBlobSequenceNumber() { } /** - * Gets the type of the blob. - * * @return the type of the blob */ public BlobType getBlobType() { @@ -561,8 +537,6 @@ public BlobType getBlobType() { } /** - * Gets the lease status of the blob. - * * @return the lease status of the blob */ public LeaseStatusType getLeaseStatus() { @@ -570,8 +544,6 @@ public LeaseStatusType getLeaseStatus() { } /** - * Gets the lease state of the blob. - * * @return the lease state of the blob */ public LeaseStateType getLeaseState() { @@ -579,8 +551,6 @@ public LeaseStateType getLeaseState() { } /** - * Gets the lease duration of the blob, if the blob is leased. - * * @return the lease duration if the blob is leased */ public LeaseDurationType getLeaseDuration() { @@ -588,8 +558,6 @@ public LeaseDurationType getLeaseDuration() { } /** - * Gets the identifier of the last copy operation. - * * @return the identifier of the last copy operation. If this blob hasn't been the target of a copy operation or has * been modified since this won't be set. */ @@ -598,8 +566,6 @@ public String getCopyId() { } /** - * Gets the status of the last copy operation. - * * @return the status of the last copy operation. If this blob hasn't been the target of a copy operation or has * been modified since this won't be set. */ @@ -608,8 +574,6 @@ public CopyStatusType getCopyStatus() { } /** - * Gets the source blob URL from the last copy operation. - * * @return the source blob URL from the last copy operation. If this blob hasn't been the target of a copy operation * or has been modified since this won't be set. */ @@ -618,8 +582,6 @@ public String getCopySource() { } /** - * Gets the progress of the last copy operation. - * * @return the number of bytes copied and total bytes in the source from the last copy operation (bytes copied/total * bytes). If this blob hasn't been the target of a copy operation or has been modified since this won't be set. */ @@ -628,8 +590,6 @@ public String getCopyProgress() { } /** - * Gets the completion time of the last copy operation. - * * @return the completion time of the last copy operation. If this blob hasn't been the target of a copy operation * or has been modified since this won't be set. */ @@ -638,8 +598,6 @@ public OffsetDateTime getCopyCompletionTime() { } /** - * Gets the description of the last copy failure. - * * @return the description of the last copy failure, this is set when the {@link #getCopyStatus() getCopyStatus} is * {@link CopyStatusType#FAILED failed} or {@link CopyStatusType#ABORTED aborted}. If this blob hasn't been the * target of a copy operation or has been modified since this won't be set. @@ -649,8 +607,6 @@ public String getCopyStatusDescription() { } /** - * Gets the status of the blob being encrypted on the server. - * * @return the status of the blob being encrypted on the server */ public Boolean isServerEncrypted() { @@ -658,8 +614,6 @@ public Boolean isServerEncrypted() { } /** - * Gets the status of the blob being an incremental copy blob. - * * @return the status of the blob being an incremental copy blob */ public Boolean isIncrementalCopy() { @@ -667,8 +621,6 @@ public Boolean isIncrementalCopy() { } /** - * Gets the snapshot time of the last successful incremental copy snapshot for this blob. - * * @return the snapshot time of the last successful incremental copy snapshot for this blob. If this blob isn't an * incremental copy blob or incremental copy snapshot or {@link #getCopyStatus() getCopyStatus} isn't {@link * CopyStatusType#SUCCESS success} this won't be set. @@ -678,8 +630,6 @@ public String getCopyDestinationSnapshot() { } /** - * Gets the access tier of the blob. - * * @return the tier of the blob. This is only set for Page blobs on a premium storage account or for Block blobs on * blob storage or general purpose V2 account. */ @@ -688,8 +638,6 @@ public AccessTier getAccessTier() { } /** - * Gets the status of the tier being inferred for the blob. - * * @return the status of the tier being inferred for the blob. This is only set for Page blobs on a premium storage * account or for Block blobs on blob storage or general purpose V2 account. */ @@ -698,8 +646,6 @@ public Boolean isAccessTierInferred() { } /** - * Gets the archive status of the blob. - * * @return the archive status of the blob. This is only for blobs on a blob storage and general purpose v2 account. */ public ArchiveStatus getArchiveStatus() { @@ -707,8 +653,6 @@ public ArchiveStatus getArchiveStatus() { } /** - * Gets the SHA256 of the customer provided encryption key used to encrypt the blob on the server. - * * @return the key used to encrypt the blob */ public String getEncryptionKeySha256() { @@ -716,8 +660,6 @@ public String getEncryptionKeySha256() { } /** - * Gets the name of the encryption scope under which the blob is encrypted. - * * @return The name of the encryption scope under which the blob is encrypted. */ public String getEncryptionScope() { @@ -725,8 +667,6 @@ public String getEncryptionScope() { } /** - * Gets the time when the access tier for the blob was last changed. - * * @return the time when the access tier for the blob was last changed */ public OffsetDateTime getAccessTierChangeTime() { @@ -734,8 +674,6 @@ public OffsetDateTime getAccessTierChangeTime() { } /** - * Gets the metadata associated with this blob. - * * @return the metadata associated with this blob */ public Map getMetadata() { @@ -743,8 +681,6 @@ public Map getMetadata() { } /** - * Gets the number of committed blocks in the blob. This is only returned for Append blobs. - * * @return the number of committed blocks in the blob. This is only returned for Append blobs. */ public Integer getCommittedBlockCount() { @@ -752,8 +688,6 @@ public Integer getCommittedBlockCount() { } /** - * Gets the number of tags associated with the blob. - * * @return The number of tags associated with the blob. */ public Long getTagCount() { @@ -761,8 +695,6 @@ public Long getTagCount() { } /** - * Gets the version identifier of the blob. - * * @return the version identifier the blob. */ public String getVersionId() { @@ -770,8 +702,6 @@ public String getVersionId() { } /** - * Gets the flag indicating whether version identifier points to current version of the blob. - * * @return the flag indicating whether version identifier points to current version of the blob. */ public Boolean isCurrentVersion() { @@ -779,9 +709,6 @@ public Boolean isCurrentVersion() { } /** - * Gets a {@link List} that contains information on the object replication policies associated with this blob and - * the status of the replication for each policy. Only available when the blob is the source of object replication. - * * @return a {@link List} that contains information on the object replication policies associated with this blob and * the status of the replication for each policy. Only available when the blob is the source of object replication. */ @@ -790,17 +717,14 @@ public List getObjectReplicationSourcePolicies() { } /** - * Gets a string that identifies the Object Replication Policy which made this blob the destination of a copy. - * - * @return a string that identifies the Object Replication Policy which made this blob the destination of a copy. + * @return a {@code String} that identifies the Object Replication Policy which made this blob the destination of a + * copy. */ public String getObjectReplicationDestinationPolicyId() { return this.internalProperties.getObjectReplicationDestinationPolicyId(); } /** - * Gets the {@link RehydratePriority} of the blob if it is in RehydratePending state. - * * @return The {@link RehydratePriority} of the blob if it is in RehydratePending state. */ public RehydratePriority getRehydratePriority() { @@ -808,8 +732,6 @@ public RehydratePriority getRehydratePriority() { } /** - * Gets the flag indicating whether this blob has been sealed (marked as read only). This is only returned for - * Append blobs. * @return the flag indicating whether this blob has been sealed (marked as read only). This is only returned for * Append blobs. */ @@ -818,17 +740,13 @@ public Boolean isSealed() { } /** - * Gets the date and time the blob was last read or written to. - * - * @return The date and time the blob was last read or written to. + * @return The date and time the blob was read or written to. */ public OffsetDateTime getLastAccessedTime() { return internalProperties.getLastAccessedTime(); } /** - * Gets the time when the blob is going to expire. - * * @return the time when the blob is going to expire. */ public OffsetDateTime getExpiresOn() { @@ -836,8 +754,6 @@ public OffsetDateTime getExpiresOn() { } /** - * Gets the immutability policy of the blob. - * * @return the immutability policy. */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -845,8 +761,6 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Gets the legal hold status of the blob. - * * @return whether the blob has a legal hold. */ public Boolean hasLegalHold() { @@ -854,8 +768,6 @@ public Boolean hasLegalHold() { } /** - * Gets the request id. - * * @return the x-ms-request id header value. */ public String getRequestId() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowField.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowField.java index ab5fef25091c8..300d3c111ca18 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowField.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowField.java @@ -11,14 +11,13 @@ */ @Fluent public class BlobQueryArrowField { + private String name; private Integer precision; private Integer scale; private final BlobQueryArrowFieldType type; /** - * Creates a new instance of {@link BlobQueryArrowField}. - * * @param type {@link BlobQueryArrowFieldType} */ public BlobQueryArrowField(BlobQueryArrowFieldType type) { @@ -27,8 +26,6 @@ public BlobQueryArrowField(BlobQueryArrowFieldType type) { } /** - * Sets the name of the field. - * * @param name The name of the field. * @return The updated options. */ @@ -38,8 +35,6 @@ public BlobQueryArrowField setName(String name) { } /** - * Sets the precision of the field. Required if type is {@link BlobQueryArrowFieldType#DECIMAL}. - * * @param precision The precision of the field. Required if type is {@link BlobQueryArrowFieldType#DECIMAL} * @return The updated options. */ @@ -49,8 +44,6 @@ public BlobQueryArrowField setPrecision(Integer precision) { } /** - * Sets the scale of the field. Required if type is {@link BlobQueryArrowFieldType#DECIMAL}. - * * @param scale The scale of the field. Required if type is {@link BlobQueryArrowFieldType#DECIMAL} * @return The updated options. */ @@ -60,8 +53,6 @@ public BlobQueryArrowField setScale(Integer scale) { } /** - * Gets the name. - * * @return The name. */ public String getName() { @@ -69,8 +60,6 @@ public String getName() { } /** - * Gets the precision. - * * @return The precision. */ public Integer getPrecision() { @@ -78,8 +67,6 @@ public Integer getPrecision() { } /** - * Gets the scale. - * * @return The scale. */ public Integer getScale() { @@ -87,8 +74,6 @@ public Integer getScale() { } /** - * Gets the {@link BlobQueryArrowFieldType}. - * * @return {@link BlobQueryArrowFieldType} */ public BlobQueryArrowFieldType getType() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowSerialization.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowSerialization.java index 66f921a3f9e1d..949cc3ac33854 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowSerialization.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryArrowSerialization.java @@ -10,13 +10,8 @@ * Defines the output arrow serialization for a blob quick query request. */ public class BlobQueryArrowSerialization implements BlobQuerySerialization { - private List schema; - /** - * Creates a new instance of {@link BlobQueryArrowSerialization}. - */ - public BlobQueryArrowSerialization() { - } + private List schema; /** * Gets the arrow fields. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryDelimitedSerialization.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryDelimitedSerialization.java index d1dc568d581d5..f301c1474431d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryDelimitedSerialization.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryDelimitedSerialization.java @@ -7,18 +7,13 @@ * Defines the input or output delimited (CSV) serialization for a blob quick query request. */ public class BlobQueryDelimitedSerialization implements BlobQuerySerialization { + private char columnSeparator; private char fieldQuote; private char escapeChar; private boolean headersPresent; private char recordSeparator; - /** - * Creates a new instance of {@link BlobQueryDelimitedSerialization}. - */ - public BlobQueryDelimitedSerialization() { - } - /** * Gets the column separator. * @return the column separator. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryError.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryError.java index 0c9341950e5b3..4d11a2f78dbc6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryError.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryError.java @@ -15,7 +15,7 @@ public class BlobQueryError { /** * Creates a new BlobQueryError object. - * @param fatal Whether the error is fatal. + * @param fatal Whether or not the error is fatal. * @param name The name of the error. * @param description A description of the error. * @param position The blob offset at which the error occurred. @@ -28,19 +28,16 @@ public BlobQueryError(boolean fatal, String name, String description, long posit } /** - * Whether the error is fatal. If true, this error prevents further query processing. More result data may be - * returned, but there is no guarantee that all the original data will be processed. If false, this error does not - * prevent further query processing. - * - * @return Whether the error is fatal. + * Whether or not the error is fatal. If true, this error prevents further query processing. More result data may + * be returned, but there is no guarantee that all of the original data will be processed. If false, this error + * does not prevent further query processing. + * @return Whether or not the error is fatal. */ public boolean isFatal() { return fatal; } /** - * Gets the name of the error. - * * @return The name of the error. */ public String getName() { @@ -48,7 +45,6 @@ public String getName() { } /** - * Gets a description of the error. * * @return A description of the error. */ @@ -57,8 +53,6 @@ public String getDescription() { } /** - * Gets the blob offset at which the error occurred. - * * @return The blob offset at which the error occurred. */ public long getPosition() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryJsonSerialization.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryJsonSerialization.java index 7e354ce730b2b..60aa2ac3cd22a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryJsonSerialization.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryJsonSerialization.java @@ -7,13 +7,8 @@ * Defines the input or output JSON serialization for a blob quick query request. */ public class BlobQueryJsonSerialization implements BlobQuerySerialization { - private char recordSeparator; - /** - * Creates a new instance of {@link BlobQueryJsonSerialization}. - */ - public BlobQueryJsonSerialization() { - } + private char recordSeparator; /** * Gets the record separator. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryParquetSerialization.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryParquetSerialization.java index 5064bbf09f79a..8ec545e7b521c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryParquetSerialization.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryParquetSerialization.java @@ -7,9 +7,4 @@ * Defines the input parquet serialization for a blob quick query request. */ public final class BlobQueryParquetSerialization implements BlobQuerySerialization { - /** - * Creates a new instance of {@link BlobQueryParquetSerialization}. - */ - public BlobQueryParquetSerialization() { - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryProgress.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryProgress.java index 56bc23a73d2a3..bb8f9b8ac0ab4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryProgress.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobQueryProgress.java @@ -7,6 +7,7 @@ * Defines a blob query error that can be returned on parsing a blob query request. */ public class BlobQueryProgress { + private final long bytesScanned; private final long totalBytes; @@ -21,8 +22,6 @@ public BlobQueryProgress(long bytesScanned, long totalBytes) { } /** - * Gets the number of bytes scanned so far. - * * @return The number of bytes scanned so far. */ public long getBytesScanned() { @@ -30,8 +29,6 @@ public long getBytesScanned() { } /** - * Gets the total number of bytes in the blob. - * * @return The total number of bytes in the blob. */ public long getTotalBytes() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRange.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRange.java index 74a6cb52fe55c..1dea6f29e2529 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRange.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRange.java @@ -70,9 +70,7 @@ public Long getCount() { } /** - * Gets a string compliant the format of the Azure Storage x-ms-range and Range headers. - * - * @return A string compliant with the format of the Azure Storage x-ms-range and Range headers. + * @return A {@code String} compliant with the format of the Azure Storage x-ms-range and Range headers. */ @Override public String toString() { @@ -85,9 +83,6 @@ public String toString() { } /** - * Gets a string compliant with the format of the Azure Storage x-ms-range and Range headers if {@code count} isn't - * {@code null} or {@code offset} isn't 0, otherwise null. - * * @return {@link BlobRange#toString()} if {@code count} isn't {@code null} or {@code offset} isn't 0, otherwise * null. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRequestConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRequestConditions.java index 8921d19823bbe..fa62aec7b3d6f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRequestConditions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobRequestConditions.java @@ -17,12 +17,6 @@ public class BlobRequestConditions extends BlobLeaseRequestConditions { private String leaseId; - /** - * Creates a new instance of {@link BlobRequestConditions}. - */ - public BlobRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSeekableByteChannelReadResult.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSeekableByteChannelReadResult.java index 4c3d29b159c6c..16158e4370f39 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSeekableByteChannelReadResult.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobSeekableByteChannelReadResult.java @@ -13,8 +13,6 @@ public final class BlobSeekableByteChannelReadResult { private final BlobProperties properties; /** - * Creates a new instance of {@link BlobSeekableByteChannelReadResult}. - * * @param channel Channel to read the target blob. * @param properties Blob properties of the target blob. */ @@ -24,8 +22,6 @@ public BlobSeekableByteChannelReadResult(SeekableByteChannel channel, BlobProper } /** - * Gets the channel to read the target blob. - * * @return Channel to read the target blob. */ public SeekableByteChannel getChannel() { @@ -33,8 +29,6 @@ public SeekableByteChannel getChannel() { } /** - * Gets the blob properties of the target blob. - * * @return Blob properties of the target blob. */ public BlobProperties getProperties() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStorageException.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStorageException.java index 18206a4618ec5..16cafce29945c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStorageException.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobStorageException.java @@ -35,8 +35,6 @@ public BlobStorageException(String message, HttpResponse response, Object value) } /** - * Gets the error code returned by the service. - * * @return The error code returned by the service. */ public BlobErrorCode getErrorCode() { @@ -44,8 +42,6 @@ public BlobErrorCode getErrorCode() { } /** - * Gets the message returned by the service. - * * @return The message returned by the service. */ public String getServiceMessage() { @@ -53,8 +49,6 @@ public String getServiceMessage() { } /** - * Gets the status code on the response. - * * @return The status code on the response. */ public int getStatusCode() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobItem.java index bdad9c9632086..0cf32e956674b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlockBlobItem.java @@ -98,8 +98,6 @@ public BlockBlobItem(final String eTag, final OffsetDateTime lastModified, final } /** - * Gets the eTag of the block blob. - * * @return the eTag of the block blob */ public String getETag() { @@ -107,8 +105,6 @@ public String getETag() { } /** - * Gets the last time the block blob was modified. - * * @return the last time the block blob was modified */ public OffsetDateTime getLastModified() { @@ -116,8 +112,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the encryption status of the block blob on the server. - * * @return the encryption status of the block blob on the server */ public Boolean isServerEncrypted() { @@ -125,8 +119,6 @@ public Boolean isServerEncrypted() { } /** - * Gets the key used to encrypt the block blob. - * * @return the key used to encrypt the block blob */ public String getEncryptionKeySha256() { @@ -134,8 +126,6 @@ public String getEncryptionKeySha256() { } /** - * Gets the encryption scope used to encrypt the block blob. - * * @return the encryption scope used to encrypt the block blob */ public String getEncryptionScope() { @@ -143,8 +133,6 @@ public String getEncryptionScope() { } /** - * Gets the MD5 of the block blob's content. - * * @return the MD5 of the block blob's comment */ public byte[] getContentMd5() { @@ -152,8 +140,6 @@ public byte[] getContentMd5() { } /** - * Gets the version identifier of the block blob. - * * @return the version identifier of the block blob */ public String getVersionId() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DownloadRetryOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DownloadRetryOptions.java index 7ca94e8f37712..e4e0d3c064442 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DownloadRetryOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/DownloadRetryOptions.java @@ -19,18 +19,12 @@ public final class DownloadRetryOptions { private static final ClientLogger LOGGER = new ClientLogger(DownloadRetryOptions.class); /* - * We use "retry" here because by the time the user passes this type, the initial request, or try, has already been - * issued and returned. This is in contrast to the retry policy options, which includes the initial try in its - * count, thus the difference in verbiage. + We use "retry" here because by the time the user passes this type, the initial request, or try, has already been + issued and returned. This is in contrast to the retry policy options, which includes the initial try in its count, + thus the difference in verbiage. */ private int maxRetryRequests = 5; - /** - * Creates a new instance of {@link DownloadRetryOptions}. - */ - public DownloadRetryOptions() { - } - /** * Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a * response body. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersOptions.java index 801b0eb87358a..67309be0d0c7c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobContainersOptions.java @@ -17,7 +17,9 @@ public final class ListBlobContainersOptions { private static final ClientLogger LOGGER = new ClientLogger(ListBlobContainersOptions.class); private BlobContainerListDetails details; + private String prefix; + private Integer maxResultsPerPage; /** @@ -28,8 +30,6 @@ public ListBlobContainersOptions() { } /** - * Gets the details for listing specific containers. - * * @return the details for listing specific containers */ public BlobContainerListDetails getDetails() { @@ -37,8 +37,6 @@ public BlobContainerListDetails getDetails() { } /** - * Sets the details for listing specific containers. - * * @param details The details for listing specific containers * @return the updated ListBlobContainersOptions object */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsOptions.java index d33edff1afa57..234fa9cc49231 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsOptions.java @@ -16,7 +16,9 @@ public final class ListBlobsOptions { private static final ClientLogger LOGGER = new ClientLogger(ListBlobsOptions.class); private BlobListDetails details; + private String prefix; + private Integer maxResultsPerPage; /** @@ -27,8 +29,6 @@ public ListBlobsOptions() { } /** - * Gets the details for listing specific blobs. - * * @return the details for listing specific blobs */ public BlobListDetails getDetails() { @@ -36,8 +36,6 @@ public BlobListDetails getDetails() { } /** - * Sets the details for listing specific blobs. - * * @param details The details for listing specific blobs * @return the updated ListBlobsOptions object */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationPolicy.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationPolicy.java index 8e6ee7f57afc1..e7fca3feb01ee 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationPolicy.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationPolicy.java @@ -14,6 +14,7 @@ */ @Immutable public class ObjectReplicationPolicy { + private final String policyId; private final List objectReplicationRules; @@ -29,8 +30,6 @@ public ObjectReplicationPolicy(String policyId, List rule } /** - * Gets the policy id. - * * @return The policy id. */ public String getPolicyId() { @@ -38,9 +37,8 @@ public String getPolicyId() { } /** - * Gets the rules associated with this policy to the status of the replication associated with that rule. - * - * @return The rules associated with this policy to the status of the replication associated with that rule. + * @return A {@code List} of rules associated with this policy to the status of the replication associated with that + * rule. */ public List getRules() { return this.objectReplicationRules; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationRule.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationRule.java index a803757f919da..1a6ea65a6fbd6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationRule.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationRule.java @@ -7,6 +7,7 @@ * A type that contains information about an object replication rule on a source blob. */ public class ObjectReplicationRule { + private final String ruleId; private final ObjectReplicationStatus status; @@ -21,8 +22,6 @@ public ObjectReplicationRule(String ruleId, ObjectReplicationStatus status) { } /** - * Gets the rule id. - * * @return The rule id. */ public String getRuleId() { @@ -30,8 +29,6 @@ public String getRuleId() { } /** - * Gets the {@link ObjectReplicationStatus} - * * @return The {@link ObjectReplicationStatus} */ public ObjectReplicationStatus getStatus() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationStatus.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationStatus.java index 295f98c9b3288..59181d74ddd97 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationStatus.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ObjectReplicationStatus.java @@ -21,15 +21,6 @@ public final class ObjectReplicationStatus extends ExpandableStringEnum values() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalRequestConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalRequestConditions.java index 6f74ecd26131b..9bc3b9704a56c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalRequestConditions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobCopyIncrementalRequestConditions.java @@ -16,12 +16,6 @@ public class PageBlobCopyIncrementalRequestConditions extends RequestConditions { private String tagsConditions; - /** - * Creates a new instance of {@link PageBlobCopyIncrementalRequestConditions}. - */ - public PageBlobCopyIncrementalRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobItem.java index ef127458a57a3..f420a6b71acc9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobItem.java @@ -81,8 +81,6 @@ public PageBlobItem(final String eTag, final OffsetDateTime lastModified, final } /** - * Gets the eTag of the page blob. - * * @return the eTag of the page blob */ public String getETag() { @@ -90,8 +88,6 @@ public String getETag() { } /** - * Gets the time this page blob was last modified. - * * @return the time this page blob was last modified */ public OffsetDateTime getLastModified() { @@ -99,8 +95,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the encryption status of the page blob on the server. - * * @return the encryption status of the page blob on the server */ public Boolean isServerEncrypted() { @@ -108,8 +102,6 @@ public Boolean isServerEncrypted() { } /** - * Gets the key used to encrypt the page blob. - * * @return the key used to encrypt the page blob */ public String getEncryptionKeySha256() { @@ -117,8 +109,6 @@ public String getEncryptionKeySha256() { } /** - * Gets the encryption scope used to encrypt the page blob. - * * @return the encryption scope used to encrypt the page blob */ public String getEncryptionScope() { @@ -126,8 +116,6 @@ public String getEncryptionScope() { } /** - * Gets the MD5 of the page blob's content. - * * @return the MD5 of the page blob's content */ public byte[] getContentMd5() { @@ -135,8 +123,6 @@ public byte[] getContentMd5() { } /** - * Gets the current sequence number of the page blob. - * * @return the current sequence number of the page blob */ public Long getBlobSequenceNumber() { @@ -144,8 +130,6 @@ public Long getBlobSequenceNumber() { } /** - * Gets the version identifier of the page blob. - * * @return the version identifier of the page blob */ public String getVersionId() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRequestConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRequestConditions.java index 356005a9d2449..680c918ca9bef 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRequestConditions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRequestConditions.java @@ -20,12 +20,6 @@ public final class PageBlobRequestConditions extends BlobRequestConditions { private Long ifSequenceNumberLessThan; private Long ifSequenceNumberEqualTo; - /** - * Creates a new instance of {@link PageBlobRequestConditions}. - */ - public PageBlobRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ParallelTransferOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ParallelTransferOptions.java index 77f7841c945d7..310de89135c5e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ParallelTransferOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ParallelTransferOptions.java @@ -226,14 +226,6 @@ public Integer getMaxConcurrency() { } /** - * Sets the maximum number of parallel requests that will be issued at any given time as a part of - * a single parallel transfer. This value applies per api. For example, if two calls to uploadFromFile are made at - * the same time, and each specifies a maxConcurrency of 5, there may be up to 10 outstanding, concurrent requests, - * up to 5 for each of the upload operations. For buffered uploads only, the maximum number of buffers to be - * allocated as part of the transfer will be {@code maxConcurrency + 1}. In those cases, memory will be allocated - * lazily as needed. The amount of memory consumed by methods which buffer may be up to blockSize * maxConcurrency. - * In general, upload methods which do not accept a length parameter must perform some buffering. - * * @param maxConcurrency The maximum number of parallel requests that will be issued at any given time as a part of * a single parallel transfer. This value applies per api. For example, if two calls to uploadFromFile are made at * the same time, and each specifies a maxConcurrency of 5, there may be up to 10 outstanding, concurrent requests, diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/AppendBlobSealOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/AppendBlobSealOptions.java index 736313ac31bde..a63e0722152ed 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/AppendBlobSealOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/AppendBlobSealOptions.java @@ -12,17 +12,10 @@ */ @Fluent public class AppendBlobSealOptions { - private AppendBlobRequestConditions requestConditions; - /** - * Creates a new instance of {@link AppendBlobSealOptions}. - */ - public AppendBlobSealOptions() { - } + private AppendBlobRequestConditions requestConditions; /** - * Gets the {@link AppendBlobRequestConditions}. - * * @return {@link AppendBlobRequestConditions} */ public AppendBlobRequestConditions getRequestConditions() { @@ -30,8 +23,6 @@ public AppendBlobRequestConditions getRequestConditions() { } /** - * Sets the {@link AppendBlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobAcquireLeaseOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobAcquireLeaseOptions.java index 8d7525e30cd25..14ba7a1eb994a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobAcquireLeaseOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobAcquireLeaseOptions.java @@ -11,12 +11,11 @@ */ @Fluent public class BlobAcquireLeaseOptions { + private final int duration; private BlobLeaseRequestConditions requestConditions; /** - * Creates a new instance of {@link BlobAcquireLeaseOptions}. - * * @param durationInSeconds The duration of the lease between 15 to 60 seconds or -1 for an infinite duration. */ public BlobAcquireLeaseOptions(int durationInSeconds) { @@ -24,8 +23,6 @@ public BlobAcquireLeaseOptions(int durationInSeconds) { } /** - * Gets the duration of the lease. - * * @return The duration of the lease between 15 to 60 seconds or -1 for an infinite duration. */ public int getDuration() { @@ -33,8 +30,6 @@ public int getDuration() { } /** - * Gets the {@link BlobLeaseRequestConditions}. - * * @return {@link BlobLeaseRequestConditions} */ public BlobLeaseRequestConditions getRequestConditions() { @@ -42,8 +37,6 @@ public BlobLeaseRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobLeaseRequestConditions}. - * * @param requestConditions {@link BlobLeaseRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBeginCopyOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBeginCopyOptions.java index e8143f59c53c0..17376090c2a85 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBeginCopyOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBeginCopyOptions.java @@ -32,10 +32,7 @@ public class BlobBeginCopyOptions { private Boolean legalHold; /** - * Creates a new instance of {@link BlobBeginCopyOptions}. - * * @param sourceUrl The source URL to copy from. URLs outside of Azure may only be copied to block blobs. - * @throws NullPointerException If {@code sourceUrl} is null. */ public BlobBeginCopyOptions(String sourceUrl) { StorageImplUtils.assertNotNull("sourceUrl", sourceUrl); @@ -43,8 +40,6 @@ public BlobBeginCopyOptions(String sourceUrl) { } /** - * Gets the source URL. - * * @return The source URL. */ public String getSourceUrl() { @@ -52,8 +47,6 @@ public String getSourceUrl() { } /** - * Gets the metadata to associate with the destination blob. - * * @return The metadata to associate with the destination blob. */ public Map getMetadata() { @@ -61,8 +54,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the destination blob. - * * @param metadata The metadata to associate with the destination blob. * @return The updated options */ @@ -72,8 +63,6 @@ public BlobBeginCopyOptions setMetadata(Map metadata) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -81,8 +70,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -92,8 +79,6 @@ public BlobBeginCopyOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier} for the destination blob. - * * @return {@link AccessTier} for the destination blob. */ public AccessTier getTier() { @@ -101,8 +86,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier} for the destination blob. - * * @param tier {@link AccessTier} for the destination blob. * @return The updated options. */ @@ -112,8 +95,6 @@ public BlobBeginCopyOptions setTier(AccessTier tier) { } /** - * Gets the {@link RehydratePriority} for rehydrating the blob. - * * @return {@link RehydratePriority} for rehydrating the blob. */ public RehydratePriority getRehydratePriority() { @@ -121,8 +102,6 @@ public RehydratePriority getRehydratePriority() { } /** - * Sets the {@link RehydratePriority} for rehydrating the blob. - * * @param rehydratePriority {@link RehydratePriority} for rehydrating the blob. * @return The updated options. */ @@ -132,8 +111,6 @@ public BlobBeginCopyOptions setRehydratePriority(RehydratePriority rehydratePrio } /** - * Gets the {@link BlobBeginCopySourceRequestConditions} for the source. - * * @return {@link BlobBeginCopySourceRequestConditions} for the source. */ public BlobBeginCopySourceRequestConditions getSourceRequestConditions() { @@ -141,8 +118,6 @@ public BlobBeginCopySourceRequestConditions getSourceRequestConditions() { } /** - * Sets the {@link BlobBeginCopySourceRequestConditions} for the source. - * * @param sourceRequestConditions {@link BlobBeginCopySourceRequestConditions} for the source. * @return The updated options. */ @@ -153,8 +128,6 @@ public BlobBeginCopySourceRequestConditions getSourceRequestConditions() { } /** - * Gets the {@link BlobRequestConditions} for the destination. - * * @return {@link BlobRequestConditions} for the destination. */ public BlobRequestConditions getDestinationRequestConditions() { @@ -162,8 +135,6 @@ public BlobRequestConditions getDestinationRequestConditions() { } /** - * Sets the {@link BlobRequestConditions} for the destination. - * * @param destinationRequestConditions {@link BlobRequestConditions} for the destination * @return The updated options. */ @@ -173,8 +144,6 @@ public BlobBeginCopyOptions setDestinationRequestConditions(BlobRequestCondition } /** - * Gets the duration between each poll for the copy status. - * * @return Duration between each poll for the copy status. If none is specified, a default of one second * is used. */ @@ -183,8 +152,6 @@ public Duration getPollInterval() { } /** - * Sets the duration between each poll for the copy status. - * * @param pollInterval Duration between each poll for the copy status. If none is specified, a default of one second * is used. * @return The updated options. @@ -195,22 +162,17 @@ public BlobBeginCopyOptions setPollInterval(Duration pollInterval) { } /** - * Gets whether the destination blob should be sealed (marked as read only). - *

- * Only applicable for Append Blobs. - * - * @return Whether the destination blob should be sealed (marked as read only). + * Only applicable for Append Blobs. + * @return Whether or not the destination blob should be sealed (marked as read only). */ public Boolean isSealDestination() { return sealDestination; } /** - * Sets whether the destination blob should be sealed (marked as read only). - *

* Only applicable for Append Blobs. * - * @param sealDestination Whether the destination blob should be sealed (marked as read only). + * @param sealDestination Whether or not the destination blob should be sealed (marked as read only). * @return The updated options. */ public BlobBeginCopyOptions setSealDestination(Boolean sealDestination) { @@ -219,8 +181,6 @@ public BlobBeginCopyOptions setSealDestination(Boolean sealDestination) { } /** - * Gets the {@link BlobImmutabilityPolicy} for the destination blob. - * * @return {@link BlobImmutabilityPolicy} */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -228,11 +188,8 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Sets the {@link BlobImmutabilityPolicy} for the destination blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param immutabilityPolicy {@link BlobImmutabilityPolicy} * @return The updated options. */ @@ -242,8 +199,6 @@ public BlobBeginCopyOptions setImmutabilityPolicy(BlobImmutabilityPolicy immutab } /** - * Gets if a legal hold should be placed on the blob. - * * @return If a legal hold should be placed on the blob. */ public Boolean isLegalHold() { @@ -251,8 +206,6 @@ public Boolean isLegalHold() { } /** - * Sets if a legal hold should be placed on the blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. * @param legalHold Indicates if a legal hold should be placed on the blob. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBreakLeaseOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBreakLeaseOptions.java index 59aec35eda273..c0ac1c9afa3ce 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBreakLeaseOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobBreakLeaseOptions.java @@ -13,18 +13,11 @@ */ @Fluent public class BlobBreakLeaseOptions { + private Duration breakPeriod; private BlobLeaseRequestConditions requestConditions; /** - * Creates a new instance of {@link BlobBreakLeaseOptions}. - */ - public BlobBreakLeaseOptions() { - } - - /** - * Gets the break period of the lease. - * * @return An optional duration, between 0 and 60 seconds, that the lease should continue before * it is broken. If the break period is longer than the time remaining on the lease the remaining time on the lease * is used. A new lease will not be available before the break period has expired, but the lease may be held for @@ -35,8 +28,6 @@ public Duration getBreakPeriod() { } /** - * Sets the break period of the lease. - * * @param breakPeriod An optional duration, between 0 and 60 seconds, that the lease should continue before * it is broken. If the break period is longer than the time remaining on the lease the remaining time on the lease * is used. A new lease will not be available before the break period has expired, but the lease may be held for @@ -49,8 +40,6 @@ public BlobBreakLeaseOptions setBreakPeriod(Duration breakPeriod) { } /** - * Gets the {@link BlobLeaseRequestConditions}. - * * @return {@link BlobLeaseRequestConditions} */ public BlobLeaseRequestConditions getRequestConditions() { @@ -58,8 +47,6 @@ public BlobLeaseRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobLeaseRequestConditions}. - * * @param requestConditions {@link BlobLeaseRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobChangeLeaseOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobChangeLeaseOptions.java index 70eae80285d3c..22ea53155656e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobChangeLeaseOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobChangeLeaseOptions.java @@ -12,14 +12,12 @@ */ @Fluent public class BlobChangeLeaseOptions { + private final String proposedId; private BlobLeaseRequestConditions requestConditions; /** - * Creates a new instance of {@link BlobChangeLeaseOptions}. - * * @param proposedId A new lease ID in a valid GUID format. - * @throws NullPointerException If {@code proposedId} is null. */ public BlobChangeLeaseOptions(String proposedId) { StorageImplUtils.assertNotNull("proposedId", proposedId); @@ -27,8 +25,6 @@ public BlobChangeLeaseOptions(String proposedId) { } /** - * Gets the proposed lease ID. - * * @return A new lease ID in a valid GUID format. */ public String getProposedId() { @@ -36,8 +32,6 @@ public String getProposedId() { } /** - * Gets the {@link BlobLeaseRequestConditions}. - * * @return {@link BlobLeaseRequestConditions} */ public BlobLeaseRequestConditions getRequestConditions() { @@ -45,8 +39,6 @@ public BlobLeaseRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobLeaseRequestConditions}. - * * @param requestConditions {@link BlobLeaseRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerCreateOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerCreateOptions.java index e2bfbdc9b6624..f71ff8b52fb26 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerCreateOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerCreateOptions.java @@ -17,14 +17,6 @@ public class BlobContainerCreateOptions { PublicAccessType publicAccessType; /** - * Creates a new instance of {@link BlobContainerCreateOptions}. - */ - public BlobContainerCreateOptions() { - } - - /** - * Gets the metadata to associate with the blob. - * * @return The metadata to associate with the blob. */ public Map getMetadata() { @@ -32,8 +24,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the blob. - * * @param metadata The metadata to associate with the blob. * @return The updated options */ @@ -43,8 +33,6 @@ public BlobContainerCreateOptions setMetadata(Map metadata) { } /** - * Gets the public access type associated with the blob. - * * @return The public access type associated with the blob. */ public PublicAccessType getPublicAccessType() { @@ -52,8 +40,6 @@ public PublicAccessType getPublicAccessType() { } /** - * Sets the public access type to associate with the blob. - * * @param accessType The public access type to associate with the blob. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerRenameOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerRenameOptions.java index 6358f3c0eb3b6..be1889c501c74 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerRenameOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobContainerRenameOptions.java @@ -13,14 +13,12 @@ */ @Fluent class BlobContainerRenameOptions { + private final String destinationContainerName; private BlobRequestConditions requestConditions; /** - * Creates a new instance of {@link BlobContainerRenameOptions}. - * * @param destinationContainerName The new name of the container. - * @throws NullPointerException If {@code destinationContainerName} is null. */ BlobContainerRenameOptions(String destinationContainerName) { Objects.requireNonNull(destinationContainerName); @@ -28,8 +26,6 @@ class BlobContainerRenameOptions { } /** - * Gets the new name of the container. - * * @return The new name of the container. */ public String getDestinationContainerName() { @@ -37,8 +33,6 @@ public String getDestinationContainerName() { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -46,8 +40,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. * @throws UnsupportedOperationException if a condition other than lease id is set. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobCopyFromUrlOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobCopyFromUrlOptions.java index 8aa3a25d48c1c..49bf499f9d573 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobCopyFromUrlOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobCopyFromUrlOptions.java @@ -31,10 +31,7 @@ public class BlobCopyFromUrlOptions { private BlobCopySourceTagsMode copySourceTags; /** - * Creates a new instance of {@link BlobCopyFromUrlOptions}. - * * @param copySource The source URL to copy from. URLs outside of Azure may only be copied to block blobs. - * @throws NullPointerException If {@code copySource} is null. */ public BlobCopyFromUrlOptions(String copySource) { StorageImplUtils.assertNotNull("copySource", copySource); @@ -42,8 +39,6 @@ public BlobCopyFromUrlOptions(String copySource) { } /** - * Gets the source URL to copy from. - * * @return The source URL to copy from. URLs outside of Azure may only be copied to block blobs. */ public String getCopySource() { @@ -51,8 +46,6 @@ public String getCopySource() { } /** - * Gets the metadata to associate with the destination blob. - * * @return The metadata to associate with the destination blob. */ public Map getMetadata() { @@ -60,8 +53,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the destination blob. - * * @param metadata The metadata to associate with the destination blob. * @return The updated options */ @@ -71,8 +62,6 @@ public BlobCopyFromUrlOptions setMetadata(Map metadata) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -80,8 +69,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -91,8 +78,6 @@ public BlobCopyFromUrlOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier} for the destination blob. - * * @return {@link AccessTier} for the destination blob. */ public AccessTier getTier() { @@ -100,8 +85,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier} for the destination blob. - * * @param tier {@link AccessTier} for the destination blob. * @return The updated options. */ @@ -111,8 +94,6 @@ public BlobCopyFromUrlOptions setTier(AccessTier tier) { } /** - * Gets the {@link RequestConditions} for the source. - * * @return {@link RequestConditions} for the source. */ public RequestConditions getSourceRequestConditions() { @@ -120,8 +101,6 @@ public RequestConditions getSourceRequestConditions() { } /** - * Sets the {@link RequestConditions} for the source. - * * @param sourceRequestConditions {@link RequestConditions} for the source. * @return The updated options. */ @@ -131,8 +110,6 @@ public BlobCopyFromUrlOptions setSourceRequestConditions(RequestConditions sourc } /** - * Gets the {@link BlobRequestConditions} for the destination. - * * @return {@link BlobRequestConditions} for the destination. */ public BlobRequestConditions getDestinationRequestConditions() { @@ -140,8 +117,6 @@ public BlobRequestConditions getDestinationRequestConditions() { } /** - * Sets the {@link BlobRequestConditions} for the destination. - * * @param destinationRequestConditions {@link BlobRequestConditions} for the destination. * @return The updated options. */ @@ -151,9 +126,6 @@ public BlobCopyFromUrlOptions setDestinationRequestConditions(BlobRequestConditi } /** - * Gets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by - * Storage. - * * @return auth header for access to source. */ public HttpAuthorization getSourceAuthorization() { @@ -173,8 +145,6 @@ public BlobCopyFromUrlOptions setSourceAuthorization(HttpAuthorization sourceAut } /** - * Gets the {@link BlobImmutabilityPolicy}. - * * @return {@link BlobImmutabilityPolicy} */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -182,8 +152,6 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Sets the {@link BlobImmutabilityPolicy}. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. * @@ -196,8 +164,6 @@ public BlobCopyFromUrlOptions setImmutabilityPolicy(BlobImmutabilityPolicy immut } /** - * Gets if a legal hold should be placed on the blob. - * * @return If a legal hold should be placed on the blob. */ public Boolean hasLegalHold() { @@ -205,8 +171,6 @@ public Boolean hasLegalHold() { } /** - * Sets if a legal hold should be placed on the blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. * @@ -219,8 +183,6 @@ public BlobCopyFromUrlOptions setLegalHold(Boolean legalHold) { } /** - * Gets the copy source tags mode. - * * @return The copy source tags mode. */ public BlobCopySourceTagsMode getCopySourceTagsMode() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobDownloadToFileOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobDownloadToFileOptions.java index 434844645f581..5db9ed0cd1a87 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobDownloadToFileOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobDownloadToFileOptions.java @@ -18,6 +18,7 @@ */ @Fluent public class BlobDownloadToFileOptions { + private final String filePath; private BlobRange range; private ParallelTransferOptions parallelTransferOptions; @@ -30,7 +31,6 @@ public class BlobDownloadToFileOptions { * Constructs a {@link BlobDownloadToFileOptions}. * * @param filePath Path of the file to download to. - * @throws NullPointerException If {@code filePath} is null. */ public BlobDownloadToFileOptions(String filePath) { StorageImplUtils.assertNotNull("filePath", filePath); @@ -38,8 +38,6 @@ public BlobDownloadToFileOptions(String filePath) { } /** - * Gets the path of the file to download to. - * * @return The path of the file to download to. */ public String getFilePath() { @@ -47,8 +45,6 @@ public String getFilePath() { } /** - * Gets the {@link BlobRange}. - * * @return {@link BlobRange} */ public BlobRange getRange() { @@ -56,8 +52,6 @@ public BlobRange getRange() { } /** - * Gets the {@link ParallelTransferOptions}. - * * @return {@link ParallelTransferOptions} */ public ParallelTransferOptions getParallelTransferOptions() { @@ -65,8 +59,6 @@ public ParallelTransferOptions getParallelTransferOptions() { } /** - * Gets the {@link DownloadRetryOptions}. - * * @return {@link DownloadRetryOptions} */ public DownloadRetryOptions getDownloadRetryOptions() { @@ -74,8 +66,6 @@ public DownloadRetryOptions getDownloadRetryOptions() { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -83,8 +73,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Gets whether the contentMD5 for the specified blob range should be returned. - * * @return Whether the contentMD5 for the specified blob range should be returned. */ public boolean isRetrieveContentRangeMd5() { @@ -92,8 +80,6 @@ public boolean isRetrieveContentRangeMd5() { } /** - * Gets the {@link OpenOption OpenOptions} to use to configure how to open or create the file. - * * @return {@link OpenOption OpenOptions} to use to configure how to open or create the file. */ public Set getOpenOptions() { @@ -101,8 +87,6 @@ public Set getOpenOptions() { } /** - * Sets the {@link BlobRange}. - * * @param range {@link BlobRange} * @return The updated options. */ @@ -112,8 +96,6 @@ public BlobDownloadToFileOptions setRange(BlobRange range) { } /** - * Sets the {@link ParallelTransferOptions}. - * * @param parallelTransferOptions {@link ParallelTransferOptions} * @return The updated options. */ @@ -123,8 +105,6 @@ public BlobDownloadToFileOptions setParallelTransferOptions(ParallelTransferOpti } /** - * Sets the {@link DownloadRetryOptions}. - * * @param downloadRetryOptions {@link DownloadRetryOptions} * @return The updated options. */ @@ -134,8 +114,6 @@ public BlobDownloadToFileOptions setDownloadRetryOptions(DownloadRetryOptions do } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -145,8 +123,6 @@ public BlobDownloadToFileOptions setRequestConditions(BlobRequestConditions requ } /** - * Sets whether the contentMD5 for the specified blob range should be returned. - * * @param retrieveContentRangeMd5 Whether the contentMD5 for the specified blob range should be returned. * @return The updated options. */ @@ -156,8 +132,6 @@ public BlobDownloadToFileOptions setRetrieveContentRangeMd5(boolean retrieveCont } /** - * Sets the {@link OpenOption OpenOptions} to use to configure how to open or create the file. - * * @param openOptions {@link OpenOption OpenOptions} to use to configure how to open or create the file. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobGetTagsOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobGetTagsOptions.java index a8e8071b2e6bc..331242d86ff1e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobGetTagsOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobGetTagsOptions.java @@ -11,17 +11,10 @@ */ @Fluent public class BlobGetTagsOptions { - private BlobRequestConditions requestConditions; - /** - * Creates a new instance of {@link BlobGetTagsOptions}. - */ - public BlobGetTagsOptions() { - } + private BlobRequestConditions requestConditions; /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -29,8 +22,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobInputStreamOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobInputStreamOptions.java index d98d744f3dd3d..00a1705270887 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobInputStreamOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobInputStreamOptions.java @@ -13,20 +13,13 @@ */ @Fluent public class BlobInputStreamOptions { + private BlobRange range; private BlobRequestConditions requestConditions; private Integer blockSize; private ConsistentReadControl consistentReadControl; /** - * Creates a new instance of {@link BlobInputStreamOptions}. - */ - public BlobInputStreamOptions() { - } - - /** - * Gets the {@link BlobRange}. - * * @return {@link BlobRange} */ public BlobRange getRange() { @@ -34,8 +27,6 @@ public BlobRange getRange() { } /** - * Sets the {@link BlobRange}. - * * @param range {@link BlobRange} * @return The updated options. */ @@ -45,8 +36,6 @@ public BlobInputStreamOptions setRange(BlobRange range) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -54,8 +43,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -65,10 +52,6 @@ public BlobInputStreamOptions setRequestConditions(BlobRequestConditions request } /** - * Gets the size of each data chunk returned from the service. If block size is large, input stream will make - * fewer network calls, but each individual call will send more data and will therefore take longer. - * The default value is 4 MB. - * * @return The size of each data chunk returned from the service. If block size is large, input stream will make * fewer network calls, but each individual call will send more data and will therefore take longer. * The default value is 4 MB. @@ -78,10 +61,6 @@ public Integer getBlockSize() { } /** - * Sets the size of each data chunk returned from the service. If block size is large, input stream will make - * fewer network calls, but each individual call will send more data and will therefore take longer. - * The default value is 4 MB. - * * @param blockSize The size of each data chunk returned from the service. If block size is large, input stream * will make fewer network calls, but each individual call will send more data and will therefore take longer. * The default value is 4 MB. @@ -93,8 +72,6 @@ public BlobInputStreamOptions setBlockSize(Integer blockSize) { } /** - * Gets the {@link ConsistentReadControl} Default is E-Tag. - * * @return {@link ConsistentReadControl} Default is E-Tag. */ public ConsistentReadControl getConsistentReadControl() { @@ -102,8 +79,6 @@ public ConsistentReadControl getConsistentReadControl() { } /** - * Sets the {@link ConsistentReadControl} Default is E-Tag. - * * @param consistentReadControl {@link ConsistentReadControl} Default is E-Tag. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobParallelUploadOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobParallelUploadOptions.java index 681ff994ae620..3d4527aa9d5a3 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobParallelUploadOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobParallelUploadOptions.java @@ -45,7 +45,6 @@ public class BlobParallelUploadOptions { * @param dataFlux The data to write to the blob. Unlike other upload methods, this method does not require that * the {@code Flux} be replayable. In other words, it does not have to support multiple subscribers and is not * expected to produce the same values across subscriptions. - * @throws NullPointerException If {@code dataFlux} is null. */ public BlobParallelUploadOptions(Flux dataFlux) { StorageImplUtils.assertNotNull("dataFlux", dataFlux); @@ -56,14 +55,13 @@ public BlobParallelUploadOptions(Flux dataFlux) { /** * Constructs a new {@link BlobParallelUploadOptions}. - *

+ * * Use {@link #BlobParallelUploadOptions(InputStream)} instead to supply an InputStream without knowing the exact * length beforehand. * * @param dataStream The data to write to the blob. * @param length The exact length of the data. It is important that this value match precisely the length of the * data provided in the {@link InputStream}. - * @throws NullPointerException If {@code dataStream} is null. * @deprecated length is no longer necessary; use {@link #BlobParallelUploadOptions(InputStream)} instead. */ @Deprecated @@ -76,7 +74,6 @@ public BlobParallelUploadOptions(InputStream dataStream, long length) { * Note: the {@link InputStream} must be closed by the caller. * * @param dataStream The data to write to the blob. - * @throws NullPointerException If {@code dataStream} is null. */ public BlobParallelUploadOptions(InputStream dataStream) { this(dataStream, null); @@ -88,9 +85,6 @@ public BlobParallelUploadOptions(InputStream dataStream) { * * @param dataStream The data to write to the blob. * @param length Optional known length of the data, affects reactive behavior for backwards compatibility. - * @throws NullPointerException If {@code dataStream} is null. - * @throws IllegalArgumentException If {@code length} is specified and is less than 0 or greater than - * {@link Long#MAX_VALUE}. */ private BlobParallelUploadOptions(InputStream dataStream, Long length) { StorageImplUtils.assertNotNull("dataStream", dataStream); @@ -275,9 +269,7 @@ public BlobParallelUploadOptions setRequestConditions(BlobRequestConditions requ } /** - * Gets the computeMd5 property. - * - * @return Whether the library should calculate the md5 and send it for the service to verify. + * @return Whether or not the library should calculate the md5 and send it for the service to verify. */ public boolean isComputeMd5() { return computeMd5; @@ -286,7 +278,7 @@ public boolean isComputeMd5() { /** * Sets the computeMd5 property. * - * @param computeMd5 Whether the library should calculate the md5 and send it for the service to + * @param computeMd5 Whether or not the library should calculate the md5 and send it for the service to * verify. * @return The updated options. */ @@ -299,6 +291,7 @@ public BlobParallelUploadOptions setComputeMd5(boolean computeMd5) { * Gets the timeout. * * @return An optional timeout value beyond which a {@link RuntimeException} will be raised. + * * @deprecated Use {@link BlobClient#uploadWithResponse(BlobParallelUploadOptions, Duration, Context)} to * specify timeout. */ @@ -312,6 +305,7 @@ public Duration getTimeout() { * * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @return The updated options + * * @deprecated Use {@link BlobClient#uploadWithResponse(BlobParallelUploadOptions, Duration, Context)} to * specify timeout. */ @@ -322,8 +316,6 @@ public BlobParallelUploadOptions setTimeout(Duration timeout) { } /** - * Gets the {@link BlobImmutabilityPolicy}. - * * @return {@link BlobImmutabilityPolicy} */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -331,11 +323,8 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Sets the {@link BlobImmutabilityPolicy}. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param immutabilityPolicy {@link BlobImmutabilityPolicy} * @return The updated options. */ @@ -345,8 +334,6 @@ public BlobParallelUploadOptions setImmutabilityPolicy(BlobImmutabilityPolicy im } /** - * Gets if a legal hold should be placed on the blob. - * * @return If a legal hold should be placed on the blob. */ public Boolean isLegalHold() { @@ -354,11 +341,8 @@ public Boolean isLegalHold() { } /** - * Sets if a legal hold should be placed on the blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param legalHold Indicates if a legal hold should be placed on the blob. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobQueryOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobQueryOptions.java index a74b775cc23c6..8d51b41c0b1e6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobQueryOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobQueryOptions.java @@ -18,6 +18,7 @@ */ @Fluent public class BlobQueryOptions { + private final String expression; private final OutputStream outputStream; private BlobQuerySerialization inputSerialization; @@ -28,9 +29,7 @@ public class BlobQueryOptions { /** * Constructs a {@link BlobQueryOptions}. - * * @param expression The query expression. - * @throws NullPointerException If {@code expression} is null. */ public BlobQueryOptions(String expression) { StorageImplUtils.assertNotNull("expression", expression); @@ -40,10 +39,8 @@ public BlobQueryOptions(String expression) { /** * Constructs a {@link BlobQueryOptions}. - * * @param expression The query expression. * @param outputStream The OutputStream where the downloaded data will be written. - * @throws NullPointerException If {@code expression} or {@code outputStream} is null. */ public BlobQueryOptions(String expression, OutputStream outputStream) { StorageImplUtils.assertNotNull("expression", expression); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobReleaseLeaseOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobReleaseLeaseOptions.java index 6dea5e276d596..6ce493c6dd948 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobReleaseLeaseOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobReleaseLeaseOptions.java @@ -11,17 +11,10 @@ */ @Fluent public class BlobReleaseLeaseOptions { - private BlobLeaseRequestConditions requestConditions; - /** - * Creates a new instance of {@link BlobReleaseLeaseOptions}. - */ - public BlobReleaseLeaseOptions() { - } + private BlobLeaseRequestConditions requestConditions; /** - * Gets the {@link BlobLeaseRequestConditions}. - * * @return {@link BlobLeaseRequestConditions} */ public BlobLeaseRequestConditions getRequestConditions() { @@ -29,8 +22,6 @@ public BlobLeaseRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobLeaseRequestConditions}. - * * @param requestConditions {@link BlobLeaseRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobRenewLeaseOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobRenewLeaseOptions.java index 848da78af893b..954fb6b0ebf22 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobRenewLeaseOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobRenewLeaseOptions.java @@ -11,17 +11,10 @@ */ @Fluent public class BlobRenewLeaseOptions { - private BlobLeaseRequestConditions requestConditions; - /** - * Creates a new instance of {@link BlobRenewLeaseOptions}. - */ - public BlobRenewLeaseOptions() { - } + private BlobLeaseRequestConditions requestConditions; /** - * Gets the {@link BlobLeaseRequestConditions}. - * * @return {@link BlobLeaseRequestConditions} */ public BlobLeaseRequestConditions getRequestConditions() { @@ -29,8 +22,6 @@ public BlobLeaseRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobLeaseRequestConditions}. - * * @param requestConditions {@link BlobLeaseRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSeekableByteChannelReadOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSeekableByteChannelReadOptions.java index ac92a1a022b3d..cfafbcde3f724 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSeekableByteChannelReadOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSeekableByteChannelReadOptions.java @@ -14,17 +14,12 @@ */ @Fluent public final class BlobSeekableByteChannelReadOptions { + private Long initialPosition; private BlobRequestConditions requestConditions; private Integer readSizeInBytes; private ConsistentReadControl consistentReadControl; - /** - * Creates a new instance of {@link BlobSeekableByteChannelReadOptions}. - */ - public BlobSeekableByteChannelReadOptions() { - } - /** * Gets the starting position of the resulting {@link SeekableByteChannel}. The channel will come with a prefetched * range starting at this position. @@ -46,8 +41,6 @@ public BlobSeekableByteChannelReadOptions setInitialPosition(Long initialPositio } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -55,8 +48,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -66,22 +57,18 @@ public BlobSeekableByteChannelReadOptions setRequestConditions(BlobRequestCondit } /** - * Gets the size of each data read from the service. If read size is large, the channel will make fewer network - * calls, but each individual call will be larger. The default value is 4 MB. - * - * @return The size of each data read from the service. If read size is large, the channel will make fewer network - * calls, but each individual call will be larger. The default value is 4 MB. + * @return The size of each data read from the service. If read size is large, the channel will make + * fewer network calls, but each individual call will be larger. + * The default value is 4 MB. */ public Integer getReadSizeInBytes() { return readSizeInBytes; } /** - * Sets the size of each data read from the service. If read size is large, the channel will make fewer network - * calls, but each individual call will be larger. The default value is 4 MB. - * * @param readSizeInBytes The size of each data read from the service. If read size is large, the channel will make - * fewer network calls, but each individual call will be larger. The default value is 4 MB. + * fewer network calls, but each individual call will be larger. + * The default value is 4 MB. * @return The updated options. */ public BlobSeekableByteChannelReadOptions setReadSizeInBytes(Integer readSizeInBytes) { @@ -90,8 +77,6 @@ public BlobSeekableByteChannelReadOptions setReadSizeInBytes(Integer readSizeInB } /** - * Gets the {@link ConsistentReadControl} Default is E-Tag. - * * @return {@link ConsistentReadControl} Default is E-Tag. */ public ConsistentReadControl getConsistentReadControl() { @@ -99,8 +84,6 @@ public ConsistentReadControl getConsistentReadControl() { } /** - * Sets the {@link ConsistentReadControl} Default is E-Tag. - * * @param consistentReadControl {@link ConsistentReadControl} Default is E-Tag. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetAccessTierOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetAccessTierOptions.java index a8b7d4706df2b..ed9278069b157 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetAccessTierOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetAccessTierOptions.java @@ -13,16 +13,14 @@ */ @Fluent public class BlobSetAccessTierOptions { + private final AccessTier tier; private RehydratePriority priority; private String leaseId; private String tagsConditions; /** - * Creates a new instance of {@link BlobSetAccessTierOptions}. - * * @param tier The new tier for the blob. - * @throws NullPointerException If {@code tier} is null. */ public BlobSetAccessTierOptions(AccessTier tier) { StorageImplUtils.assertNotNull("tier", tier); @@ -30,8 +28,6 @@ public BlobSetAccessTierOptions(AccessTier tier) { } /** - * Gets the new tier for the blob. - * * @return The new tier for the blob. */ public AccessTier getTier() { @@ -39,8 +35,6 @@ public AccessTier getTier() { } /** - * Gets the priority to set for re-hydrating blobs. - * * @return Priority to set for re-hydrating blobs. */ public RehydratePriority getPriority() { @@ -48,8 +42,6 @@ public RehydratePriority getPriority() { } /** - * Sets the priority to set for re-hydrating blobs. - * * @param priority Priority to set for re-hydrating blobs. * @return The updated BlobSetAccessTierOptions. */ @@ -59,8 +51,6 @@ public BlobSetAccessTierOptions setPriority(RehydratePriority priority) { } /** - * Gets the lease ID the active lease on the blob must match. - * * @return The lease ID the active lease on the blob must match. */ public String getLeaseId() { @@ -68,8 +58,6 @@ public String getLeaseId() { } /** - * Sets the lease ID the active lease on the blob must match. - * * @param leaseId The lease ID the active lease on the blob must match. * @return The updated BlobSetAccessTierOptions. */ @@ -79,8 +67,6 @@ public BlobSetAccessTierOptions setLeaseId(String leaseId) { } /** - * Gets the SQL statement that apply to the tags of the blob. - * * @return The SQL statement that apply to the tags of the blob. */ public String getTagsConditions() { @@ -88,8 +74,6 @@ public String getTagsConditions() { } /** - * Sets the SQL statement that apply to the tags of the blob. - * * @param tagsConditions The SQL statement that apply to the tags of the blob. * @return The updated BlobSetAccessTierOptions. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetTagsOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetTagsOptions.java index 44f929267d7ab..b49b5d105bdd2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetTagsOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobSetTagsOptions.java @@ -15,14 +15,12 @@ */ @Fluent public class BlobSetTagsOptions { + private final Map tags; private BlobRequestConditions requestConditions; /** - * Creates a new instance of {@link BlobSetTagsOptions}. - * * @param tags Tags to associate with the blob. - * @throws NullPointerException If {@code tags} is null. */ public BlobSetTagsOptions(Map tags) { StorageImplUtils.assertNotNull("tags", tags); @@ -30,8 +28,6 @@ public BlobSetTagsOptions(Map tags) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -39,8 +35,6 @@ public Map getTags() { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -48,8 +42,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromFileOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromFileOptions.java index 65ca9b0ab0525..b3d654fdb506e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromFileOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromFileOptions.java @@ -29,7 +29,6 @@ public class BlobUploadFromFileOptions { * Constructs a {@link BlobUploadFromFileOptions}. * * @param filePath Path of the file to upload. - * @throws NullPointerException If {@code filePath} is null. */ public BlobUploadFromFileOptions(String filePath) { StorageImplUtils.assertNotNull("filePath", filePath); @@ -37,8 +36,6 @@ public BlobUploadFromFileOptions(String filePath) { } /** - * Gets the path of the file to upload. - * * @return The path of the file to upload */ public String getFilePath() { @@ -46,8 +43,6 @@ public String getFilePath() { } /** - * Gets the {@link ParallelTransferOptions}. - * * @return {@link ParallelTransferOptions} */ public ParallelTransferOptions getParallelTransferOptions() { @@ -55,8 +50,6 @@ public ParallelTransferOptions getParallelTransferOptions() { } /** - * Sets the {@link ParallelTransferOptions}. - * * @param parallelTransferOptions {@link ParallelTransferOptions} * @return The updated options. */ @@ -66,8 +59,6 @@ public BlobUploadFromFileOptions setParallelTransferOptions(ParallelTransferOpti } /** - * Gets the {@link BlobHttpHeaders}. - * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders getHeaders() { @@ -75,8 +66,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the {@link BlobHttpHeaders}. - * * @param headers {@link BlobHttpHeaders} * @return The updated {@code AppendBlobCreateOptions} */ @@ -86,8 +75,6 @@ public BlobUploadFromFileOptions setHeaders(BlobHttpHeaders headers) { } /** - * Gets the metadata to associate with the blob. - * * @return The metadata to associate with the blob. */ public Map getMetadata() { @@ -95,8 +82,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the blob. - * * @param metadata The metadata to associate with the blob. * @return The updated options */ @@ -106,8 +91,6 @@ public BlobUploadFromFileOptions setMetadata(Map metadata) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -115,8 +98,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -126,8 +107,6 @@ public BlobUploadFromFileOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier}. - * * @return {@link AccessTier} */ public AccessTier getTier() { @@ -135,8 +114,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier}. - * * @param tier {@link AccessTier} * @return The updated options. */ @@ -146,8 +123,6 @@ public BlobUploadFromFileOptions setTier(AccessTier tier) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -155,8 +130,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromUrlOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromUrlOptions.java index 17afe7fa64076..68aa4d584a6dc 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromUrlOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlobUploadFromUrlOptions.java @@ -29,8 +29,6 @@ public class BlobUploadFromUrlOptions { private BlobCopySourceTagsMode copySourceTags; /** - * Creates a new instance of {@link BlobUploadFromUrlOptions}. - * * @param sourceUrl The source URL to upload from. */ public BlobUploadFromUrlOptions(String sourceUrl) { @@ -39,8 +37,6 @@ public BlobUploadFromUrlOptions(String sourceUrl) { } /** - * Gets the source URL to upload from. - * * @return The source URL to upload from. */ public String getSourceUrl() { @@ -48,8 +44,6 @@ public String getSourceUrl() { } /** - * Gets the {@link BlobHttpHeaders}. - * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders getHeaders() { @@ -57,8 +51,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the {@link BlobHttpHeaders}. - * * @param headers {@link BlobHttpHeaders} * @return The updated options */ @@ -68,8 +60,6 @@ public BlobUploadFromUrlOptions setHeaders(BlobHttpHeaders headers) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -77,8 +67,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -88,8 +76,6 @@ public BlobUploadFromUrlOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier}. - * * @return {@link AccessTier} */ public AccessTier getTier() { @@ -97,8 +83,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier}. - * * @param tier {@link AccessTier} * @return The updated options. */ @@ -108,8 +92,6 @@ public BlobUploadFromUrlOptions setTier(AccessTier tier) { } /** - * Gets the MD5 hash of the content. - * * @return An MD5 hash of the content. This hash is used to verify the integrity of the content during transport. * When this header is specified, the storage service compares the hash of the content that has arrived with this * header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the operation @@ -120,8 +102,6 @@ public byte[] getContentMd5() { } /** - * Sets the MD5 hash of the content. - * * @param contentMd5 An MD5 hash of the block content. This hash is used to verify the integrity of the block during * transport. When this header is specified, the storage service compares the hash of the content that has arrived * with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the @@ -134,8 +114,6 @@ public BlobUploadFromUrlOptions setContentMd5(byte[] contentMd5) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getDestinationRequestConditions() { @@ -143,8 +121,6 @@ public BlobRequestConditions getDestinationRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param destinationRequestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -155,8 +131,6 @@ public BlobRequestConditions getDestinationRequestConditions() { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getSourceRequestConditions() { @@ -164,8 +138,6 @@ public BlobRequestConditions getSourceRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param sourceRequestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -195,9 +167,6 @@ public BlobUploadFromUrlOptions setCopySourceBlobProperties(Boolean copySourceBl } /** - * Gets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by - * Storage. - * * @return auth header for access to source. */ public HttpAuthorization getSourceAuthorization() { @@ -217,8 +186,6 @@ public BlobUploadFromUrlOptions setSourceAuthorization(HttpAuthorization sourceA } /** - * Gets the copy source tags mode - * * @return The copy source tags mode. */ public BlobCopySourceTagsMode getCopySourceTagsMode() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobCommitBlockListOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobCommitBlockListOptions.java index 0f96aaa63d078..3227f8f6ebae6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobCommitBlockListOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobCommitBlockListOptions.java @@ -28,8 +28,6 @@ public class BlockBlobCommitBlockListOptions { private Boolean legalHold; /** - * Creates a new instance of {@link BlockBlobCommitBlockListOptions}. - * * @param base64BlockIds A list of base64 encode {@code String}s that specifies the block IDs to be committed. */ public BlockBlobCommitBlockListOptions(List base64BlockIds) { @@ -37,8 +35,6 @@ public BlockBlobCommitBlockListOptions(List base64BlockIds) { } /** - * Gets the list of base64 encode {@code String}s that specifies the block IDs to be committed. - * * @return A list of base64 encode {@code String}s that specifies the block IDs to be committed. */ public List getBase64BlockIds() { @@ -46,8 +42,6 @@ public List getBase64BlockIds() { } /** - * Gets the {@link BlobHttpHeaders}. - * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders getHeaders() { @@ -55,8 +49,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the {@link BlobHttpHeaders}. - * * @param headers {@link BlobHttpHeaders} * @return The updated {@code AppendBlobCreateOptions} */ @@ -66,8 +58,6 @@ public BlockBlobCommitBlockListOptions setHeaders(BlobHttpHeaders headers) { } /** - * Gets the metadata to associate with the blob. - * * @return The metadata to associate with the blob. */ public Map getMetadata() { @@ -75,8 +65,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the blob. - * * @param metadata The metadata to associate with the blob. * @return The updated options */ @@ -86,8 +74,6 @@ public BlockBlobCommitBlockListOptions setMetadata(Map metadata) } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -95,8 +81,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -106,8 +90,6 @@ public BlockBlobCommitBlockListOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier}. - * * @return {@link AccessTier} */ public AccessTier getTier() { @@ -115,8 +97,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier}. - * * @param tier {@link AccessTier} * @return The updated options. */ @@ -126,8 +106,6 @@ public BlockBlobCommitBlockListOptions setTier(AccessTier tier) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -135,8 +113,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -146,8 +122,6 @@ public BlockBlobCommitBlockListOptions setRequestConditions(BlobRequestCondition } /** - * Gets the {@link BlobImmutabilityPolicy}. - * * @return {@link BlobImmutabilityPolicy} */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -155,11 +129,8 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Sets the {@link BlobImmutabilityPolicy}. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param immutabilityPolicy {@link BlobImmutabilityPolicy} * @return The updated options. */ @@ -169,8 +140,6 @@ public BlockBlobCommitBlockListOptions setImmutabilityPolicy(BlobImmutabilityPol } /** - * Gets if a legal hold should be placed on the blob. - * * @return If a legal hold should be placed on the blob. */ public Boolean isLegalHold() { @@ -178,11 +147,8 @@ public Boolean isLegalHold() { } /** - * Sets if a legal hold should be placed on the blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param legalHold Indicates if a legal hold should be placed on the blob. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobListBlocksOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobListBlocksOptions.java index 0c561a03eb213..fadc41b926a92 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobListBlocksOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobListBlocksOptions.java @@ -17,8 +17,6 @@ public class BlockBlobListBlocksOptions { private String ifTagsMatch; /** - * Creates a new instance of {@link BlockBlobListBlocksOptions}. - * * @param type Specifies which type of blocks to return. */ public BlockBlobListBlocksOptions(BlockListType type) { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobOutputStreamOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobOutputStreamOptions.java index e6385dfe5207e..224c46a4dc1d6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobOutputStreamOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobOutputStreamOptions.java @@ -22,14 +22,6 @@ public class BlockBlobOutputStreamOptions { private BlobRequestConditions requestConditions; /** - * Creates a new instance of {@link BlockBlobOutputStreamOptions}. - */ - public BlockBlobOutputStreamOptions() { - } - - /** - * Gets the {@link ParallelTransferOptions}. - * * @return {@link ParallelTransferOptions} */ public ParallelTransferOptions getParallelTransferOptions() { @@ -37,8 +29,6 @@ public ParallelTransferOptions getParallelTransferOptions() { } /** - * Sets the {@link ParallelTransferOptions}. - * * @param parallelTransferOptions {@link ParallelTransferOptions} * @return The updated options. */ @@ -48,8 +38,6 @@ public BlockBlobOutputStreamOptions setParallelTransferOptions(ParallelTransferO } /** - * Gets the {@link BlobHttpHeaders}. - * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders getHeaders() { @@ -57,8 +45,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the {@link BlobHttpHeaders}. - * * @param headers {@link BlobHttpHeaders} * @return The updated {@code AppendBlobCreateOptions} */ @@ -68,8 +54,6 @@ public BlockBlobOutputStreamOptions setHeaders(BlobHttpHeaders headers) { } /** - * Gets the metadata to associate with the blob. - * * @return The metadata to associate with the blob. */ public Map getMetadata() { @@ -77,8 +61,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the blob. - * * @param metadata The metadata to associate with the blob. * @return The updated options */ @@ -88,8 +70,6 @@ public BlockBlobOutputStreamOptions setMetadata(Map metadata) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -97,8 +77,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -108,8 +86,6 @@ public BlockBlobOutputStreamOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier}. - * * @return {@link AccessTier} */ public AccessTier getTier() { @@ -117,8 +93,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier}. - * * @param tier {@link AccessTier} * @return The updated options. */ @@ -128,8 +102,6 @@ public BlockBlobOutputStreamOptions setTier(AccessTier tier) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -137,8 +109,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSeekableByteChannelWriteOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSeekableByteChannelWriteOptions.java index 1234ea04c7386..fc543211548a7 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSeekableByteChannelWriteOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSeekableByteChannelWriteOptions.java @@ -3,6 +3,7 @@ package com.azure.storage.blob.options; import com.azure.core.util.ExpandableStringEnum; +import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobRequestConditions; @@ -15,6 +16,8 @@ * Options for obtaining a {@link java.nio.channels.SeekableByteChannel} backed by an Azure Storage Share File. */ public final class BlockBlobSeekableByteChannelWriteOptions { + private static final ClientLogger LOGGER = new ClientLogger(BlockBlobSeekableByteChannelWriteOptions.class); + /** * Mode to open the channel for writing. */ @@ -24,15 +27,6 @@ public static final class WriteMode extends ExpandableStringEnum { */ public static final WriteMode OVERWRITE = fromString("Overwrite"); - /** - * Creates a new instance of {@link WriteMode} with no string value. - * - * @deprecated Please use {@link #fromString(String)}. - */ - @Deprecated - public WriteMode() { - } - /** * Creates or finds a AccessTier from its string representation. * @@ -64,15 +58,12 @@ public static Collection values() { /** * Options constructor. * @param mode What usage mode to open the channel in. - * @throws NullPointerException If {@code mode} is null. */ public BlockBlobSeekableByteChannelWriteOptions(WriteMode mode) { writeMode = Objects.requireNonNull(mode, "'mode' cannot be null."); } /** - * Gets the usage mode to be used by the resulting channel. - * * @return Usage mode to be used by the resulting channel. */ public WriteMode getWriteMode() { @@ -80,8 +71,6 @@ public WriteMode getWriteMode() { } /** - * Gets the size of individual writes to the service. - * * @return The size of individual writes to the service. */ public Long getBlockSizeInBytes() { @@ -89,8 +78,6 @@ public Long getBlockSizeInBytes() { } /** - * Sets the size of individual writes to the service. - * * @param blockSizeInBytes The size of individual writes to the service. * @return The updated instance. */ @@ -100,8 +87,6 @@ public BlockBlobSeekableByteChannelWriteOptions setBlockSizeInBytes(Long blockSi } /** - * Gets the HTTP headers to write. - * * @return Blob HTTP headers to write. */ public BlobHttpHeaders getHeaders() { @@ -109,8 +94,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the HTTP headers to write. - * * @param headers Blob HTTP headers to write. * @return The updated instance. */ @@ -120,8 +103,6 @@ public BlockBlobSeekableByteChannelWriteOptions setHeaders(BlobHttpHeaders heade } /** - * Gets the metadata to write. - * * @return Blob metadata to write. */ public Map getMetadata() { @@ -129,8 +110,6 @@ public Map getMetadata() { } /** - * Sets the metadata to write. - * * @param metadata Blob metadata to write. * @return The updated instance. */ @@ -140,8 +119,6 @@ public BlockBlobSeekableByteChannelWriteOptions setMetadata(Map } /** - * Gets the tags to write. - * * @return Blob tags to write. */ public Map getTags() { @@ -149,8 +126,6 @@ public Map getTags() { } /** - * Sets the tags to write. - * * @param tags Blob tags to write. * @return The updated instance. */ @@ -160,8 +135,6 @@ public BlockBlobSeekableByteChannelWriteOptions setTags(Map tags } /** - * Gets the access tier for the target blob. - * * @return Access tier for the target blob. */ public AccessTier getTier() { @@ -169,8 +142,6 @@ public AccessTier getTier() { } /** - * Sets the access tier for the target blob. - * * @param tier Access tier for the target blob. * @return The updated instance. */ @@ -180,8 +151,6 @@ public BlockBlobSeekableByteChannelWriteOptions setTier(AccessTier tier) { } /** - * Gets the request conditions for writing to the blob. - * * @return Request conditions for writing to the blob. */ public BlobRequestConditions getRequestConditions() { @@ -189,8 +158,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the request conditions for writing to the blob. - * * @param conditions Request conditions for writing to the blob. * @return The updated instance. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSimpleUploadOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSimpleUploadOptions.java index bef1780c2f597..a0b2f488dffa8 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSimpleUploadOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobSimpleUploadOptions.java @@ -34,11 +34,8 @@ public class BlockBlobSimpleUploadOptions { private Boolean legalHold; /** - * Creates a new instance of {@link BlockBlobSimpleUploadOptions}. - * * @param data The data to write to the block. Note that this {@code BinaryData} must have defined length * and must be replayable if retries are enabled (the default), see {@link BinaryData#isReplayable()}. - * @throws NullPointerException If {@code data} is null or {@code data} does not have defined length. */ public BlockBlobSimpleUploadOptions(BinaryData data) { StorageImplUtils.assertNotNull("data must not be null", data); @@ -50,14 +47,10 @@ public BlockBlobSimpleUploadOptions(BinaryData data) { } /** - * Creates a new instance of {@link BlockBlobSimpleUploadOptions}. - * * @param data The data to write to the blob. Note that this {@code Flux} must be replayable if retries are enabled * (the default). In other words, the Flux must produce the same data each time it is subscribed to. * @param length The exact length of the data. It is important that this value match precisely the length of the * data emitted by the data source. - * @throws NullPointerException If {@code data} is null. - * @throws IllegalArgumentException If {@code length} is less than 0 or greater than {@link Long#MAX_VALUE}. */ public BlockBlobSimpleUploadOptions(Flux data, long length) { StorageImplUtils.assertNotNull("dataFlux", data); @@ -69,13 +62,9 @@ public BlockBlobSimpleUploadOptions(Flux data, long length) { } /** - * Creates a new instance of {@link BlockBlobSimpleUploadOptions}. - * * @param data The data to write to the blob. * @param length The exact length of the data. It is important that this value match precisely the length of the * data emitted by the data source. - * @throws NullPointerException If {@code data} is null. - * @throws IllegalArgumentException If {@code length} is less than 0 or greater than {@link Long#MAX_VALUE}. */ public BlockBlobSimpleUploadOptions(InputStream data, long length) { StorageImplUtils.assertNotNull("dataStream", data); @@ -87,8 +76,6 @@ public BlockBlobSimpleUploadOptions(InputStream data, long length) { } /** - * Gets the data to write to the blob. - * * @return The data to write to the blob. Note that this {@code Flux} must be replayable if retries are enabled * (the default). In other words, the Flux must produce the same data each time it is subscribed to. */ @@ -97,8 +84,6 @@ public Flux getDataFlux() { } /** - * Gets the data to write to the blob. - * * @return The data to write to the blob. */ public InputStream getDataStream() { @@ -106,8 +91,6 @@ public InputStream getDataStream() { } /** - * Gets the data to write to the blob. - * * @return The data to write to the blob. */ public BinaryData getData() { @@ -115,8 +98,6 @@ public BinaryData getData() { } /** - * Gets the exact length of the data. - * * @return The exact length of the data. It is important that this value match precisely the length of the * data emitted by the data source. */ @@ -125,8 +106,6 @@ public long getLength() { } /** - * Gets the {@link BlobHttpHeaders}. - * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders getHeaders() { @@ -134,8 +113,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the {@link BlobHttpHeaders}. - * * @param headers {@link BlobHttpHeaders} * @return The updated options */ @@ -145,8 +122,6 @@ public BlockBlobSimpleUploadOptions setHeaders(BlobHttpHeaders headers) { } /** - * Gets the metadata to associate with the blob. - * * @return The metadata to associate with the blob. */ public Map getMetadata() { @@ -154,8 +129,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the blob. - * * @param metadata The metadata to associate with the blob. * @return The updated options */ @@ -165,8 +138,6 @@ public BlockBlobSimpleUploadOptions setMetadata(Map metadata) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -174,8 +145,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -185,8 +154,6 @@ public BlockBlobSimpleUploadOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier}. - * * @return {@link AccessTier} */ public AccessTier getTier() { @@ -194,8 +161,6 @@ public AccessTier getTier() { } /** - * Sets the {@link AccessTier}. - * * @param tier {@link AccessTier} * @return The updated options. */ @@ -205,8 +170,6 @@ public BlockBlobSimpleUploadOptions setTier(AccessTier tier) { } /** - * Gets the MD5 hash of the content. - * * @return An MD5 hash of the content. This hash is used to verify the integrity of the content during * transport. When this header is specified, the storage service compares the hash of the content that has arrived * with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the @@ -217,8 +180,6 @@ public byte[] getContentMd5() { } /** - * Sets the MD5 hash of the content. - * * @param contentMd5 An MD5 hash of the block content. This hash is used to verify the integrity of the block during * transport. When this header is specified, the storage service compares the hash of the content that has arrived * with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the @@ -231,8 +192,6 @@ public BlockBlobSimpleUploadOptions setContentMd5(byte[] contentMd5) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -240,8 +199,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -251,8 +208,6 @@ public BlockBlobSimpleUploadOptions setRequestConditions(BlobRequestConditions r } /** - * Gets the {@link BlobImmutabilityPolicy}. - * * @return {@link BlobImmutabilityPolicy} */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -260,8 +215,6 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Sets the {@link BlobImmutabilityPolicy}. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. * @param immutabilityPolicy {@link BlobImmutabilityPolicy} @@ -273,8 +226,6 @@ public BlockBlobSimpleUploadOptions setImmutabilityPolicy(BlobImmutabilityPolicy } /** - * Gets if a legal hold should be placed on the blob. - * * @return If a legal hold should be placed on the blob. */ public Boolean isLegalHold() { @@ -282,8 +233,6 @@ public Boolean isLegalHold() { } /** - * Sets if a legal hold should be placed on the blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. * @param legalHold Indicates if a legal hold should be placed on the blob. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockFromUrlOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockFromUrlOptions.java index 923cc7bd991e0..49e73198ae78b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockFromUrlOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockFromUrlOptions.java @@ -23,8 +23,6 @@ public final class BlockBlobStageBlockFromUrlOptions { private HttpAuthorization sourceAuthorization; /** - * Creates a new instance of {@link BlockBlobStageBlockFromUrlOptions}. - * * @param base64BlockId The block ID to assign the new block. * @param sourceUrl The source URL to copy from. URLs outside of Azure may only be copied to block blobs. */ @@ -34,8 +32,6 @@ public BlockBlobStageBlockFromUrlOptions(String base64BlockId, String sourceUrl) } /** - * Gets the block ID to assign the new block. - * * @return The block ID to assign the new block. */ public String getBase64BlockId() { @@ -43,8 +39,6 @@ public String getBase64BlockId() { } /** - * Gets the source URL to upload from. - * * @return The source URL to upload from. */ public String getSourceUrl() { @@ -52,8 +46,6 @@ public String getSourceUrl() { } /** - * Gets the range of bytes to read from the source. - * * @return Range of bytes to read from the source. */ public BlobRange getSourceRange() { @@ -61,8 +53,6 @@ public BlobRange getSourceRange() { } /** - * Sets the range of bytes to read from the source. - * * @param sourceRange Range of bytes to read from the source. * @return The updated options. */ @@ -72,8 +62,6 @@ public BlockBlobStageBlockFromUrlOptions setSourceRange(BlobRange sourceRange) { } /** - * Gets the MD5 of the source content. - * * @return MD5 of the source content. */ public byte[] getSourceContentMd5() { @@ -81,8 +69,6 @@ public byte[] getSourceContentMd5() { } /** - * Sets the MD5 of the source content. - * * @param sourceContentMd5 MD5 of the source content. * @return The updated options. */ @@ -92,8 +78,6 @@ public BlockBlobStageBlockFromUrlOptions setSourceContentMd5(byte[] sourceConten } /** - * Gets the lease ID for accessing source content. - * * @return Lease ID for accessing source content. */ public String getLeaseId() { @@ -101,8 +85,6 @@ public String getLeaseId() { } /** - * Sets the lease ID for accessing source content. - * * @param leaseId Lease ID for accessing source content. * @return The updated options. */ @@ -112,8 +94,6 @@ public BlockBlobStageBlockFromUrlOptions setLeaseId(String leaseId) { } /** - * Gets the {@link BlobRequestConditions} for accessing source content. - * * @return {@link BlobRequestConditions} for accessing source content. */ public BlobRequestConditions getSourceRequestConditions() { @@ -121,8 +101,6 @@ public BlobRequestConditions getSourceRequestConditions() { } /** - * Sets the {@link BlobRequestConditions} for accessing source content. - * * @param sourceRequestConditions {@link BlobRequestConditions} for accessing source content. * @return The updated options. */ @@ -132,9 +110,6 @@ public BlockBlobStageBlockFromUrlOptions setSourceRequestConditions(BlobRequestC } /** - * Gets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by - * Storage. - * * @return auth header to access source. */ public HttpAuthorization getSourceAuthorization() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockOptions.java index 37445b450a28e..e9d5c78bfe187 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockOptions.java @@ -19,12 +19,9 @@ public final class BlockBlobStageBlockOptions { private byte[] contentMd5; /** - * Creates a new instance of {@link BlockBlobStageBlockOptions}. - * * @param base64BlockId The block ID to assign the new block. * @param data The data to write to the block. Note that this {@code BinaryData} must have defined length * and must be replayable if retries are enabled (the default), see {@link BinaryData#isReplayable()}. - * @throws NullPointerException If {@code base64BlockId} or {@code data} is null. */ public BlockBlobStageBlockOptions(String base64BlockId, BinaryData data) { StorageImplUtils.assertNotNull("base64BlockId must not be null", base64BlockId); @@ -35,8 +32,6 @@ public BlockBlobStageBlockOptions(String base64BlockId, BinaryData data) { } /** - * Gets the block ID to assign the new block. - * * @return The block ID to assign the new block. */ public String getBase64BlockId() { @@ -44,8 +39,6 @@ public String getBase64BlockId() { } /** - * Gets the data to write to the blob. - * * @return The data to write to the blob. */ public BinaryData getData() { @@ -53,8 +46,6 @@ public BinaryData getData() { } /** - * Gets the lease ID for accessing source content. - * * @return Lease ID for accessing source content. */ public String getLeaseId() { @@ -62,8 +53,6 @@ public String getLeaseId() { } /** - * Sets the lease ID for accessing source content. - * * @param leaseId Lease ID for accessing source content. * @return The updated options. */ @@ -73,8 +62,6 @@ public BlockBlobStageBlockOptions setLeaseId(String leaseId) { } /** - * Gets the MD5 of the block content. - * * @return An MD5 hash of the content. This hash is used to verify the integrity of the content during * transport. When this header is specified, the storage service compares the hash of the content that has arrived * with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the @@ -85,8 +72,6 @@ public byte[] getContentMd5() { } /** - * Sets the MD5 of the block content. - * * @param contentMd5 An MD5 hash of the block content. This hash is used to verify the integrity of the block during * transport. When this header is specified, the storage service compares the hash of the content that has arrived * with this header value. Note that this MD5 hash is not stored with the blob. If the two hashes do not match, the diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/FindBlobsOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/FindBlobsOptions.java index 35b00eaf8d40f..73d8ac6774547 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/FindBlobsOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/FindBlobsOptions.java @@ -22,10 +22,7 @@ public class FindBlobsOptions { private Integer maxResultsPerPage; /** - * Creates a new instance of {@link FindBlobsOptions}. - * * @param query Filters the results to return only blobs whose tags match the specified expression. - * @throws NullPointerException If {@code query} is null. */ public FindBlobsOptions(String query) { StorageImplUtils.assertNotNull("query", query); @@ -33,8 +30,6 @@ public FindBlobsOptions(String query) { } /** - * Gets the filters the results to return only blobs whose tags match the specified expression. - * * @return Filters the results to return only blobs whose tags match the specified expression. */ public String getQuery() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java index 1e22f0263293c..42b01c2852c49 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java @@ -19,11 +19,8 @@ public class ListPageRangesDiffOptions { private Integer pageSize; /** - * Creates a new instance of {@link ListPageRangesDiffOptions}. - * * @param range The range to diff. * @param previousSnapshot The previous snapshot that will serve as the base of the diff. - * @throws NullPointerException If {@code range} or {@code previousSnapshot} is null. */ public ListPageRangesDiffOptions(BlobRange range, String previousSnapshot) { Objects.requireNonNull(range); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java index 2d4953b3f59e3..3c7282a686a3c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java @@ -18,10 +18,7 @@ public class ListPageRangesOptions { private Integer pageSize; /** - * Creates a new instance of {@link ListPageRangesOptions}. - * * @param range The range to diff. - * @throws NullPointerException If {@code range} is null. */ public ListPageRangesOptions(BlobRange range) { Objects.requireNonNull(range); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCopyIncrementalOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCopyIncrementalOptions.java index d6962ad4f6b07..a221064153196 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCopyIncrementalOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCopyIncrementalOptions.java @@ -18,11 +18,8 @@ public class PageBlobCopyIncrementalOptions { private PageBlobCopyIncrementalRequestConditions requestConditions; /** - * Creates a new instance of {@link PageBlobCopyIncrementalOptions}. - * * @param source The source page blob. * @param snapshot The snapshot on the copy source. - * @throws NullPointerException If {@code source} or {@code snapshot} is null. */ public PageBlobCopyIncrementalOptions(String source, String snapshot) { StorageImplUtils.assertNotNull("source", source); @@ -32,8 +29,6 @@ public PageBlobCopyIncrementalOptions(String source, String snapshot) { } /** - * Gets the source page blob. - * * @return The source page blob. */ public String getSource() { @@ -41,8 +36,6 @@ public String getSource() { } /** - * Gets the snapshot on the copy source. - * * @return The snapshot on the copy source. */ public String getSnapshot() { @@ -50,8 +43,6 @@ public String getSnapshot() { } /** - * Gets the {@link PageBlobCopyIncrementalRequestConditions} for the destination. - * * @return {@link PageBlobCopyIncrementalRequestConditions} for the destination. */ public PageBlobCopyIncrementalRequestConditions getRequestConditions() { @@ -59,8 +50,6 @@ public PageBlobCopyIncrementalRequestConditions getRequestConditions() { } /** - * Sets the {@link PageBlobCopyIncrementalRequestConditions} for the blob. - * * @param requestConditions {@link PageBlobCopyIncrementalRequestConditions} for the blob. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCreateOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCreateOptions.java index 0ea380380c873..915b1da1071c9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCreateOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobCreateOptions.java @@ -23,8 +23,6 @@ public class PageBlobCreateOptions { private Boolean legalHold; /** - * Creates a new instance of {@link PageBlobCreateOptions}. - * * @param size Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a * 512-byte boundary. */ @@ -33,8 +31,6 @@ public PageBlobCreateOptions(long size) { } /** - * Gets the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512-byte boundary. - * * @return Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a * 512-byte boundary. */ @@ -43,9 +39,6 @@ public long getSize() { } /** - * Gets a user-controlled value that you can use to track requests. The value of the sequence number must be - * between 0 and 2^63 - 1.The default value is 0. - * * @return A user-controlled value that you can use to track requests. The value of the sequence * number must be between 0 and 2^63 - 1.The default value is 0. */ @@ -54,9 +47,6 @@ public Long getSequenceNumber() { } /** - * Sets a user-controlled value that you can use to track requests. The value of the sequence number must be - * between 0 and 2^63 - 1.The default value is 0. - * * @param sequenceNumber A user-controlled value that you can use to track requests. The value of the sequence * number must be between 0 and 2^63 - 1.The default value is 0. * @return The updated options. @@ -67,8 +57,6 @@ public PageBlobCreateOptions setSequenceNumber(Long sequenceNumber) { } /** - * Gets the {@link BlobHttpHeaders}. - * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders getHeaders() { @@ -76,8 +64,6 @@ public BlobHttpHeaders getHeaders() { } /** - * Sets the {@link BlobHttpHeaders}. - * * @param headers {@link BlobHttpHeaders} * @return The updated {@code AppendBlobCreateOptions} */ @@ -87,8 +73,6 @@ public PageBlobCreateOptions setHeaders(BlobHttpHeaders headers) { } /** - * Gets the metadata to associate with the blob. - * * @return The metadata to associate with the blob. */ public Map getMetadata() { @@ -96,8 +80,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the blob. - * * @param metadata The metadata to associate with the blob. * @return The updated options. */ @@ -107,8 +89,6 @@ public PageBlobCreateOptions setMetadata(Map metadata) { } /** - * Gets the tags to associate with the blob. - * * @return The tags to associate with the blob. */ public Map getTags() { @@ -116,8 +96,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the blob. - * * @param tags The tags to associate with the blob. * @return The updated options. */ @@ -127,8 +105,6 @@ public PageBlobCreateOptions setTags(Map tags) { } /** - * Gets the {@link BlobRequestConditions}. - * * @return {@link BlobRequestConditions} */ public BlobRequestConditions getRequestConditions() { @@ -136,8 +112,6 @@ public BlobRequestConditions getRequestConditions() { } /** - * Sets the {@link BlobRequestConditions}. - * * @param requestConditions {@link BlobRequestConditions} * @return The updated options. */ @@ -147,8 +121,6 @@ public PageBlobCreateOptions setRequestConditions(BlobRequestConditions requestC } /** - * Gets the {@link BlobImmutabilityPolicy}. - * * @return {@link BlobImmutabilityPolicy} */ public BlobImmutabilityPolicy getImmutabilityPolicy() { @@ -156,11 +128,8 @@ public BlobImmutabilityPolicy getImmutabilityPolicy() { } /** - * Sets the {@link BlobImmutabilityPolicy}. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param immutabilityPolicy {@link BlobImmutabilityPolicy} * @return The updated options. */ @@ -170,8 +139,6 @@ public PageBlobCreateOptions setImmutabilityPolicy(BlobImmutabilityPolicy immuta } /** - * Gets if a legal hold should be placed on the blob. - * * @return If a legal hold should be placed on the blob. */ public Boolean isLegalHold() { @@ -179,11 +146,8 @@ public Boolean isLegalHold() { } /** - * Sets if a legal hold should be placed on the blob. - *

* Note that this parameter is only applicable to a blob within a container that has immutable storage with * versioning enabled. - * * @param legalHold Indicates if a legal hold should be placed on the blob. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobUploadPagesFromUrlOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobUploadPagesFromUrlOptions.java index 45b0ea5630e3c..5f6f46377369f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobUploadPagesFromUrlOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobUploadPagesFromUrlOptions.java @@ -24,8 +24,6 @@ public final class PageBlobUploadPagesFromUrlOptions { private HttpAuthorization sourceAuthorization; /** - * Creates a new instance of {@link PageBlobUploadPagesFromUrlOptions}. - * * @param range The destination page range. Pages must be aligned to 512 byte blocks. * @param sourceUrl The source URL to copy from. URLs outside of Azure may only be copied to block blobs. */ @@ -35,7 +33,6 @@ public PageBlobUploadPagesFromUrlOptions(PageRange range, String sourceUrl) { } /** - * Gets the destination page range. * @return The destination page range. */ public PageRange getRange() { @@ -43,8 +40,6 @@ public PageRange getRange() { } /** - * Gets the source URL to copy from. - * * @return the source URL to copy from. */ public String getSourceUrl() { @@ -52,8 +47,6 @@ public String getSourceUrl() { } /** - * Gets the offset at source to copy from. - * * @return Offset at source to copy from. */ public Long getSourceOffset() { @@ -61,8 +54,6 @@ public Long getSourceOffset() { } /** - * Sets the offset at source to copy from. - * * @param sourceOffset Offset at source to copy from. * @return The updated options. */ @@ -72,8 +63,6 @@ public PageBlobUploadPagesFromUrlOptions setSourceOffset(Long sourceOffset) { } /** - * Gets the content MD5 of source content to copy. - * * @return Content MD5 of source content to copy. */ public byte[] getSourceContentMd5() { @@ -81,8 +70,6 @@ public byte[] getSourceContentMd5() { } /** - * Sets the content MD5 of source content to copy. - * * @param sourceContentMd5 Content MD5 of source content to copy. * @return The updated options. */ @@ -92,8 +79,6 @@ public PageBlobUploadPagesFromUrlOptions setSourceContentMd5(byte[] sourceConten } /** - * Gets {@link PageBlobRequestConditions} for writing to destination. - * * @return {@link PageBlobRequestConditions} for writing to destination. */ public PageBlobRequestConditions getDestinationRequestConditions() { @@ -101,8 +86,6 @@ public PageBlobRequestConditions getDestinationRequestConditions() { } /** - * Sets {@link PageBlobRequestConditions} for writing to destination. - * * @param destinationRequestConditions {@link PageBlobRequestConditions} for writing to destination. * @return The updated options. */ @@ -113,8 +96,6 @@ public PageBlobRequestConditions getDestinationRequestConditions() { } /** - * Gets {@link BlobRequestConditions} for accessing source content. - * * @return {@link BlobRequestConditions} for accessing source content. */ public BlobRequestConditions getSourceRequestConditions() { @@ -122,8 +103,6 @@ public BlobRequestConditions getSourceRequestConditions() { } /** - * Sets {@link BlobRequestConditions} for accessing source content. - * * @param sourceRequestConditions {@link BlobRequestConditions} for accessing source content. * @return The updated options. */ @@ -133,9 +112,6 @@ public PageBlobUploadPagesFromUrlOptions setSourceRequestConditions(BlobRequestC } /** - * Gets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by - * Storage. - * * @return auth header for accessing source content. */ public HttpAuthorization getSourceAuthorization() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/UndeleteBlobContainerOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/UndeleteBlobContainerOptions.java index 2660163c1b76a..ecbf74ffd52b5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/UndeleteBlobContainerOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/UndeleteBlobContainerOptions.java @@ -20,7 +20,6 @@ public class UndeleteBlobContainerOptions { * * @param deletedContainerName The name of the previously deleted container. * @param deletedContainerVersion The version of the previously deleted container. - * @throws NullPointerException If {@code deletedContainerName} or {@code deletedContainerVersion} is null. */ public UndeleteBlobContainerOptions(String deletedContainerName, String deletedContainerVersion) { StorageImplUtils.assertNotNull("deletedContainerName", deletedContainerName); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobContainerSasPermission.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobContainerSasPermission.java index e34e3e122fd18..911d29e737385 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobContainerSasPermission.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobContainerSasPermission.java @@ -15,16 +15,27 @@ */ public final class BlobContainerSasPermission { private boolean readPermission; + private boolean addPermission; + private boolean createPermission; + private boolean writePermission; + private boolean deletePermission; + private boolean deleteVersionPermission; + private boolean listPermission; + private boolean tagsPermission; + private boolean movePermission; + private boolean executePermission; + private boolean filterPermission; + private boolean immutabilityPolicyPermission; /** @@ -105,8 +116,6 @@ public static BlobContainerSasPermission parse(String permissionString) { } /** - * Gets the read permission status. - * * @return the read permission status */ public boolean hasReadPermission() { @@ -125,8 +134,6 @@ public BlobContainerSasPermission setReadPermission(boolean hasReadPermission) { } /** - * Gets the add permission status. - * * @return the add permission status */ public boolean hasAddPermission() { @@ -145,8 +152,6 @@ public BlobContainerSasPermission setAddPermission(boolean hasAddPermission) { } /** - * Gets the create permission status. - * * @return the create permission status */ public boolean hasCreatePermission() { @@ -165,8 +170,6 @@ public BlobContainerSasPermission setCreatePermission(boolean hasCreatePermissio } /** - * Gets the write permission status. - * * @return the write permission status */ public boolean hasWritePermission() { @@ -185,8 +188,6 @@ public BlobContainerSasPermission setWritePermission(boolean hasWritePermission) } /** - * Gets the delete permission status. - * * @return the delete permission status */ public boolean hasDeletePermission() { @@ -205,8 +206,6 @@ public BlobContainerSasPermission setDeletePermission(boolean hasDeletePermissio } /** - * Gets the delete version permission status. - * * @return the delete version permission status */ public boolean hasDeleteVersionPermission() { @@ -225,8 +224,6 @@ public BlobContainerSasPermission setDeleteVersionPermission(boolean hasDeleteVe } /** - * Gets the list permission status. - * * @return the list permission status */ public boolean hasListPermission() { @@ -245,8 +242,6 @@ public BlobContainerSasPermission setListPermission(boolean hasListPermission) { } /** - * Gets the tags permission status. - * * @return the tags permission status. */ public boolean hasTagsPermission() { @@ -265,8 +260,6 @@ public BlobContainerSasPermission setTagsPermission(boolean tagsPermission) { } /** - * Gets the move permission status. - * * @return the move permission status. */ public boolean hasMovePermission() { @@ -285,8 +278,6 @@ public BlobContainerSasPermission setMovePermission(boolean hasMovePermission) { } /** - * Gets the execute permission status. - * * @return the execute permission status. */ public boolean hasExecutePermission() { @@ -305,8 +296,6 @@ public BlobContainerSasPermission setExecutePermission(boolean hasExecutePermiss } /** - * Gets the filter permission status. - * * @return the filter permission status. */ public boolean hasFilterPermission() { @@ -325,8 +314,6 @@ public BlobContainerSasPermission setFilterPermission(boolean hasFilterPermissio } /** - * Gets the set immutability policy permission status. - * * @return the set immutability policy permission status. */ public boolean hasImmutabilityPolicyPermission() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobSasPermission.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobSasPermission.java index 26767e7389bfa..71caaa1683d4f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobSasPermission.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobSasPermission.java @@ -14,17 +14,29 @@ * this class guarantees correctness. */ public final class BlobSasPermission { + private boolean readPermission; + private boolean addPermission; + private boolean createPermission; + private boolean writePermission; + private boolean deletePermission; + private boolean deleteVersionPermission; + private boolean permanentDeletePermission; + private boolean tagsPermission; + private boolean listPermission; + private boolean movePermission; + private boolean executePermission; + private boolean immutabilityPolicyPermission; /** @@ -105,8 +117,6 @@ public static BlobSasPermission parse(String permissionString) { } /** - * Gets the read permission status. - * * @return the read permission status. */ public boolean hasReadPermission() { @@ -125,8 +135,6 @@ public BlobSasPermission setReadPermission(boolean hasReadPermission) { } /** - * Gets the add permission status. - * * @return the add permission status. */ public boolean hasAddPermission() { @@ -145,8 +153,6 @@ public BlobSasPermission setAddPermission(boolean hasAddPermission) { } /** - * Gets the create permission status. - * * @return the create permission status. */ public boolean hasCreatePermission() { @@ -165,8 +171,6 @@ public BlobSasPermission setCreatePermission(boolean hasCreatePermission) { } /** - * Gets the write permission status. - * * @return the write permission status. */ public boolean hasWritePermission() { @@ -185,8 +189,6 @@ public BlobSasPermission setWritePermission(boolean hasWritePermission) { } /** - * Gets the delete permission status. - * * @return the delete permission status. */ public boolean hasDeletePermission() { @@ -205,8 +207,6 @@ public BlobSasPermission setDeletePermission(boolean hasDeletePermission) { } /** - * Gets the delete version permission status. - * * @return the delete version permission status. */ public boolean hasDeleteVersionPermission() { @@ -225,8 +225,6 @@ public BlobSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPerm } /** - * Gets the permanent delete permission status. - * * @return the permanent delete permission status. */ public boolean hasPermanentDeletePermission() { @@ -245,8 +243,6 @@ public BlobSasPermission setPermanentDeletePermission(boolean permanentDeletePer } /** - * Gets the tags permission status. - * * @return the tags permission status. */ public boolean hasTagsPermission() { @@ -265,8 +261,6 @@ public BlobSasPermission setTagsPermission(boolean tagsPermission) { } /** - * Gets the list permission status. - * * @return the list permission status. */ public boolean hasListPermission() { @@ -285,8 +279,6 @@ public BlobSasPermission setListPermission(boolean hasListPermission) { } /** - * Gets the move permission status. - * * @return the move permission status. */ public boolean hasMovePermission() { @@ -305,8 +297,6 @@ public BlobSasPermission setMovePermission(boolean hasMovePermission) { } /** - * Gets the execute permission status. - * * @return the execute permission status. */ public boolean hasExecutePermission() { @@ -325,8 +315,6 @@ public BlobSasPermission setExecutePermission(boolean hasExecutePermission) { } /** - * Gets the set immutability policy permission status. - * * @return the set immutability policy permission status. */ public boolean hasImmutabilityPolicyPermission() { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobServiceSasSignatureValues.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobServiceSasSignatureValues.java index 113672d9522c9..6793e0ff5ead0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobServiceSasSignatureValues.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/sas/BlobServiceSasSignatureValues.java @@ -8,10 +8,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.BlobServiceVersion; import com.azure.storage.blob.models.UserDelegationKey; -import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.StorageImplUtils; +import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.sas.SasIpRange; import com.azure.storage.common.sas.SasProtocol; @@ -65,27 +65,43 @@ public final class BlobServiceSasSignatureValues { .get(Constants.PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, BlobServiceVersion.V2019_12_12.getVersion()); private SasProtocol protocol; + private OffsetDateTime startTime; + private OffsetDateTime expiryTime; + private String permissions; + private SasIpRange sasIpRange; + private String containerName; + private String blobName; + private String resource; + private String snapshotId; + private String identifier; + private String cacheControl; + private String contentDisposition; + private String contentEncoding; + private String contentLanguage; + private String contentType; + private String preauthorizedAgentObjectId; /* saoid */ + private String correlationId; + private String encryptionScope; /** * Creates an object with empty values for all fields. - * * @deprecated Please use {@link #BlobServiceSasSignatureValues(String)}, * {@link #BlobServiceSasSignatureValues(OffsetDateTime, BlobSasPermission)}, or * {@link #BlobServiceSasSignatureValues(OffsetDateTime, BlobContainerSasPermission)} @@ -135,7 +151,7 @@ public BlobServiceSasSignatureValues(String identifier) { * Creates an object with the specified values. * * @param version The version of the service this SAS will target. If not specified, it will default to the version - * targeted by the library. + * targeted by the library. * @param sasProtocol The {@link SasProtocol} which determines the protocols allowed by the SAS. * @param startTime When the SAS will take effect. * @param expiryTime The time after which the SAS will no longer work. @@ -170,9 +186,6 @@ public BlobServiceSasSignatureValues(String version, SasProtocol sasProtocol, Of } /** - * Gets the version of the service this SAS will target. If not specified, it will default to the version targeted - * by the library. - * * @return the version of the service this SAS will target. If not specified, it will default to the version * targeted by the library. */ @@ -196,8 +209,6 @@ public BlobServiceSasSignatureValues setVersion(String version) { } /** - * Gets the {@link SasProtocol} which determines the protocols allowed by the SAS. - * * @return the {@link SasProtocol} which determines the protocols allowed by the SAS. */ public SasProtocol getProtocol() { @@ -216,8 +227,6 @@ public BlobServiceSasSignatureValues setProtocol(SasProtocol protocol) { } /** - * Gets when the SAS will take effect. - * * @return when the SAS will take effect. */ public OffsetDateTime getStartTime() { @@ -236,8 +245,6 @@ public BlobServiceSasSignatureValues setStartTime(OffsetDateTime startTime) { } /** - * Gets the time after which the SAS will no longer work. - * * @return the time after which the SAS will no longer work. */ public OffsetDateTime getExpiryTime() { @@ -256,9 +263,6 @@ public BlobServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime) { } /** - * Gets the permissions string allowed by the SAS. Please refer to either {@link BlobContainerSasPermission} or - * {@link BlobSasPermission} depending on the resource being accessed for help determining the permissions allowed. - * * @return the permissions string allowed by the SAS. Please refer to either {@link BlobContainerSasPermission} or * {@link BlobSasPermission} depending on the resource being accessed for help determining the permissions allowed. */ @@ -293,8 +297,6 @@ public BlobServiceSasSignatureValues setPermissions(BlobContainerSasPermission p } /** - * Gets the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. - * * @return the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. */ public SasIpRange getSasIpRange() { @@ -304,9 +306,9 @@ public SasIpRange getSasIpRange() { /** * Sets the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. * + * @see Specifying IP Address or IP range * @param sasIpRange Allowed IP range to set * @return the updated BlobServiceSASSignatureValues object - * @see Specifying IP Address or IP range */ public BlobServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange) { this.sasIpRange = sasIpRange; @@ -367,8 +369,6 @@ public BlobServiceSasSignatureValues setBlobName(String blobName) { } /** - * Gets the specific snapshot the SAS user may access. - * * @return the specific snapshot the SAS user may access. * @deprecated Snapshot id is now auto-populated by the SAS generation methods provided on the desired (snapshot) * blob client. @@ -399,10 +399,6 @@ public BlobServiceSasSignatureValues setSnapshotId(String snapshotId) { } /** - * Gets the name of the access policy on the container this SAS references if any. Please see - * here - * for more information. - * * @return the name of the access policy on the container this SAS references if any. Please see * here * for more information. @@ -425,8 +421,6 @@ public BlobServiceSasSignatureValues setIdentifier(String identifier) { } /** - * Gets the encryption scope to use for the SAS. - * * @return the cache-control header for the SAS. */ public String getCacheControl() { @@ -445,8 +439,6 @@ public BlobServiceSasSignatureValues setCacheControl(String cacheControl) { } /** - * Gets the content-disposition header for the SAS. - * * @return the content-disposition header for the SAS. */ public String getContentDisposition() { @@ -465,8 +457,6 @@ public BlobServiceSasSignatureValues setContentDisposition(String contentDisposi } /** - * Gets the content-encoding header for the SAS. - * * @return the content-encoding header for the SAS. */ public String getContentEncoding() { @@ -485,8 +475,6 @@ public BlobServiceSasSignatureValues setContentEncoding(String contentEncoding) } /** - * Gets the content-language header for the SAS. - * * @return the content-language header for the SAS. */ public String getContentLanguage() { @@ -505,8 +493,6 @@ public BlobServiceSasSignatureValues setContentLanguage(String contentLanguage) } /** - * Gets the content-type header for the SAS. - * * @return the content-type header for the SAS. */ public String getContentType() { @@ -525,9 +511,6 @@ public BlobServiceSasSignatureValues setContentType(String contentType) { } /** - * Gets the AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the - * action granted by the SAS token. - * * @return The AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform * the action granted by the SAS token. The service will validate the SAS token and ensure that the owner of the * user delegation key has the required permissions before granting access but no additional permission check for @@ -553,8 +536,6 @@ public BlobServiceSasSignatureValues setPreauthorizedAgentObjectId(String preaut } /** - * Gets the encryption scope to use for the SAS. - * * @return the correlation id value for the SAS. */ public String getCorrelationId() { @@ -654,7 +635,7 @@ public BlobServiceSasSignatureValues setCorrelationId(String correlationId) { * @throws IllegalArgumentException if {@link #getPermissions()} contains an invalid character for the SAS resource. * @throws NullPointerException if {@code delegationKey} or {@code account} is null. * @see - * Create a user delegation SAS + * Create a user delegation SAS * @deprecated Please use the generateUserDelegationSas(BlobServiceSasSignatureValues, UserDelegationKey) method on * the desired container/blob client after initializing {@link BlobServiceSasSignatureValues}. */ @@ -679,14 +660,14 @@ public BlobServiceSasQueryParameters generateSasQueryParameters(UserDelegationKe /** * Ensures that the builder's properties are in a consistent state. - *

+ * 1. If there is no version, use latest. * 2. Resource name is chosen by: - * a. If "BlobName" is _not_ set, it is a container resource. - * b. Otherwise, if "SnapshotId" is set, it is a blob snapshot resource. - * c. Otherwise, it is a blob resource. + * a. If "BlobName" is _not_ set, it is a container resource. + * b. Otherwise, if "SnapshotId" is set, it is a blob snapshot resource. + * c. Otherwise, it is a blob resource. * 3. Reparse permissions depending on what the resource is. If it is an unrecognised resource, do nothing. - *

+ * * Taken from: * https://github.com/Azure/azure-storage-blob-go/blob/master/azblob/sas_service.go#L33 * https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java index 6b24aac311bec..4a2c112a543ff 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java @@ -80,12 +80,6 @@ public final class BlobLeaseClientBuilder { private String accountName; private BlobServiceVersion serviceVersion; - /** - * Creates a {@link BlobLeaseClientBuilder}. - */ - public BlobLeaseClientBuilder() { - } - /** * Creates a {@link BlobLeaseClient} based on the configurations set in the builder. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/SpecializedBlobClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/SpecializedBlobClientBuilder.java index 50fea2ae1bd30..e7ab2764b438f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/SpecializedBlobClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/SpecializedBlobClientBuilder.java @@ -104,12 +104,6 @@ public final class SpecializedBlobClientBuilder implements TokenCredentialTrait< private BlobServiceVersion version; private BlobAudience audience; - /** - * Creates a new instance of {@link SpecializedBlobClientBuilder}. - */ - public SpecializedBlobClientBuilder() { - } - /** * Creates a {@link AppendBlobClient} based on options set in the Builder. AppendBlobClients are used to perform * append blob specific operations such as {@link AppendBlobClient#appendBlock(InputStream, long) append block}, diff --git a/sdk/storage/azure-storage-blob/src/samples/README.md b/sdk/storage/azure-storage-blob/src/samples/README.md index dda895dff7529..c6440cd0c5976 100644 --- a/sdk/storage/azure-storage-blob/src/samples/README.md +++ b/sdk/storage/azure-storage-blob/src/samples/README.md @@ -58,7 +58,7 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [samples_list_containers]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/ListContainersExample.java [samples_metadata]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/SetMetadataAndHTTPHeadersExample.java [samples_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/AzureIdentityExample.java -[storageblob_rest]: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[storageblob_rest]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2Fsrc%2Fsamples%2FREADME.png) diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 0c0037216c7ed..776090bebb13e 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -15,22 +15,28 @@ autorest ### Code generation settings ``` yaml -use: '@autorest/java@4.1.42' +use: '@autorest/java@4.1.39' input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/refs/heads/feature/storage/stg96base2/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-01-05/blob.json java: true output-folder: ../ namespace: com.azure.storage.blob generate-client-as-impl: true +generate-client-interfaces: false +service-interface-as-public: true license-header: MICROSOFT_MIT_SMALL enable-sync-stack: true +context-client-method-parameter: true optional-constant-as-enum: true default-http-exception-type: com.azure.storage.blob.implementation.models.BlobStorageExceptionInternal models-subpackage: implementation.models custom-types: BlobAccessPolicy,AccessTier,AccountKind,ArchiveStatus,BlobHttpHeaders,BlobContainerItem,BlobContainerItemProperties,BlobContainerEncryptionScope,BlobServiceProperties,BlobType,Block,BlockList,BlockListType,BlockLookupList,ClearRange,CopyStatusType,BlobCorsRule,CpkInfo,CustomerProvidedKeyInfo,DeleteSnapshotsOptionType,EncryptionAlgorithmType,FilterBlobsItem,GeoReplication,GeoReplicationStatusType,KeyInfo,LeaseDurationType,LeaseStateType,LeaseStatusType,ListBlobContainersIncludeType,ListBlobsIncludeItem,BlobAnalyticsLogging,BlobMetrics,PageList,PageRange,PathRenameMode,PublicAccessType,RehydratePriority,BlobRetentionPolicy,SequenceNumberActionType,BlobSignedIdentifier,SkuName,StaticWebsite,BlobErrorCode,BlobServiceStatistics,SyncCopyStatusType,UserDelegationKey,BlobQueryHeaders,GeoReplicationStatus,BlobImmutabilityPolicyMode,BlobCopySourceTagsMode custom-types-subpackage: models customization-class: src/main/java/BlobStorageCustomization.java +generic-response-type: true use-input-stream-for-binary: true +no-custom-headers: true disable-client-builder: true +stream-style-serialization: true ``` ### /{containerName}/{blob} diff --git a/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java b/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java index 215ae140930b9..1c95321c22a11 100644 --- a/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java +++ b/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java @@ -8,8 +8,8 @@ import com.azure.autorest.customization.PackageCustomization; import com.github.javaparser.ParseProblemException; import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.body.Parameter; import com.github.javaparser.ast.stmt.BlockStmt; @@ -18,8 +18,6 @@ import com.github.javaparser.ast.stmt.TryStmt; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.Type; -import com.github.javaparser.javadoc.Javadoc; -import com.github.javaparser.javadoc.description.JavadocDescription; import org.slf4j.Logger; import java.util.Arrays; @@ -41,27 +39,27 @@ public void customize(LibraryCustomization customization, Logger logger) { models.getClass("PageList").customizeAst(ast -> { ast.addImport("com.azure.storage.blob.implementation.models.PageListHelper"); - ast.getClassByName("PageList").ifPresent(clazz -> { - - clazz.getMethodsByName("getNextMarker").forEach(method -> method.setModifiers(Modifier.Keyword.PRIVATE)); - clazz.getMethodsByName("setNextMarker").forEach(method -> method.setModifiers(Modifier.Keyword.PRIVATE)); - - // Add Accessor to PageList - clazz.setMembers(clazz.getMembers() - .addFirst(StaticJavaParser.parseBodyDeclaration(String.join("\n", "static {", - " PageListHelper.setAccessor(new PageListHelper.PageListAccessor() {", - " @Override", - " public String getNextMarker(PageList pageList) {", - " return pageList.getNextMarker();", - " }", - "", - " @Override", - " public PageList setNextMarker(PageList pageList, String marker) {", - " return pageList.setNextMarker(marker);", - " }", - " });", - "}")))); - }); + ClassOrInterfaceDeclaration clazz = ast.getClassByName("PageList").get(); + + clazz.getMethodsByName("getNextMarker").get(0).setModifiers(com.github.javaparser.ast.Modifier.Keyword.PRIVATE); + clazz.getMethodsByName("setNextMarker").get(0).setModifiers(com.github.javaparser.ast.Modifier.Keyword.PRIVATE); + + // Add Accessor to PageList + clazz.setMembers(clazz.getMembers().addFirst(StaticJavaParser.parseBodyDeclaration(String.join("\n", + "static {", + " PageListHelper.setAccessor(new PageListHelper.PageListAccessor() {", + " @Override", + " public String getNextMarker(PageList pageList) {", + " return pageList.getNextMarker();", + " }", + "", + " @Override", + " public PageList setNextMarker(PageList pageList, String marker) {", + " return pageList.setNextMarker(marker);", + " }", + " });", + "}" + )))); }); ClassCustomization blobContainerEncryptionScope = models.getClass("BlobContainerEncryptionScope"); @@ -114,21 +112,18 @@ public void customize(LibraryCustomization customization, Logger logger) { //QueryFormat customizeQueryFormat(implementationModels.getClass("QueryFormat")); + //BlobHierarchyListSegment + customizeBlobHierarchyListSegment(implementationModels.getClass("BlobHierarchyListSegment")); + + //BlobFlatListSegment + customizeBlobFlatListSegment(implementationModels.getClass("BlobFlatListSegment")); + //BlobSignedIdentifierWrapper customizeBlobSignedIdentifierWrapper(implementationModels.getClass("BlobSignedIdentifierWrapper")); updateImplToMapInternalException(customization.getPackage("com.azure.storage.blob.implementation")); - implementationModels.getClass("QueryRequest").customizeAst(ast -> ast.getClassByName("QueryRequest").ifPresent(clazz -> { - clazz.getFieldByName("queryType").ifPresent(field -> field.removeModifier(Modifier.Keyword.FINAL)); - clazz.addMethod("setQueryType", Modifier.Keyword.PUBLIC) - .setType("QueryRequest") - .addParameter("String", "queryType") - .setBody(StaticJavaParser.parseBlock("{ this.queryType = queryType; return this; }")) - .setJavadocComment(new Javadoc(JavadocDescription.parseText("Set the queryType property: Required. The type of the provided query expression.")) - .addBlockTag("param", "queryType", "the queryType value to set.") - .addBlockTag("return", "the QueryRequest object itself.")); - })); + addMissingHashMapImport(implementationModels); } private static void customizeQueryFormat(ClassCustomization classCustomization) { @@ -140,6 +135,105 @@ private static void customizeQueryFormat(ClassCustomization classCustomization) classCustomization.getEditor().replaceFile(classCustomization.getFileName(), fileContent); } + private static void customizeBlobHierarchyListSegment(ClassCustomization classCustomization){ + classCustomization.customizeAst(ast -> { + ClassOrInterfaceDeclaration clazz = ast.getClassByName(classCustomization.getClassName()).get(); + + clazz.getMethodsBySignature("toXml", "XmlWriter", "String").get(0) + .setBody(StaticJavaParser.parseBlock(String.join("\n", + "{", + "rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Blobs\" : rootElementName;", + "xmlWriter.writeStartElement(rootElementName);", + "if (this.blobPrefixes != null) {", + " for (BlobPrefixInternal element : this.blobPrefixes) {", + " xmlWriter.writeXml(element, \"BlobPrefix\");", + " }", + "}", + "if (this.blobItems != null) {", + " for (BlobItemInternal element : this.blobItems) {", + " xmlWriter.writeXml(element, \"Blob\");", + " }", + "}", + "return xmlWriter.writeEndElement();", + "}" + ))); + + clazz.getMethodsBySignature("fromXml", "XmlReader", "String").get(0) + .setBody(StaticJavaParser.parseBlock(String.join("\n", + "{", + "String finalRootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Blobs\" : rootElementName;", + "return xmlReader.readObject(finalRootElementName, reader -> {", + " BlobHierarchyListSegment deserializedBlobHierarchyListSegment", + " = new BlobHierarchyListSegment();", + " while (reader.nextElement() != XmlToken.END_ELEMENT) {", + " QName elementName = reader.getElementName();", + "", + " if (\"BlobPrefix\".equals(elementName.getLocalPart())) {", + " if (deserializedBlobHierarchyListSegment.blobPrefixes == null) {", + " deserializedBlobHierarchyListSegment.blobPrefixes = new ArrayList<>();", + " }", + " deserializedBlobHierarchyListSegment.blobPrefixes", + " .add(BlobPrefixInternal.fromXml(reader, \"BlobPrefix\"));", + " } else if (\"Blob\".equals(elementName.getLocalPart())) {", + " if (deserializedBlobHierarchyListSegment.blobItems == null) {", + " deserializedBlobHierarchyListSegment.blobItems = new ArrayList<>();", + " }", + " deserializedBlobHierarchyListSegment.blobItems.add(BlobItemInternal.fromXml(reader, \"Blob\"));", + " } else {", + " reader.skipElement();", + " }", + " }", + "", + " return deserializedBlobHierarchyListSegment;", + "});", + "}" + ))); + }); + } + + private static void customizeBlobFlatListSegment(ClassCustomization classCustomization){ + classCustomization.customizeAst(ast -> { + ClassOrInterfaceDeclaration clazz = ast.getClassByName(classCustomization.getClassName()).get(); + + clazz.getMethodsBySignature("toXml", "XmlWriter", "String").get(0) + .setBody(StaticJavaParser.parseBlock( + "{\n" + + "rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Blobs\" : rootElementName;" + + " xmlWriter.writeStartElement(rootElementName);\n" + + " if (this.blobItems != null) {\n" + + " for (BlobItemInternal element : this.blobItems) {\n" + + " xmlWriter.writeXml(element, \"Blob\");\n" + + " }\n" + + " }\n" + + " return xmlWriter.writeEndElement();\n" + + "}" + )); + + clazz.getMethodsBySignature("fromXml", "XmlReader", "String").get(0) + .setBody(StaticJavaParser.parseBlock( + "{\n" + + "String finalRootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Blobs\" : rootElementName;\n" + + " return xmlReader.readObject(finalRootElementName, reader -> {\n" + + " BlobFlatListSegment deserializedBlobFlatListSegment = new BlobFlatListSegment();\n" + + " while (reader.nextElement() != XmlToken.END_ELEMENT) {\n" + + " QName elementName = reader.getElementName();\n" + + " if (\"Blob\".equals(elementName.getLocalPart())) {\n" + + " if (deserializedBlobFlatListSegment.blobItems == null) {\n" + + " deserializedBlobFlatListSegment.blobItems = new ArrayList<>();\n" + + " }\n" + + " deserializedBlobFlatListSegment.blobItems.add(BlobItemInternal.fromXml(reader, \"Blob\"));\n" + + " } else {\n" + + " reader.skipElement();\n" + + " }\n" + + " }\n" + + "\n" + + " return deserializedBlobFlatListSegment;\n" + + " });\n" + + "}" + )); + }); + } + private static void customizeBlobSignedIdentifierWrapper(ClassCustomization classCustomization) { JavadocCustomization javadocfromXml = classCustomization.getMethod("fromXml(XmlReader xmlReader)").getJavadoc(); javadocfromXml.setDescription("Reads an instance of BlobSignedIdentifierWrapper from the XmlReader."); @@ -261,4 +355,11 @@ private static void addErrorMappingToSyncMethod(MethodDeclaration method) { // Replace the last statement with the try-catch block. method.setBody(new BlockStmt(new NodeList<>(tryCatchMap))); } + + // Temporary fix to a bug in Autorest. + private static void addMissingHashMapImport(PackageCustomization implementationModels) { + for (String className : Arrays.asList("BlobsDownloadHeaders", "BlobsQueryHeaders", "BlobsGetPropertiesHeaders", "ContainersGetPropertiesHeaders")) { + implementationModels.getClass(className).addImports("java.util.HashMap"); + } + } } diff --git a/sdk/storage/azure-storage-common/CHANGELOG.md b/sdk/storage/azure-storage-common/CHANGELOG.md index 6f869128a87b2..fadc7c845a776 100644 --- a/sdk/storage/azure-storage-common/CHANGELOG.md +++ b/sdk/storage/azure-storage-common/CHANGELOG.md @@ -1,14 +1,14 @@ # Release History -## 12.29.0-beta.1 (Unreleased) +## 12.28.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. -### Other Changes ## 12.28.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-common/README.md b/sdk/storage/azure-storage-common/README.md index 7878ff143d1df..a61acd4e654d8 100644 --- a/sdk/storage/azure-storage-common/README.md +++ b/sdk/storage/azure-storage-common/README.md @@ -53,7 +53,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-common - 12.28.0 + 12.28.1 ``` [//]: # ({x-version-update-end}) @@ -93,10 +93,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [source]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-common/src [samples_readme]: src/samples/README.md [docs]: https://azure.github.io/azure-sdk-for-java/ -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 -[jdk]: https://learn.microsoft.com/java/azure/jdk/ +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/storage/azure-storage-common/pom.xml b/sdk/storage/azure-storage-common/pom.xml index 1b8e609e17600..e441a16ac53bb 100644 --- a/sdk/storage/azure-storage-common/pom.xml +++ b/sdk/storage/azure-storage-common/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 Microsoft Azure common module for Storage This module contains common code based for all Microsoft Azure Storage client libraries. diff --git a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java index a57842ce582be..a01ad0c3b1e20 100644 --- a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java +++ b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java @@ -54,7 +54,7 @@ public final class StorageCommonTestUtils { public static final TestEnvironment ENVIRONMENT = TestEnvironment.getInstance(); private static final HttpClient NETTY_HTTP_CLIENT = new NettyAsyncHttpClientProvider().createInstance(); private static final HttpClient OK_HTTP_CLIENT = new OkHttpAsyncClientProvider().createInstance(); - private static final HttpClient VERTX_HTTP_CLIENT; + private static final HttpClient VERTX_HTTP_CLIENT;; private static final HttpClient JDK_HTTP_HTTP_CLIENT; static { @@ -269,33 +269,7 @@ public static byte[] getRandomByteArray(int size, TestResourceNamer testResource long seed = UUID.fromString(testResourceNamer.randomUuid()).getMostSignificantBits() & Long.MAX_VALUE; Random rand = new Random(seed); byte[] data = new byte[size]; - - // A pseudo-random byte array will be used to fill the data array. - // - // A pseudo-random set of data is being used to help shrink the git pack files sizes for session records in the - // .assets folder. Before this change data used in testing was truly random, which prevented git pack files from - // being able to compress the data effectively. Truly random data isn't necessary in testing and the logic used - // here is sufficient to prevent any oddities that would cause tests to pass/fail unexpectedly, as the data is - // still somewhat random and is replicated using a prime chunk, meaning the normal code flow won't align with - // the pseudo-random data. - // - // As a result of this change git pack file sizes for Storage tests were able to shrink significantly. This - // should result in smaller download sizes when checking out new or updated session records, which happens - // infrequently locally but every time in CI. - byte[] pseudoRandom = new byte[31]; - rand.nextBytes(pseudoRandom); - - int count = data.length / pseudoRandom.length; - int remaining = data.length % pseudoRandom.length; - - for (int i = 0; i < count; i++) { - System.arraycopy(pseudoRandom, 0, data, i * pseudoRandom.length, pseudoRandom.length); - } - - if (remaining > 0) { - System.arraycopy(pseudoRandom, 0, data, count * pseudoRandom.length, remaining); - } - + rand.nextBytes(data); return data; } diff --git a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/policy/MockPartialResponsePolicy.java b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/policy/MockPartialResponsePolicy.java deleted file mode 100644 index 1f1109d8b38b1..0000000000000 --- a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/policy/MockPartialResponsePolicy.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.storage.common.test.shared.policy; - -import com.azure.core.http.HttpHeader; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpPipelineCallContext; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.policy.HttpPipelinePolicy; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - -public class MockPartialResponsePolicy implements HttpPipelinePolicy { - static final HttpHeaderName RANGE_HEADER = HttpHeaderName.fromString("x-ms-range"); - private int tries; - private final List rangeHeaders = new ArrayList<>(); - - public MockPartialResponsePolicy(int tries) { - this.tries = tries; - } - - @Override - public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - return next.process().flatMap(response -> { - HttpHeader rangeHttpHeader = response.getRequest().getHeaders().get(RANGE_HEADER); - String rangeHeader = rangeHttpHeader == null ? null : rangeHttpHeader.getValue(); - - if (rangeHeader != null && rangeHeader.startsWith("bytes=")) { - rangeHeaders.add(rangeHeader); - } - - if ((response.getRequest().getHttpMethod() != HttpMethod.GET) || this.tries == 0) { - return Mono.just(response); - } else { - this.tries -= 1; - return response.getBody().collectList().flatMap(bodyBuffers -> { - ByteBuffer firstBuffer = bodyBuffers.get(0); - byte firstByte = firstBuffer.get(); - - // Simulate partial response by returning the first byte only from the requested range and timeout - return Mono.just(new MockDownloadHttpResponse(response, 206, - Flux.just(ByteBuffer.wrap(new byte[] { firstByte })) - .concatWith(Flux.error(new IOException("Simulated timeout"))) - )); - }); - } - }); - } - - public int getTriesRemaining() { - return tries; - } - - public List getRangeHeaders() { - return rangeHeaders; - } -} diff --git a/sdk/storage/azure-storage-file-datalake-stress/pom.xml b/sdk/storage/azure-storage-file-datalake-stress/pom.xml index b151b34cca12d..455f44702cc48 100644 --- a/sdk/storage/azure-storage-file-datalake-stress/pom.xml +++ b/sdk/storage/azure-storage-file-datalake-stress/pom.xml @@ -40,7 +40,7 @@ com.azure azure-storage-file-datalake - 12.23.0-beta.1 + 12.22.1 com.azure diff --git a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md index a640d3b1c11bb..b2fd6b137f37e 100644 --- a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md @@ -1,14 +1,15 @@ # Release History -## 12.23.0-beta.1 (Unreleased) +## 12.22.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-storage-blob` from `12.29.0` to version `12.30.0-beta.1`. +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. -### Other Changes ## 12.22.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-file-datalake/README.md b/sdk/storage/azure-storage-file-datalake/README.md index dcdc90ecde2ba..40d40c4166ecd 100644 --- a/sdk/storage/azure-storage-file-datalake/README.md +++ b/sdk/storage/azure-storage-file-datalake/README.md @@ -57,7 +57,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-file-datalake - 12.22.0 + 12.22.1 ``` [//]: # ({x-version-update-end}) @@ -430,17 +430,17 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [source]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-datalake/src [samples_readme]: src/samples/README.md [docs]: https://azure.github.io/azure-sdk-for-java/ -[rest_docs]: https://learn.microsoft.com/rest/api/storageservices/data-lake-storage-gen2 -[product_docs]: https://learn.microsoft.com/azure/storage/blobs/data-lake-storage-introduction -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 -[jdk]: https://learn.microsoft.com/java/azure/jdk/ +[rest_docs]: https://docs.microsoft.com/rest/api/storageservices/data-lake-storage-gen2 +[product_docs]: https://docs.microsoft.com/azure/storage/blobs/data-lake-storage-introduction +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[storage_account_create_cli]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli -[storage_account_create_portal]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli +[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/README.md [samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-datalake/src/samples -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/data-lake-storage-gen2 +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/data-lake-storage-gen2 [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/storage/azure-storage-file-datalake/assets.json b/sdk/storage/azure-storage-file-datalake/assets.json index ab33e08f82262..30f75ab4c4bd6 100644 --- a/sdk/storage/azure-storage-file-datalake/assets.json +++ b/sdk/storage/azure-storage-file-datalake/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/storage/azure-storage-file-datalake", - "Tag": "java/storage/azure-storage-file-datalake_a6a21482e5" + "Tag": "java/storage/azure-storage-file-datalake_a909c263ac" } diff --git a/sdk/storage/azure-storage-file-datalake/pom.xml b/sdk/storage/azure-storage-file-datalake/pom.xml index 45fad0dd39dd9..99ddf5cdab962 100644 --- a/sdk/storage/azure-storage-file-datalake/pom.xml +++ b/sdk/storage/azure-storage-file-datalake/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-file-datalake - 12.23.0-beta.1 + 12.22.1 Microsoft Azure client library for File Storage Data Lake This module contains client library for Microsoft Azure File Storage Data Lake. @@ -60,6 +60,7 @@ false spotbugs-exclude.xml + - @@ -81,7 +82,7 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClientBuilder.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClientBuilder.java index b4222426087fd..a5ee44ef10851 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClientBuilder.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClientBuilder.java @@ -113,9 +113,6 @@ private HttpPipeline constructPipeline() { } /** - * Creates a {@link DataLakeServiceClient} based on options set in the builder. Every time {@code buildClient()} is - * called, a new instance of {@link DataLakeServiceClient} is created. - * * @return a {@link DataLakeServiceClient} created from the configurations in this builder. * @throws IllegalStateException If multiple credentials have been specified. * @throws IllegalStateException If both {@link #retryOptions(RetryOptions)} @@ -129,9 +126,6 @@ public DataLakeServiceClient buildClient() { } /** - * Creates a {@link DataLakeServiceAsyncClient} based on options set in the builder. Every time - * {@code buildAsyncClient()} is called, a new instance of {@link DataLakeServiceAsyncClient} is created. - * * @return a {@link DataLakeServiceAsyncClient} created from the configurations in this builder. * @throws IllegalStateException If multiple credentials have been specified. * @throws IllegalStateException If both {@link #retryOptions(RetryOptions)} diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/models/BlobHierarchyListSegment.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/models/BlobHierarchyListSegment.java index d0a8c7cefe468..add5581ceb0cf 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/models/BlobHierarchyListSegment.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/models/BlobHierarchyListSegment.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.datalake.implementation.models; import com.azure.core.annotation.Fluent; @@ -20,6 +19,7 @@ */ @Fluent public final class BlobHierarchyListSegment implements XmlSerializable { + /* * The BlobPrefixes property. */ @@ -38,7 +38,7 @@ public BlobHierarchyListSegment() { /** * Get the blobPrefixes property: The BlobPrefixes property. - * + * * @return the blobPrefixes value. */ public List getBlobPrefixes() { @@ -47,7 +47,7 @@ public List getBlobPrefixes() { /** * Set the blobPrefixes property: The BlobPrefixes property. - * + * * @param blobPrefixes the blobPrefixes value to set. * @return the BlobHierarchyListSegment object itself. */ @@ -58,7 +58,7 @@ public BlobHierarchyListSegment setBlobPrefixes(List blobPrefixes) { /** * Get the blobItems property: The BlobItems property. - * + * * @return the blobItems value. */ public List getBlobItems() { @@ -67,7 +67,7 @@ public List getBlobItems() { /** * Set the blobItems property: The BlobItems property. - * + * * @param blobItems the blobItems value to set. * @return the BlobHierarchyListSegment object itself. */ @@ -100,7 +100,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of BlobHierarchyListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of BlobHierarchyListSegment if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. @@ -112,7 +112,7 @@ public static BlobHierarchyListSegment fromXml(XmlReader xmlReader) throws XMLSt /** * Reads an instance of BlobHierarchyListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -127,16 +127,20 @@ public static BlobHierarchyListSegment fromXml(XmlReader xmlReader, String rootE BlobHierarchyListSegment deserializedBlobHierarchyListSegment = new BlobHierarchyListSegment(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("BlobPrefix".equals(elementName.getLocalPart())) { + if (deserializedBlobHierarchyListSegment.blobPrefixes == null) { + deserializedBlobHierarchyListSegment.blobPrefixes = new ArrayList<>(); + } deserializedBlobHierarchyListSegment.blobPrefixes.add(BlobPrefix.fromXml(reader, "BlobPrefix")); } else if ("Blob".equals(elementName.getLocalPart())) { + if (deserializedBlobHierarchyListSegment.blobItems == null) { + deserializedBlobHierarchyListSegment.blobItems = new ArrayList<>(); + } deserializedBlobHierarchyListSegment.blobItems.add(BlobItemInternal.fromXml(reader, "Blob")); } else { reader.skipElement(); } } - return deserializedBlobHierarchyListSegment; }); } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeCounters.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeCounters.java index 402c700f669b9..939cce1babff9 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeCounters.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeCounters.java @@ -11,12 +11,6 @@ public class AccessControlChangeCounters { private long changedFilesCount; private long failedChangesCount; - /** - * Creates a new instance of {@link AccessControlChangeCounters}. - */ - public AccessControlChangeCounters() { - } - /** * The number of directories where Access Control List has been updated successfully. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeFailure.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeFailure.java index f1c3c06ea10ec..e6f23cd7871d3 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeFailure.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeFailure.java @@ -11,12 +11,6 @@ public class AccessControlChangeFailure { private boolean isDirectory; private String errorMessage; - /** - * Creates a new instance of {@link AccessControlChangeFailure}. - */ - public AccessControlChangeFailure() { - } - /** * Returns the name of an entry. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeResult.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeResult.java index 49ad74103f7c1..5247aa440162e 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeResult.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChangeResult.java @@ -13,12 +13,6 @@ public class AccessControlChangeResult { private String continuationToken; private List batchFailures; - /** - * Creates a new instance of {@link AccessControlChangeResult}. - */ - public AccessControlChangeResult() { - } - /** * Returns the {@link AccessControlChangeCounters}. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChanges.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChanges.java index 13118e0f603de..c6b33b092be0d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChanges.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChanges.java @@ -7,7 +7,7 @@ /** * AccessControlChanges contains batch and cumulative counts of operations that change Access Control Lists recursively. - * Additionally, it exposes path entries that failed to update while these operations progress. + * Additionally it exposes path entries that failed to update while these operations progress. */ public class AccessControlChanges { private List batchFailures; @@ -15,12 +15,6 @@ public class AccessControlChanges { private AccessControlChangeCounters aggregateCounters; private String continuationToken; - /** - * Creates a new instance of {@link AccessControlChanges}. - */ - public AccessControlChanges() { - } - /** * Returns a list of path entries that failed to update Access Control List within a single batch. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlType.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlType.java index 0c235035a0fb1..b2a337e49c0da 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlType.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlType.java @@ -32,15 +32,6 @@ public class AccessControlType extends ExpandableStringEnum { */ public static final AccessControlType OTHER = fromString("other"); - /** - * Creates a new instance of {@link AccessControlType} with no string value. - * - * @deprecated Please use {@link #fromString(String)} to create an instance of AccessControlType. - */ - @Deprecated - public AccessControlType() { - } - /** * Creates or finds a ArchiveStatus from its string representation. * @@ -52,8 +43,6 @@ public static AccessControlType fromString(String name) { } /** - * Gets known ArchiveStatus values. - * * @return known ArchiveStatus values. */ public static Collection values() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessTier.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessTier.java index b3ab61632b226..b661b3e59e6b4 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessTier.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessTier.java @@ -82,15 +82,6 @@ public final class AccessTier extends ExpandableStringEnum { */ public static final AccessTier ARCHIVE = fromString("Archive"); - /** - * Creates a new instance of {@link AccessTier} with no string value. - * - * @deprecated Please use {@link #fromString(String)} to create an instance of AccessTier. - */ - @Deprecated - public AccessTier() { - } - /** * Creates or finds a AccessTier from its string representation. * @@ -102,8 +93,6 @@ public static AccessTier fromString(String name) { } /** - * Gets known AccessTier values. - * * @return known AccessTier values. */ public static Collection values() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ArchiveStatus.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ArchiveStatus.java index 969fdebb32545..d25f4663588c7 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ArchiveStatus.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ArchiveStatus.java @@ -22,15 +22,6 @@ public final class ArchiveStatus extends ExpandableStringEnum { */ public static final ArchiveStatus REHYDRATE_PENDING_TO_COOL = fromString("rehydrate-pending-to-cool"); - /** - * Creates a new instance of {@link ArchiveStatus} with no string value. - * - * @deprecated Please use {@link #fromString(String)} to create an instance of ArchiveStatus. - */ - @Deprecated - public ArchiveStatus() { - } - /** * Creates or finds a ArchiveStatus from its string representation. * @@ -42,8 +33,6 @@ public static ArchiveStatus fromString(String name) { } /** - * Gets known ArchiveStatus values. - * * @return known ArchiveStatus values. */ public static Collection values() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/CustomerProvidedKey.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/CustomerProvidedKey.java index 12548ce269452..d75bbc4676317 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/CustomerProvidedKey.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/CustomerProvidedKey.java @@ -40,6 +40,7 @@ public class CustomerProvidedKey { * @throws RuntimeException If "SHA-256" cannot be found. */ public CustomerProvidedKey(String key) { + this.key = key; MessageDigest sha256; @@ -56,6 +57,7 @@ public CustomerProvidedKey(String key) { * Creates a new wrapper for a client provided key. * * @param key The encryption key bytes. + * * @throws RuntimeException If "SHA-256" cannot be found. */ public CustomerProvidedKey(byte[] key) { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAccessPolicy.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAccessPolicy.java index b798e28b4084b..de5f69c99d8e1 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAccessPolicy.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAccessPolicy.java @@ -24,12 +24,6 @@ public final class DataLakeAccessPolicy { */ private String permissions; - /** - * Creates a new instance of {@link DataLakeAccessPolicy}. - */ - public DataLakeAccessPolicy() { - } - /** * Get the startsOn property: the date-time the policy is active. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAclChangeFailedException.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAclChangeFailedException.java index 9ccf4c281ede7..a9ccc25ec25eb 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAclChangeFailedException.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAclChangeFailedException.java @@ -42,8 +42,6 @@ public DataLakeAclChangeFailedException(String message, DataLakeStorageException } /** - * Gets the continuation token to resume a datalake recursive acl function. - * * @return the continuation token to resume a datalake recursive acl function. */ public String getContinuationToken() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAnalyticsLogging.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAnalyticsLogging.java index ba8367a12291a..6f44397f2d014 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAnalyticsLogging.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAnalyticsLogging.java @@ -35,12 +35,6 @@ public final class DataLakeAnalyticsLogging { */ private DataLakeRetentionPolicy retentionPolicy; - /** - * Creates a new instance of {@link DataLakeAnalyticsLogging}. - */ - public DataLakeAnalyticsLogging() { - } - /** * Get the version property: The version of Storage Analytics to configure. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAudience.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAudience.java index 07c36aeeda676..b0884712e1eae 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAudience.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeAudience.java @@ -58,8 +58,6 @@ public static DataLakeAudience fromString(String audience) { } /** - * Gets known DataLakeAudience values. - * * @return known DataLakeAudience values. */ public static Collection values() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeCorsRule.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeCorsRule.java index 1f22f1c2ecb1c..64241a54cbc58 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeCorsRule.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeCorsRule.java @@ -6,53 +6,56 @@ import com.azure.core.annotation.Fluent; /** - * CORS is an HTTP feature that enables a web application running under one domain to access resources in another - * domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from - * calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs - * in another domain. + * CORS is an HTTP feature that enables a web application running under one + * domain to access resources in another domain. Web browsers implement a + * security restriction known as same-origin policy that prevents a web page + * from calling APIs in a different domain; CORS provides a secure way to allow + * one domain (the origin domain) to call APIs in another domain. */ @Fluent public final class DataLakeCorsRule { + /* - * The origin domains that are permitted to make a request against the storage service via CORS. The origin domain - * is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with - * the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all - * origin domains to make requests via CORS. + * The origin domains that are permitted to make a request against the + * storage service via CORS. The origin domain is the domain from which the + * request originates. Note that the origin must be an exact case-sensitive + * match with the origin that the user age sends to the service. You can + * also use the wildcard character '*' to allow all origin domains to make + * requests via CORS. */ private String allowedOrigins; /* - * The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) + * The methods (HTTP request verbs) that the origin domain may use for a + * CORS request. (comma separated) */ private String allowedMethods; /* - * the request headers that the origin domain may specify on the CORS request. + * the request headers that the origin domain may specify on the CORS + * request. */ private String allowedHeaders; /* - * The response headers that may be sent in the response to the CORS request and exposed by the browser to the - * request issuer + * The response headers that may be sent in the response to the CORS + * request and exposed by the browser to the request issuer */ private String exposedHeaders; /* - * The maximum amount time that a browser should cache the preflight OPTIONS request. + * The maximum amount time that a browser should cache the preflight + * OPTIONS request. */ private int maxAgeInSeconds; /** - * Creates a new instance of {@link DataLakeCorsRule}. - */ - public DataLakeCorsRule() { - } - - /** - * Get the allowedOrigins property: The origin domains that are permitted to make a request against the storage - * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be - * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the - * wildcard character '*' to allow all origin domains to make requests via CORS. + * Get the allowedOrigins property: The origin domains that are permitted + * to make a request against the storage service via CORS. The origin + * domain is the domain from which the request originates. Note that the + * origin must be an exact case-sensitive match with the origin that the + * user age sends to the service. You can also use the wildcard character + * '*' to allow all origin domains to make requests via CORS. * * @return the allowedOrigins value. */ @@ -61,10 +64,12 @@ public String getAllowedOrigins() { } /** - * Set the allowedOrigins property: The origin domains that are permitted to make a request against the storage - * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be - * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the - * wildcard character '*' to allow all origin domains to make requests via CORS. + * Set the allowedOrigins property: The origin domains that are permitted + * to make a request against the storage service via CORS. The origin + * domain is the domain from which the request originates. Note that the + * origin must be an exact case-sensitive match with the origin that the + * user age sends to the service. You can also use the wildcard character + * '*' to allow all origin domains to make requests via CORS. * * @param allowedOrigins the allowedOrigins value to set. * @return the DataLakeCorsRule object itself. @@ -75,8 +80,8 @@ public DataLakeCorsRule setAllowedOrigins(String allowedOrigins) { } /** - * Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS - * request. (comma separated). + * Get the allowedMethods property: The methods (HTTP request verbs) that + * the origin domain may use for a CORS request. (comma separated). * * @return the allowedMethods value. */ @@ -85,8 +90,8 @@ public String getAllowedMethods() { } /** - * Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS - * request. (comma separated). + * Set the allowedMethods property: The methods (HTTP request verbs) that + * the origin domain may use for a CORS request. (comma separated). * * @param allowedMethods the allowedMethods value to set. * @return the DataLakeCorsRule object itself. @@ -97,7 +102,8 @@ public DataLakeCorsRule setAllowedMethods(String allowedMethods) { } /** - * Get the allowedHeaders property: the request headers that the origin domain may specify on the CORS request. + * Get the allowedHeaders property: the request headers that the origin + * domain may specify on the CORS request. * * @return the allowedHeaders value. */ @@ -106,7 +112,8 @@ public String getAllowedHeaders() { } /** - * Set the allowedHeaders property: the request headers that the origin domain may specify on the CORS request. + * Set the allowedHeaders property: the request headers that the origin + * domain may specify on the CORS request. * * @param allowedHeaders the allowedHeaders value to set. * @return the DataLakeCorsRule object itself. @@ -117,8 +124,9 @@ public DataLakeCorsRule setAllowedHeaders(String allowedHeaders) { } /** - * Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and - * exposed by the browser to the request issuer. + * Get the exposedHeaders property: The response headers that may be sent + * in the response to the CORS request and exposed by the browser to the + * request issuer. * * @return the exposedHeaders value. */ @@ -127,8 +135,9 @@ public String getExposedHeaders() { } /** - * Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and - * exposed by the browser to the request issuer. + * Set the exposedHeaders property: The response headers that may be sent + * in the response to the CORS request and exposed by the browser to the + * request issuer. * * @param exposedHeaders the exposedHeaders value to set. * @return the DataLakeCorsRule object itself. @@ -139,8 +148,8 @@ public DataLakeCorsRule setExposedHeaders(String exposedHeaders) { } /** - * Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS - * request. + * Get the maxAgeInSeconds property: The maximum amount time that a browser + * should cache the preflight OPTIONS request. * * @return the maxAgeInSeconds value. */ @@ -149,8 +158,8 @@ public int getMaxAgeInSeconds() { } /** - * Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS - * request. + * Set the maxAgeInSeconds property: The maximum amount time that a browser + * should cache the preflight OPTIONS request. * * @param maxAgeInSeconds the maxAgeInSeconds value to set. * @return the DataLakeCorsRule object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeFileOpenInputStreamResult.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeFileOpenInputStreamResult.java index 75493618db614..f76e1b133432f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeFileOpenInputStreamResult.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeFileOpenInputStreamResult.java @@ -10,15 +10,11 @@ */ public interface DataLakeFileOpenInputStreamResult { /** - * Gets the {@link InputStream} of the target file. - * * @return the {@link InputStream} of the target file. */ InputStream getInputStream(); /** - * Gets the {@link PathProperties} of the target file. - * * @return the {@link PathProperties} of the target file. */ PathProperties getProperties(); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeMetrics.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeMetrics.java index 7018f2da27863..f510eec53dbcb 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeMetrics.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeMetrics.java @@ -26,16 +26,11 @@ public final class DataLakeMetrics { private DataLakeRetentionPolicy retentionPolicy; /* - * Indicates whether metrics should generate summary statistics for called API operations. + * Indicates whether metrics should generate summary statistics for called + * API operations. */ private Boolean includeApis; - /** - * Creates a new instance of {@link DataLakeMetrics}. - */ - public DataLakeMetrics() { - } - /** * Get the version property: The version of Storage Analytics to configure. * @@ -57,7 +52,8 @@ public DataLakeMetrics setVersion(String version) { } /** - * Get the enabled property: Indicates whether metrics are enabled for the DataLake service. + * Get the enabled property: Indicates whether metrics are enabled for the + * DataLake service. * * @return the enabled value. */ @@ -66,7 +62,8 @@ public boolean isEnabled() { } /** - * Set the enabled property: Indicates whether metrics are enabled for the DataLake service. + * Set the enabled property: Indicates whether metrics are enabled for the + * DataLake service. * * @param enabled the enabled value to set. * @return the DataLakeMetrics object itself. @@ -97,8 +94,8 @@ public DataLakeMetrics setRetentionPolicy(DataLakeRetentionPolicy retentionPolic } /** - * Get the includeApis property: Indicates whether metrics should generate summary statistics for called API - * operations. + * Get the includeApis property: Indicates whether metrics should generate + * summary statistics for called API operations. * * @return the includeApis value. */ @@ -107,8 +104,8 @@ public Boolean isIncludeApis() { } /** - * Set the includeApis property: Indicates whether metrics should generate summary statistics for called API - * operations. + * Set the includeApis property: Indicates whether metrics should generate + * summary statistics for called API operations. * * @param includeApis the includeApis value to set. * @return the DataLakeMetrics object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRequestConditions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRequestConditions.java index 3475dead0bf0b..8ea7da5a43d4c 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRequestConditions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRequestConditions.java @@ -18,12 +18,6 @@ public class DataLakeRequestConditions extends RequestConditions { private String leaseId; - /** - * Creates a new instance of {@link DataLakeRequestConditions}. - */ - public DataLakeRequestConditions() { - } - /** * Optionally limit requests to resources that match the passed ETag. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRetentionPolicy.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRetentionPolicy.java index 4f2c551775172..e275eeec3d3af 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRetentionPolicy.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeRetentionPolicy.java @@ -17,19 +17,14 @@ public final class DataLakeRetentionPolicy { private boolean enabled; /* - * Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than - * this value will be deleted + * Indicates the number of days that metrics or logging or soft-deleted + * data should be retained. All data older than this value will be deleted */ private Integer days; /** - * Creates a new instance of {@link DataLakeRetentionPolicy}. - */ - public DataLakeRetentionPolicy() { - } - - /** - * Get the enabled property: Indicates whether a retention policy is enabled for the storage service. + * Get the enabled property: Indicates whether a retention policy is + * enabled for the storage service. * * @return the enabled value. */ @@ -38,7 +33,8 @@ public boolean isEnabled() { } /** - * Set the enabled property: Indicates whether a retention policy is enabled for the storage service. + * Set the enabled property: Indicates whether a retention policy is + * enabled for the storage service. * * @param enabled the enabled value to set. * @return the DataLakeRetentionPolicy object itself. @@ -49,8 +45,9 @@ public DataLakeRetentionPolicy setEnabled(boolean enabled) { } /** - * Get the days property: Indicates the number of days that metrics or logging or soft-deleted data should be - * retained. All data older than this value will be deleted. + * Get the days property: Indicates the number of days that metrics or + * logging or soft-deleted data should be retained. All data older than + * this value will be deleted. * * @return the days value. */ @@ -59,8 +56,9 @@ public Integer getDays() { } /** - * Set the days property: Indicates the number of days that metrics or logging or soft-deleted data should be - * retained. All data older than this value will be deleted. + * Set the days property: Indicates the number of days that metrics or + * logging or soft-deleted data should be retained. All data older than + * this value will be deleted. * * @param days the days value to set. * @return the DataLakeRetentionPolicy object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeServiceProperties.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeServiceProperties.java index 985adbc6177b5..72c28252df688 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeServiceProperties.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeServiceProperties.java @@ -34,8 +34,9 @@ public final class DataLakeServiceProperties { private List cors; /* - * The default version to use for requests to the DataLake service if an incoming request's version is not - * specified. Possible values include version 2008-10-27 and all more recent versions + * The default version to use for requests to the DataLake service if an + * incoming request's version is not specified. Possible values include + * version 2008-10-27 and all more recent versions */ private String defaultServiceVersion; @@ -49,12 +50,6 @@ public final class DataLakeServiceProperties { */ private DataLakeStaticWebsite staticWebsite; - /** - * Creates a new instance of {@link DataLakeServiceProperties}. - */ - public DataLakeServiceProperties() { - } - /** * Get the logging property: The logging property. * @@ -139,9 +134,10 @@ public DataLakeServiceProperties setCors(List cors) { } /** - * Get the defaultServiceVersion property: The default version to use for requests to the DataLake service if an - * incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent - * versions. + * Get the defaultServiceVersion property: The default version to use for + * requests to the DataLake service if an incoming request's version is not + * specified. Possible values include version 2008-10-27 and all more + * recent versions. * * @return the defaultServiceVersion value. */ @@ -150,9 +146,10 @@ public String getDefaultServiceVersion() { } /** - * Set the defaultServiceVersion property: The default version to use for requests to the DataLake service if an - * incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent - * versions. + * Set the defaultServiceVersion property: The default version to use for + * requests to the DataLake service if an incoming request's version is not + * specified. Possible values include version 2008-10-27 and all more + * recent versions. * * @param defaultServiceVersion the defaultServiceVersion value to set. * @return the DataLakeServiceProperties object itself. @@ -163,7 +160,8 @@ public DataLakeServiceProperties setDefaultServiceVersion(String defaultServiceV } /** - * Get the deleteRetentionPolicy property: The deleteRetentionPolicy property. + * Get the deleteRetentionPolicy property: The deleteRetentionPolicy + * property. * * @return the deleteRetentionPolicy value. */ @@ -172,7 +170,8 @@ public DataLakeRetentionPolicy getDeleteRetentionPolicy() { } /** - * Set the deleteRetentionPolicy property: The deleteRetentionPolicy property. + * Set the deleteRetentionPolicy property: The deleteRetentionPolicy + * property. * * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. * @return the DataLakeServiceProperties object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeSignedIdentifier.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeSignedIdentifier.java index 28e92a4437e34..098732f2de029 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeSignedIdentifier.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeSignedIdentifier.java @@ -20,12 +20,6 @@ public class DataLakeSignedIdentifier { */ private DataLakeAccessPolicy accessPolicy; - /** - * Creates a new instance of {@link DataLakeSignedIdentifier}. - */ - public DataLakeSignedIdentifier() { - } - /** * Get the id property: a unique id. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStaticWebsite.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStaticWebsite.java index a13c84413ba23..c26a9a7059259 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStaticWebsite.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStaticWebsite.java @@ -25,12 +25,6 @@ public final class DataLakeStaticWebsite { */ private String defaultIndexDocumentPath; - /** - * Creates a new instance of {@link DataLakeStaticWebsite}. - */ - public DataLakeStaticWebsite() { - } - /** * Get the enabled property: Indicates whether this account is hosting a static website. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java index 3f28baff3834d..dc15f6d0b4b41 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java @@ -35,8 +35,6 @@ public DataLakeStorageException(String message, HttpResponse response, Object va } /** - * Gets the error code returned by the service. - * * @return The error code returned by the service. */ public String getErrorCode() { @@ -44,8 +42,6 @@ public String getErrorCode() { } /** - * Gets the message returned by the service. - * * @return The message returned by the service. */ public String getServiceMessage() { @@ -53,8 +49,6 @@ public String getServiceMessage() { } /** - * Gets the status code on the response. - * * @return The status code on the response. */ public int getStatusCode() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DownloadRetryOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DownloadRetryOptions.java index 978d87cb6ed43..d475862da1c4c 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DownloadRetryOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DownloadRetryOptions.java @@ -17,18 +17,12 @@ public final class DownloadRetryOptions { private static final ClientLogger LOGGER = new ClientLogger(DownloadRetryOptions.class); /* - * We use "retry" here because by the time the user passes this type, the initial request, or try, has already been - * issued and returned. This is in contrast to the retry policy options, which includes the initial try in its - * count, thus the difference in verbiage. + We use "retry" here because by the time the user passes this type, the initial request, or try, has already been + issued and returned. This is in contrast to the retry policy options, which includes the initial try in its count, + thus the difference in verbiage. */ private int maxRetryRequests = 5; - /** - * Creates a new instance of {@link DownloadRetryOptions}. - */ - public DownloadRetryOptions() { - } - /** * Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a * response body. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowField.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowField.java index 215b3ca14afb1..119c08a0184bf 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowField.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowField.java @@ -11,14 +11,13 @@ */ @Fluent public class FileQueryArrowField { + private String name; private Integer precision; private Integer scale; private final FileQueryArrowFieldType type; /** - * Creates a new instance of {@link FileQueryArrowField}. - * * @param type {@link FileQueryArrowFieldType} */ public FileQueryArrowField(FileQueryArrowFieldType type) { @@ -27,8 +26,6 @@ public FileQueryArrowField(FileQueryArrowFieldType type) { } /** - * Sets the name of the field. - * * @param name The name of the field. * @return The updated options. */ @@ -38,8 +35,6 @@ public FileQueryArrowField setName(String name) { } /** - * Sets the precision of the field. Required if type is {@link FileQueryArrowFieldType#DECIMAL}. - * * @param precision The precision of the field. Required if type is {@link FileQueryArrowFieldType#DECIMAL} * @return The updated options. */ @@ -49,8 +44,6 @@ public FileQueryArrowField setPrecision(Integer precision) { } /** - * Sets the scale of the field. Required if type is {@link FileQueryArrowFieldType#DECIMAL}. - * * @param scale The scale of the field. Required if type is {@link FileQueryArrowFieldType#DECIMAL} * @return The updated options. */ @@ -60,8 +53,6 @@ public FileQueryArrowField setScale(Integer scale) { } /** - * Gets the name of the field. - * * @return The name. */ public String getName() { @@ -69,8 +60,6 @@ public String getName() { } /** - * Gets the precision of the field. - * * @return The precision. */ public Integer getPrecision() { @@ -78,8 +67,6 @@ public Integer getPrecision() { } /** - * Gets the scale of the field. - * * @return The scale. */ public Integer getScale() { @@ -87,8 +74,6 @@ public Integer getScale() { } /** - * Gets the {@link FileQueryArrowFieldType} of the field. - * * @return {@link FileQueryArrowFieldType} */ public FileQueryArrowFieldType getType() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowSerialization.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowSerialization.java index 55caa2a815877..cc2c20c54749b 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowSerialization.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryArrowSerialization.java @@ -10,13 +10,8 @@ * Defines the output arrow serialization for a file quick query request. */ public class FileQueryArrowSerialization implements FileQuerySerialization { - private List schema; - /** - * Creates a new instance of {@link FileQueryArrowSerialization}. - */ - public FileQueryArrowSerialization() { - } + private List schema; /** * Gets the arrow fields. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryDelimitedSerialization.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryDelimitedSerialization.java index fc90fdd479779..3dbf42b4a2827 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryDelimitedSerialization.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryDelimitedSerialization.java @@ -7,18 +7,13 @@ * Defines the input or output delimited (CSV) serialization for a blob quick query request. */ public class FileQueryDelimitedSerialization implements FileQuerySerialization { + private char columnSeparator; private char fieldQuote; private char escapeChar; private boolean headersPresent; private char recordSeparator; - /** - * Creates a new instance of {@link FileQueryDelimitedSerialization}. - */ - public FileQueryDelimitedSerialization() { - } - /** * Gets the column separator. * @return the column separator. @@ -74,16 +69,16 @@ public FileQueryDelimitedSerialization setEscapeChar(char escapeChar) { } /** - * Gets whether headers are present. - * @return Whether headers are present. + * Gets whether or not headers are present. + * @return Whether or not headers are present. */ public boolean isHeadersPresent() { return headersPresent; } /** - * Sets whether headers are present. - * @param headersPresent Whether headers are present. + * Sets whether or not headers are present. + * @param headersPresent Whether or not headers are present. * @return the updated FileQueryDelimitedSerialization object. */ public FileQueryDelimitedSerialization setHeadersPresent(boolean headersPresent) { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryError.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryError.java index 1338feafa9293..c9fac59159bd1 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryError.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryError.java @@ -7,6 +7,7 @@ * Defines a file query error that can be returned on parsing a file query request. */ public class FileQueryError { + private final boolean fatal; private final String name; private final String description; @@ -14,7 +15,7 @@ public class FileQueryError { /** * Creates a new FileQueryError object. - * @param fatal Whether the error is fatal. + * @param fatal Whether or not the error is fatal. * @param name The name of the error. * @param description A description of the error. * @param position The file offset at which the error occurred. @@ -27,19 +28,16 @@ public FileQueryError(boolean fatal, String name, String description, long posit } /** - * Whether the error is fatal. If true, this error prevents further query processing. More result data may be - * returned, but there is no guarantee that all the original data will be processed. If false, this error does not - * prevent further query processing. - * - * @return Whether the error is fatal. + * Whether or not the error is fatal. If true, this error prevents further query processing. More result data may + * be returned, but there is no guarantee that all of the original data will be processed. If false, this error + * does not prevent further query processing. + * @return Whether or not the error is fatal. */ public boolean isFatal() { return fatal; } /** - * Gets the name of the error. - * * @return The name of the error. */ public String getName() { @@ -47,7 +45,6 @@ public String getName() { } /** - * Gets a description of the error. * * @return A description of the error. */ @@ -56,8 +53,6 @@ public String getDescription() { } /** - * Gets the file offset at which the error occurred. - * * @return The file offset at which the error occurred. */ public long getPosition() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryHeaders.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryHeaders.java index b88d8190f8902..607923353bbe4 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryHeaders.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryHeaders.java @@ -13,6 +13,7 @@ * Defines headers for Read operation. */ public final class FileQueryHeaders { + private DateTimeRfc1123 lastModified; private Map metadata; private Long contentLength; @@ -45,15 +46,10 @@ public final class FileQueryHeaders { private String errorCode; /** - * Creates a new instance of {@link FileQueryHeaders}. - */ - public FileQueryHeaders() { - } - - /** - * Get the lastModified property: Returns the date and time the container was last modified. Any operation that - * modifies the file, including an update of the file's metadata or properties, changes the last-modified time of - * the file. + * Get the lastModified property: Returns the date and time the container + * was last modified. Any operation that modifies the file, including an + * update of the file's metadata or properties, changes the last-modified + * time of the file. * * @return the lastModified value. */ @@ -65,9 +61,10 @@ public OffsetDateTime getLastModified() { } /** - * Set the lastModified property: Returns the date and time the container was last modified. Any operation that - * modifies the file, including an update of the file's metadata or properties, changes the last-modified time of - * the file. + * Set the lastModified property: Returns the date and time the container + * was last modified. Any operation that modifies the file, including an + * update of the file's metadata or properties, changes the last-modified + * time of the file. * * @param lastModified the lastModified value to set. * @return the FileQueryHeaders object itself. @@ -102,7 +99,8 @@ public FileQueryHeaders setMetadata(Map metadata) { } /** - * Get the contentLength property: The number of bytes present in the response body. + * Get the contentLength property: The number of bytes present in the + * response body. * * @return the contentLength value. */ @@ -111,7 +109,8 @@ public Long getContentLength() { } /** - * Set the contentLength property: The number of bytes present in the response body. + * Set the contentLength property: The number of bytes present in the + * response body. * * @param contentLength the contentLength value to set. * @return the FileQueryHeaders object itself. @@ -122,8 +121,8 @@ public FileQueryHeaders setContentLength(Long contentLength) { } /** - * Get the contentType property: The media type of the body of the response. For Download Blob this is - * 'application/octet-stream'. + * Get the contentType property: The media type of the body of the + * response. For Download Blob this is 'application/octet-stream'. * * @return the contentType value. */ @@ -132,8 +131,8 @@ public String getContentType() { } /** - * Set the contentType property: The media type of the body of the response. For Download Blob this is - * 'application/octet-stream'. + * Set the contentType property: The media type of the body of the + * response. For Download Blob this is 'application/octet-stream'. * * @param contentType the contentType value to set. * @return the FileQueryHeaders object itself. @@ -144,8 +143,9 @@ public FileQueryHeaders setContentType(String contentType) { } /** - * Get the contentRange property: Indicates the range of bytes returned in the event that the client requested a - * subset of the file by setting the 'Range' request header. + * Get the contentRange property: Indicates the range of bytes returned in + * the event that the client requested a subset of the file by setting the + * 'Range' request header. * * @return the contentRange value. */ @@ -154,8 +154,9 @@ public String getContentRange() { } /** - * Set the contentRange property: Indicates the range of bytes returned in the event that the client requested a - * subset of the file by setting the 'Range' request header. + * Set the contentRange property: Indicates the range of bytes returned in + * the event that the client requested a subset of the file by setting the + * 'Range' request header. * * @param contentRange the contentRange value to set. * @return the FileQueryHeaders object itself. @@ -166,8 +167,9 @@ public FileQueryHeaders setContentRange(String contentRange) { } /** - * Get the eTag property: The ETag contains a value that you can use to perform operations conditionally. If the - * request version is 2011-08-18 or newer, the ETag value will be in quotes. + * Get the eTag property: The ETag contains a value that you can use to + * perform operations conditionally. If the request version is 2011-08-18 + * or newer, the ETag value will be in quotes. * * @return the eTag value. */ @@ -176,8 +178,9 @@ public String getETag() { } /** - * Set the eTag property: The ETag contains a value that you can use to perform operations conditionally. If the - * request version is 2011-08-18 or newer, the ETag value will be in quotes. + * Set the eTag property: The ETag contains a value that you can use to + * perform operations conditionally. If the request version is 2011-08-18 + * or newer, the ETag value will be in quotes. * * @param eTag the eTag value to set. * @return the FileQueryHeaders object itself. @@ -188,8 +191,9 @@ public FileQueryHeaders setETag(String eTag) { } /** - * Get the contentMd5 property: If the file has an MD5 hash and this operation is to read the full file, this - * response header is returned so that the client can check for message content integrity. + * Get the contentMd5 property: If the file has an MD5 hash and this + * operation is to read the full file, this response header is returned so + * that the client can check for message content integrity. * * @return the contentMd5 value. */ @@ -198,8 +202,9 @@ public byte[] getContentMd5() { } /** - * Set the contentMd5 property: If the file has an MD5 hash and this operation is to read the full file, this - * response header is returned so that the client can check for message content integrity. + * Set the contentMd5 property: If the file has an MD5 hash and this + * operation is to read the full file, this response header is returned so + * that the client can check for message content integrity. * * @param contentMd5 the contentMd5 value to set. * @return the FileQueryHeaders object itself. @@ -210,8 +215,8 @@ public FileQueryHeaders setContentMd5(byte[] contentMd5) { } /** - * Get the contentEncoding property: This header returns the value that was specified for the Content-Encoding - * request header. + * Get the contentEncoding property: This header returns the value that was + * specified for the Content-Encoding request header. * * @return the contentEncoding value. */ @@ -220,8 +225,8 @@ public String getContentEncoding() { } /** - * Set the contentEncoding property: This header returns the value that was specified for the Content-Encoding - * request header. + * Set the contentEncoding property: This header returns the value that was + * specified for the Content-Encoding request header. * * @param contentEncoding the contentEncoding value to set. * @return the FileQueryHeaders object itself. @@ -232,7 +237,8 @@ public FileQueryHeaders setContentEncoding(String contentEncoding) { } /** - * Get the cacheControl property: This header is returned if it was previously specified for the file. + * Get the cacheControl property: This header is returned if it was + * previously specified for the file. * * @return the cacheControl value. */ @@ -241,7 +247,8 @@ public String getCacheControl() { } /** - * Set the cacheControl property: This header is returned if it was previously specified for the file. + * Set the cacheControl property: This header is returned if it was + * previously specified for the file. * * @param cacheControl the cacheControl value to set. * @return the FileQueryHeaders object itself. @@ -252,11 +259,14 @@ public FileQueryHeaders setCacheControl(String cacheControl) { } /** - * Get the contentDisposition property: This header returns the value that was specified for the - * 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional - * information about how to process the response payload, and also can be used to attach additional metadata. For - * example, if set to attachment, it indicates that the user-agent should not display the response, but instead show - * a Save As dialog with a filename other than the file name specified. + * Get the contentDisposition property: This header returns the value that + * was specified for the 'x-ms-blob-content-disposition' header. The + * Content-Disposition response header field conveys additional information + * about how to process the response payload, and also can be used to + * attach additional metadata. For example, if set to attachment, it + * indicates that the user-agent should not display the response, but + * instead show a Save As dialog with a filename other than the file name + * specified. * * @return the contentDisposition value. */ @@ -265,11 +275,14 @@ public String getContentDisposition() { } /** - * Set the contentDisposition property: This header returns the value that was specified for the - * 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional - * information about how to process the response payload, and also can be used to attach additional metadata. For - * example, if set to attachment, it indicates that the user-agent should not display the response, but instead show - * a Save As dialog with a filename other than the file name specified. + * Set the contentDisposition property: This header returns the value that + * was specified for the 'x-ms-blob-content-disposition' header. The + * Content-Disposition response header field conveys additional information + * about how to process the response payload, and also can be used to + * attach additional metadata. For example, if set to attachment, it + * indicates that the user-agent should not display the response, but + * instead show a Save As dialog with a filename other than the file name + * specified. * * @param contentDisposition the contentDisposition value to set. * @return the FileQueryHeaders object itself. @@ -280,8 +293,8 @@ public FileQueryHeaders setContentDisposition(String contentDisposition) { } /** - * Get the contentLanguage property: This header returns the value that was specified for the Content-Language - * request header. + * Get the contentLanguage property: This header returns the value that was + * specified for the Content-Language request header. * * @return the contentLanguage value. */ @@ -290,8 +303,8 @@ public String getContentLanguage() { } /** - * Set the contentLanguage property: This header returns the value that was specified for the Content-Language - * request header. + * Set the contentLanguage property: This header returns the value that was + * specified for the Content-Language request header. * * @param contentLanguage the contentLanguage value to set. * @return the FileQueryHeaders object itself. @@ -302,11 +315,13 @@ public FileQueryHeaders setContentLanguage(String contentLanguage) { } /** - * Get the copyCompletionTime property: Conclusion time of the last attempted Copy Blob operation where this file - * was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt. This - * header does not appear if a copy is pending, if this file has never been the destination in a Copy Blob - * operation, or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put - * Blob, or Put Block List. + * Get the copyCompletionTime property: Conclusion time of the last + * attempted Copy Blob operation where this file was the destination file. + * This value can specify the time of a completed, aborted, or failed copy + * attempt. This header does not appear if a copy is pending, if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @return the copyCompletionTime value. */ @@ -318,11 +333,13 @@ public OffsetDateTime getCopyCompletionTime() { } /** - * Set the copyCompletionTime property: Conclusion time of the last attempted Copy Blob operation where this file - * was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt. This - * header does not appear if a copy is pending, if this file has never been the destination in a Copy Blob - * operation, or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put - * Blob, or Put Block List. + * Set the copyCompletionTime property: Conclusion time of the last + * attempted Copy Blob operation where this file was the destination file. + * This value can specify the time of a completed, aborted, or failed copy + * attempt. This header does not appear if a copy is pending, if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @param copyCompletionTime the copyCompletionTime value to set. * @return the FileQueryHeaders object itself. @@ -337,10 +354,12 @@ public FileQueryHeaders setCopyCompletionTime(OffsetDateTime copyCompletionTime) } /** - * Get the copyStatusDescription property: Only appears when x-ms-copy-status is failed or pending. Describes the - * cause of the last fatal or non-fatal copy operation failure. This header does not appear if this file has never - * been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy Blob - * operation using Set Blob Properties, Put Blob, or Put Block List. + * Get the copyStatusDescription property: Only appears when + * x-ms-copy-status is failed or pending. Describes the cause of the last + * fatal or non-fatal copy operation failure. This header does not appear + * if this file has never been the destination in a Copy Blob operation, or + * if this file has been modified after a concluded Copy Blob operation + * using Set Blob Properties, Put Blob, or Put Block List. * * @return the copyStatusDescription value. */ @@ -349,10 +368,12 @@ public String getCopyStatusDescription() { } /** - * Set the copyStatusDescription property: Only appears when x-ms-copy-status is failed or pending. Describes the - * cause of the last fatal or non-fatal copy operation failure. This header does not appear if this file has never - * been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy Blob - * operation using Set Blob Properties, Put Blob, or Put Block List. + * Set the copyStatusDescription property: Only appears when + * x-ms-copy-status is failed or pending. Describes the cause of the last + * fatal or non-fatal copy operation failure. This header does not appear + * if this file has never been the destination in a Copy Blob operation, or + * if this file has been modified after a concluded Copy Blob operation + * using Set Blob Properties, Put Blob, or Put Block List. * * @param copyStatusDescription the copyStatusDescription value to set. * @return the FileQueryHeaders object itself. @@ -363,8 +384,9 @@ public FileQueryHeaders setCopyStatusDescription(String copyStatusDescription) { } /** - * Get the copyId property: String identifier for this copy operation. Use with Get Blob Properties to check the - * status of this copy operation, or pass to Abort Copy Blob to abort a pending copy. + * Get the copyId property: String identifier for this copy operation. Use + * with Get Blob Properties to check the status of this copy operation, or + * pass to Abort Copy Blob to abort a pending copy. * * @return the copyId value. */ @@ -373,8 +395,9 @@ public String getCopyId() { } /** - * Set the copyId property: String identifier for this copy operation. Use with Get Blob Properties to check the - * status of this copy operation, or pass to Abort Copy Blob to abort a pending copy. + * Set the copyId property: String identifier for this copy operation. Use + * with Get Blob Properties to check the status of this copy operation, or + * pass to Abort Copy Blob to abort a pending copy. * * @param copyId the copyId value to set. * @return the FileQueryHeaders object itself. @@ -385,11 +408,13 @@ public FileQueryHeaders setCopyId(String copyId) { } /** - * Get the copyProgress property: Contains the number of bytes copied and the total bytes in the source in the last - * attempted Copy Blob operation where this file was the destination file. Can show between 0 and Content-Length - * bytes copied. This header does not appear if this file has never been the destination in a Copy Blob operation, - * or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or - * Put Block List. + * Get the copyProgress property: Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy Blob operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. This header does not appear if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @return the copyProgress value. */ @@ -398,11 +423,13 @@ public String getCopyProgress() { } /** - * Set the copyProgress property: Contains the number of bytes copied and the total bytes in the source in the last - * attempted Copy Blob operation where this file was the destination file. Can show between 0 and Content-Length - * bytes copied. This header does not appear if this file has never been the destination in a Copy Blob operation, - * or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or - * Put Block List. + * Set the copyProgress property: Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy Blob operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. This header does not appear if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @param copyProgress the copyProgress value to set. * @return the FileQueryHeaders object itself. @@ -413,10 +440,12 @@ public FileQueryHeaders setCopyProgress(String copyProgress) { } /** - * Get the copySource property: URL up to 2 KB in length that specifies the source file or file used in the last - * attempted Copy Blob operation where this file was the destination file. This header does not appear if this file - * has never been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy - * Blob operation using Set Blob Properties, Put Blob, or Put Block List. + * Get the copySource property: URL up to 2 KB in length that specifies the + * source file or file used in the last attempted Copy Blob operation where + * this file was the destination file. This header does not appear if this + * file has never been the destination in a Copy Blob operation, or if this + * file has been modified after a concluded Copy Blob operation using Set + * Blob Properties, Put Blob, or Put Block List. * * @return the copySource value. */ @@ -425,10 +454,12 @@ public String getCopySource() { } /** - * Set the copySource property: URL up to 2 KB in length that specifies the source file or file used in the last - * attempted Copy Blob operation where this file was the destination file. This header does not appear if this file - * has never been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy - * Blob operation using Set Blob Properties, Put Blob, or Put Block List. + * Set the copySource property: URL up to 2 KB in length that specifies the + * source file or file used in the last attempted Copy Blob operation where + * this file was the destination file. This header does not appear if this + * file has never been the destination in a Copy Blob operation, or if this + * file has been modified after a concluded Copy Blob operation using Set + * Blob Properties, Put Blob, or Put Block List. * * @param copySource the copySource value to set. * @return the FileQueryHeaders object itself. @@ -439,8 +470,9 @@ public FileQueryHeaders setCopySource(String copySource) { } /** - * Get the copyStatus property: State of the copy operation identified by x-ms-copy-id. Possible values include: - * 'pending', 'success', 'aborted', 'failed'. + * Get the copyStatus property: State of the copy operation identified by + * x-ms-copy-id. Possible values include: 'pending', 'success', 'aborted', + * 'failed'. * * @return the copyStatus value. */ @@ -449,8 +481,9 @@ public CopyStatusType getCopyStatus() { } /** - * Set the copyStatus property: State of the copy operation identified by x-ms-copy-id. Possible values include: - * 'pending', 'success', 'aborted', 'failed'. + * Set the copyStatus property: State of the copy operation identified by + * x-ms-copy-id. Possible values include: 'pending', 'success', 'aborted', + * 'failed'. * * @param copyStatus the copyStatus value to set. * @return the FileQueryHeaders object itself. @@ -461,8 +494,9 @@ public FileQueryHeaders setCopyStatus(CopyStatusType copyStatus) { } /** - * Get the leaseDuration property: When a file is leased, specifies whether the lease is of infinite or fixed - * duration. Possible values include: 'infinite', 'fixed'. + * Get the leaseDuration property: When a file is leased, specifies whether + * the lease is of infinite or fixed duration. Possible values include: + * 'infinite', 'fixed'. * * @return the leaseDuration value. */ @@ -471,8 +505,9 @@ public LeaseDurationType getLeaseDuration() { } /** - * Set the leaseDuration property: When a file is leased, specifies whether the lease is of infinite or fixed - * duration. Possible values include: 'infinite', 'fixed'. + * Set the leaseDuration property: When a file is leased, specifies whether + * the lease is of infinite or fixed duration. Possible values include: + * 'infinite', 'fixed'. * * @param leaseDuration the leaseDuration value to set. * @return the FileQueryHeaders object itself. @@ -483,8 +518,8 @@ public FileQueryHeaders setLeaseDuration(LeaseDurationType leaseDuration) { } /** - * Get the leaseState property: Lease state of the file. Possible values include: 'available', 'leased', 'expired', - * 'breaking', 'broken'. + * Get the leaseState property: Lease state of the file. Possible values + * include: 'available', 'leased', 'expired', 'breaking', 'broken'. * * @return the leaseState value. */ @@ -493,8 +528,8 @@ public LeaseStateType getLeaseState() { } /** - * Set the leaseState property: Lease state of the file. Possible values include: 'available', 'leased', 'expired', - * 'breaking', 'broken'. + * Set the leaseState property: Lease state of the file. Possible values + * include: 'available', 'leased', 'expired', 'breaking', 'broken'. * * @param leaseState the leaseState value to set. * @return the FileQueryHeaders object itself. @@ -505,8 +540,8 @@ public FileQueryHeaders setLeaseState(LeaseStateType leaseState) { } /** - * Get the leaseStatus property: The current lease status of the file. Possible values include: 'locked', - * 'unlocked'. + * Get the leaseStatus property: The current lease status of the file. + * Possible values include: 'locked', 'unlocked'. * * @return the leaseStatus value. */ @@ -515,8 +550,8 @@ public LeaseStatusType getLeaseStatus() { } /** - * Set the leaseStatus property: The current lease status of the file. Possible values include: 'locked', - * 'unlocked'. + * Set the leaseStatus property: The current lease status of the file. + * Possible values include: 'locked', 'unlocked'. * * @param leaseStatus the leaseStatus value to set. * @return the FileQueryHeaders object itself. @@ -527,8 +562,9 @@ public FileQueryHeaders setLeaseStatus(LeaseStatusType leaseStatus) { } /** - * Get the clientRequestId property: If a client request id header is sent in the request, this header will be - * present in the response with the same value. + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. * * @return the clientRequestId value. */ @@ -537,8 +573,9 @@ public String getClientRequestId() { } /** - * Set the clientRequestId property: If a client request id header is sent in the request, this header will be - * present in the response with the same value. + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. * * @param clientRequestId the clientRequestId value to set. * @return the FileQueryHeaders object itself. @@ -549,8 +586,8 @@ public FileQueryHeaders setClientRequestId(String clientRequestId) { } /** - * Get the requestId property: This header uniquely identifies the request that was made and can be used for - * troubleshooting the request. + * Get the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * * @return the requestId value. */ @@ -559,8 +596,8 @@ public String getRequestId() { } /** - * Set the requestId property: This header uniquely identifies the request that was made and can be used for - * troubleshooting the request. + * Set the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * * @param requestId the requestId value to set. * @return the FileQueryHeaders object itself. @@ -571,8 +608,9 @@ public FileQueryHeaders setRequestId(String requestId) { } /** - * Get the version property: Indicates the version of the Blob service used to execute the request. This header is - * returned for requests made against version 2009-09-19 and above. + * Get the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. * * @return the version value. */ @@ -581,8 +619,9 @@ public String getVersion() { } /** - * Set the version property: Indicates the version of the Blob service used to execute the request. This header is - * returned for requests made against version 2009-09-19 and above. + * Set the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. * * @param version the version value to set. * @return the FileQueryHeaders object itself. @@ -593,7 +632,8 @@ public FileQueryHeaders setVersion(String version) { } /** - * Get the acceptRanges property: Indicates that the service supports requests for partial file content. + * Get the acceptRanges property: Indicates that the service supports + * requests for partial file content. * * @return the acceptRanges value. */ @@ -602,7 +642,8 @@ public String getAcceptRanges() { } /** - * Set the acceptRanges property: Indicates that the service supports requests for partial file content. + * Set the acceptRanges property: Indicates that the service supports + * requests for partial file content. * * @param acceptRanges the acceptRanges value to set. * @return the FileQueryHeaders object itself. @@ -613,8 +654,8 @@ public FileQueryHeaders setAcceptRanges(String acceptRanges) { } /** - * Get the dateProperty property: UTC date/time value generated by the service that indicates the time at which the - * response was initiated. + * Get the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. * * @return the dateProperty value. */ @@ -626,8 +667,8 @@ public OffsetDateTime getDateProperty() { } /** - * Set the dateProperty property: UTC date/time value generated by the service that indicates the time at which the - * response was initiated. + * Set the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. * * @param dateProperty the dateProperty value to set. * @return the FileQueryHeaders object itself. @@ -642,9 +683,11 @@ public FileQueryHeaders setDateProperty(OffsetDateTime dateProperty) { } /** - * Get the isServerEncrypted property: The value of this header is set to true if the file data and application - * metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the - * file is unencrypted, or if only parts of the file/application metadata are encrypted). + * Get the isServerEncrypted property: The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false + * (when the file is unencrypted, or if only parts of the file/application + * metadata are encrypted). * * @return the isServerEncrypted value. */ @@ -653,9 +696,11 @@ public Boolean isServerEncrypted() { } /** - * Set the isServerEncrypted property: The value of this header is set to true if the file data and application - * metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the - * file is unencrypted, or if only parts of the file/application metadata are encrypted). + * Set the isServerEncrypted property: The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false + * (when the file is unencrypted, or if only parts of the file/application + * metadata are encrypted). * * @param serverEncrypted the isServerEncrypted value to set. * @return the FileQueryHeaders object itself. @@ -666,8 +711,9 @@ public FileQueryHeaders setServerEncrypted(Boolean serverEncrypted) { } /** - * Get the encryptionKeySha256 property: The SHA-256 hash of the encryption key used to encrypt the file. This - * header is only returned when the file was encrypted with a customer-provided key. + * Get the encryptionKeySha256 property: The SHA-256 hash of the encryption + * key used to encrypt the file. This header is only returned when the file + * was encrypted with a customer-provided key. * * @return the encryptionKeySha256 value. */ @@ -676,8 +722,9 @@ public String getEncryptionKeySha256() { } /** - * Set the encryptionKeySha256 property: The SHA-256 hash of the encryption key used to encrypt the file. This - * header is only returned when the file was encrypted with a customer-provided key. + * Set the encryptionKeySha256 property: The SHA-256 hash of the encryption + * key used to encrypt the file. This header is only returned when the file + * was encrypted with a customer-provided key. * * @param encryptionKeySha256 the encryptionKeySha256 value to set. * @return the FileQueryHeaders object itself. @@ -688,10 +735,11 @@ public FileQueryHeaders setEncryptionKeySha256(String encryptionKeySha256) { } /** - * Get the fileContentMD5 property: If the file has a MD5 hash, and if request contains range header - * (Range or x-ms-range), this response header is returned with the value of the whole file's MD5 value. This value - * may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the - * requested range. + * Get the fileContentMD5 property: If the file has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response + * header is returned with the value of the whole file's MD5 value. This + * value may or may not be equal to the value returned in Content-MD5 + * header, with the latter calculated from the requested range. * * @return the fileContentMD5 value. */ @@ -700,10 +748,11 @@ public byte[] getFileContentMd5() { } /** - * Set the fileContentMD5 property: If the file has a MD5 hash, and if request contains range header - * (Range or x-ms-range), this response header is returned with the value of the whole file's MD5 value. This value - * may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the - * requested range. + * Set the fileContentMD5 property: If the file has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response + * header is returned with the value of the whole file's MD5 value. This + * value may or may not be equal to the value returned in Content-MD5 + * header, with the latter calculated from the requested range. * * @param fileContentMd5 the fileContentMD5 value to set. * @return the FileQueryHeaders object itself. @@ -714,10 +763,12 @@ public FileQueryHeaders setFileContentMd5(byte[] fileContentMd5) { } /** - * Get the contentCrc64 property: If the request is to read a specified range and the x-ms-range-get-content-crc64 - * is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal - * to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, - * it will fail with 400(Bad Request). + * Get the contentCrc64 property: If the request is to read a specified + * range and the x-ms-range-get-content-crc64 is set to true, then the + * request returns a crc64 for the range, as long as the range size is less + * than or equal to 4 MB. If both x-ms-range-get-content-crc64 & + * x-ms-range-get-content-md5 is specified in the same request, it will + * fail with 400(Bad Request). * * @return the contentCrc64 value. */ @@ -726,10 +777,12 @@ public byte[] getContentCrc64() { } /** - * Set the contentCrc64 property: If the request is to read a specified range and the x-ms-range-get-content-crc64 - * is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal - * to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, - * it will fail with 400(Bad Request). + * Set the contentCrc64 property: If the request is to read a specified + * range and the x-ms-range-get-content-crc64 is set to true, then the + * request returns a crc64 for the range, as long as the range size is less + * than or equal to 4 MB. If both x-ms-range-get-content-crc64 & + * x-ms-range-get-content-md5 is specified in the same request, it will + * fail with 400(Bad Request). * * @param contentCrc64 the contentCrc64 value to set. * @return the FileQueryHeaders object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryJsonSerialization.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryJsonSerialization.java index d06de1de1885a..a1f4370207afc 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryJsonSerialization.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryJsonSerialization.java @@ -7,13 +7,8 @@ * Defines the input or output JSON serialization for a file query request. */ public class FileQueryJsonSerialization implements FileQuerySerialization { - private char recordSeparator; - /** - * Creates a new instance of {@link FileQueryJsonSerialization}. - */ - public FileQueryJsonSerialization() { - } + private char recordSeparator; /** * Gets the record separator. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryParquetSerialization.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryParquetSerialization.java index a6f2225dd7a0d..67759e53063d7 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryParquetSerialization.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryParquetSerialization.java @@ -7,9 +7,4 @@ * Defines the input parquet serialization for a file quick query request. */ public final class FileQueryParquetSerialization implements FileQuerySerialization { - /** - * Creates a new instance of {@link FileQueryParquetSerialization}. - */ - public FileQueryParquetSerialization() { - } } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryProgress.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryProgress.java index abb29f4da5204..291c60965046b 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryProgress.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileQueryProgress.java @@ -7,6 +7,7 @@ * Defines a file query error that can be returned on parsing a file query request. */ public class FileQueryProgress { + private final long bytesScanned; private final long totalBytes; @@ -21,8 +22,6 @@ public FileQueryProgress(long bytesScanned, long totalBytes) { } /** - * Gets the number of bytes scanned so far. - * * @return The number of bytes scanned so far. */ public long getBytesScanned() { @@ -30,8 +29,6 @@ public long getBytesScanned() { } /** - * Gets the total number of bytes in the file. - * * @return The total number of bytes in the file. */ public long getTotalBytes() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileRange.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileRange.java index f49844be88c49..5b9fd23ba60cb 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileRange.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileRange.java @@ -67,8 +67,7 @@ public Long getCount() { } /** - * Gets the string representation of the FileRange. - * @return A string compliant with the format of the Azure Storage x-ms-range and Range headers. + * @return A {@code String} compliant with the format of the Azure Storage x-ms-range and Range headers. */ @Override public String toString() { @@ -81,8 +80,6 @@ public String toString() { } /** - * Gets the string representation of the FileRange for use in a header value. - * * @return {@link FileRange#toString()} if {@code count} isn't {@code null} or {@code offset} isn't 0, otherwise * null. */ diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileReadHeaders.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileReadHeaders.java index 84ffabfb0485c..7bd77ff3f959a 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileReadHeaders.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileReadHeaders.java @@ -14,6 +14,7 @@ * Defines headers for Read operation. */ public final class FileReadHeaders { + private DateTimeRfc1123 lastModified; private Map metadata; private Long contentLength; @@ -49,15 +50,10 @@ public final class FileReadHeaders { private List accessControlList; /** - * Creates a new instance of {@link FileReadHeaders}. - */ - public FileReadHeaders() { - } - - /** - * Get the lastModified property: Returns the date and time the container was last modified. Any operation that - * modifies the file, including an update of the file's metadata or properties, changes the last-modified time of - * the file. + * Get the lastModified property: Returns the date and time the container + * was last modified. Any operation that modifies the file, including an + * update of the file's metadata or properties, changes the last-modified + * time of the file. * * @return the lastModified value. */ @@ -69,9 +65,10 @@ public OffsetDateTime getLastModified() { } /** - * Set the lastModified property: Returns the date and time the container was last modified. Any operation that - * modifies the file, including an update of the file's metadata or properties, changes the last-modified time of - * the file. + * Set the lastModified property: Returns the date and time the container + * was last modified. Any operation that modifies the file, including an + * update of the file's metadata or properties, changes the last-modified + * time of the file. * * @param lastModified the lastModified value to set. * @return the FileReadHeaders object itself. @@ -106,7 +103,8 @@ public FileReadHeaders setMetadata(Map metadata) { } /** - * Get the contentLength property: The number of bytes present in the response body. + * Get the contentLength property: The number of bytes present in the + * response body. * * @return the contentLength value. */ @@ -115,7 +113,8 @@ public Long getContentLength() { } /** - * Set the contentLength property: The number of bytes present in the response body. + * Set the contentLength property: The number of bytes present in the + * response body. * * @param contentLength the contentLength value to set. * @return the FileReadHeaders object itself. @@ -126,8 +125,8 @@ public FileReadHeaders setContentLength(Long contentLength) { } /** - * Get the contentType property: The media type of the body of the response. For Download Blob this is - * 'application/octet-stream'. + * Get the contentType property: The media type of the body of the + * response. For Download Blob this is 'application/octet-stream'. * * @return the contentType value. */ @@ -136,8 +135,8 @@ public String getContentType() { } /** - * Set the contentType property: The media type of the body of the response. For Download Blob this is - * 'application/octet-stream'. + * Set the contentType property: The media type of the body of the + * response. For Download Blob this is 'application/octet-stream'. * * @param contentType the contentType value to set. * @return the FileReadHeaders object itself. @@ -148,8 +147,9 @@ public FileReadHeaders setContentType(String contentType) { } /** - * Get the contentRange property: Indicates the range of bytes returned in the event that the client requested a - * subset of the file by setting the 'Range' request header. + * Get the contentRange property: Indicates the range of bytes returned in + * the event that the client requested a subset of the file by setting the + * 'Range' request header. * * @return the contentRange value. */ @@ -158,8 +158,9 @@ public String getContentRange() { } /** - * Set the contentRange property: Indicates the range of bytes returned in the event that the client requested a - * subset of the file by setting the 'Range' request header. + * Set the contentRange property: Indicates the range of bytes returned in + * the event that the client requested a subset of the file by setting the + * 'Range' request header. * * @param contentRange the contentRange value to set. * @return the FileReadHeaders object itself. @@ -170,8 +171,9 @@ public FileReadHeaders setContentRange(String contentRange) { } /** - * Get the eTag property: The ETag contains a value that you can use to perform operations conditionally. If the - * request version is 2011-08-18 or newer, the ETag value will be in quotes. + * Get the eTag property: The ETag contains a value that you can use to + * perform operations conditionally. If the request version is 2011-08-18 + * or newer, the ETag value will be in quotes. * * @return the eTag value. */ @@ -180,8 +182,9 @@ public String getETag() { } /** - * Set the eTag property: The ETag contains a value that you can use to perform operations conditionally. If the - * request version is 2011-08-18 or newer, the ETag value will be in quotes. + * Set the eTag property: The ETag contains a value that you can use to + * perform operations conditionally. If the request version is 2011-08-18 + * or newer, the ETag value will be in quotes. * * @param eTag the eTag value to set. * @return the FileReadHeaders object itself. @@ -192,8 +195,9 @@ public FileReadHeaders setETag(String eTag) { } /** - * Get the contentMd5 property: If the file has an MD5 hash and this operation is to read the full file, this - * response header is returned so that the client can check for message content integrity. + * Get the contentMd5 property: If the file has an MD5 hash and this + * operation is to read the full file, this response header is returned so + * that the client can check for message content integrity. * * @return the contentMd5 value. */ @@ -202,8 +206,9 @@ public byte[] getContentMd5() { } /** - * Set the contentMd5 property: If the file has an MD5 hash and this operation is to read the full file, this - * response header is returned so that the client can check for message content integrity. + * Set the contentMd5 property: If the file has an MD5 hash and this + * operation is to read the full file, this response header is returned so + * that the client can check for message content integrity. * * @param contentMd5 the contentMd5 value to set. * @return the FileReadHeaders object itself. @@ -214,8 +219,8 @@ public FileReadHeaders setContentMd5(byte[] contentMd5) { } /** - * Get the contentEncoding property: This header returns the value that was specified for the Content-Encoding - * request header. + * Get the contentEncoding property: This header returns the value that was + * specified for the Content-Encoding request header. * * @return the contentEncoding value. */ @@ -224,8 +229,8 @@ public String getContentEncoding() { } /** - * Set the contentEncoding property: This header returns the value that was specified for the Content-Encoding - * request header. + * Set the contentEncoding property: This header returns the value that was + * specified for the Content-Encoding request header. * * @param contentEncoding the contentEncoding value to set. * @return the FileReadHeaders object itself. @@ -236,7 +241,8 @@ public FileReadHeaders setContentEncoding(String contentEncoding) { } /** - * Get the cacheControl property: This header is returned if it was previously specified for the file. + * Get the cacheControl property: This header is returned if it was + * previously specified for the file. * * @return the cacheControl value. */ @@ -245,7 +251,8 @@ public String getCacheControl() { } /** - * Set the cacheControl property: This header is returned if it was previously specified for the file. + * Set the cacheControl property: This header is returned if it was + * previously specified for the file. * * @param cacheControl the cacheControl value to set. * @return the FileReadHeaders object itself. @@ -256,11 +263,14 @@ public FileReadHeaders setCacheControl(String cacheControl) { } /** - * Get the contentDisposition property: This header returns the value that was specified for the - * 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional - * information about how to process the response payload, and also can be used to attach additional metadata. For - * example, if set to attachment, it indicates that the user-agent should not display the response, but instead show - * a Save As dialog with a filename other than the file name specified. + * Get the contentDisposition property: This header returns the value that + * was specified for the 'x-ms-blob-content-disposition' header. The + * Content-Disposition response header field conveys additional information + * about how to process the response payload, and also can be used to + * attach additional metadata. For example, if set to attachment, it + * indicates that the user-agent should not display the response, but + * instead show a Save As dialog with a filename other than the file name + * specified. * * @return the contentDisposition value. */ @@ -269,11 +279,14 @@ public String getContentDisposition() { } /** - * Set the contentDisposition property: This header returns the value that was specified for the - * 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional - * information about how to process the response payload, and also can be used to attach additional metadata. For - * example, if set to attachment, it indicates that the user-agent should not display the response, but instead show - * a Save As dialog with a filename other than the file name specified. + * Set the contentDisposition property: This header returns the value that + * was specified for the 'x-ms-blob-content-disposition' header. The + * Content-Disposition response header field conveys additional information + * about how to process the response payload, and also can be used to + * attach additional metadata. For example, if set to attachment, it + * indicates that the user-agent should not display the response, but + * instead show a Save As dialog with a filename other than the file name + * specified. * * @param contentDisposition the contentDisposition value to set. * @return the FileReadHeaders object itself. @@ -284,8 +297,8 @@ public FileReadHeaders setContentDisposition(String contentDisposition) { } /** - * Get the contentLanguage property: This header returns the value that was specified for the Content-Language - * request header. + * Get the contentLanguage property: This header returns the value that was + * specified for the Content-Language request header. * * @return the contentLanguage value. */ @@ -294,8 +307,8 @@ public String getContentLanguage() { } /** - * Set the contentLanguage property: This header returns the value that was specified for the Content-Language - * request header. + * Set the contentLanguage property: This header returns the value that was + * specified for the Content-Language request header. * * @param contentLanguage the contentLanguage value to set. * @return the FileReadHeaders object itself. @@ -306,11 +319,13 @@ public FileReadHeaders setContentLanguage(String contentLanguage) { } /** - * Get the copyCompletionTime property: Conclusion time of the last attempted Copy Blob operation where this file - * was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt. This - * header does not appear if a copy is pending, if this file has never been the destination in a Copy Blob - * operation, or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put - * Blob, or Put Block List. + * Get the copyCompletionTime property: Conclusion time of the last + * attempted Copy Blob operation where this file was the destination file. + * This value can specify the time of a completed, aborted, or failed copy + * attempt. This header does not appear if a copy is pending, if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @return the copyCompletionTime value. */ @@ -322,11 +337,13 @@ public OffsetDateTime getCopyCompletionTime() { } /** - * Set the copyCompletionTime property: Conclusion time of the last attempted Copy Blob operation where this file - * was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt. This - * header does not appear if a copy is pending, if this file has never been the destination in a Copy Blob - * operation, or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put - * Blob, or Put Block List. + * Set the copyCompletionTime property: Conclusion time of the last + * attempted Copy Blob operation where this file was the destination file. + * This value can specify the time of a completed, aborted, or failed copy + * attempt. This header does not appear if a copy is pending, if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @param copyCompletionTime the copyCompletionTime value to set. * @return the FileReadHeaders object itself. @@ -341,10 +358,12 @@ public FileReadHeaders setCopyCompletionTime(OffsetDateTime copyCompletionTime) } /** - * Get the copyStatusDescription property: Only appears when x-ms-copy-status is failed or pending. Describes the - * cause of the last fatal or non-fatal copy operation failure. This header does not appear if this file has never - * been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy Blob - * operation using Set Blob Properties, Put Blob, or Put Block List. + * Get the copyStatusDescription property: Only appears when + * x-ms-copy-status is failed or pending. Describes the cause of the last + * fatal or non-fatal copy operation failure. This header does not appear + * if this file has never been the destination in a Copy Blob operation, or + * if this file has been modified after a concluded Copy Blob operation + * using Set Blob Properties, Put Blob, or Put Block List. * * @return the copyStatusDescription value. */ @@ -353,10 +372,12 @@ public String getCopyStatusDescription() { } /** - * Set the copyStatusDescription property: Only appears when x-ms-copy-status is failed or pending. Describes the - * cause of the last fatal or non-fatal copy operation failure. This header does not appear if this file has never - * been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy Blob - * operation using Set Blob Properties, Put Blob, or Put Block List. + * Set the copyStatusDescription property: Only appears when + * x-ms-copy-status is failed or pending. Describes the cause of the last + * fatal or non-fatal copy operation failure. This header does not appear + * if this file has never been the destination in a Copy Blob operation, or + * if this file has been modified after a concluded Copy Blob operation + * using Set Blob Properties, Put Blob, or Put Block List. * * @param copyStatusDescription the copyStatusDescription value to set. * @return the FileReadHeaders object itself. @@ -367,8 +388,9 @@ public FileReadHeaders setCopyStatusDescription(String copyStatusDescription) { } /** - * Get the copyId property: String identifier for this copy operation. Use with Get Blob Properties to check the - * status of this copy operation, or pass to Abort Copy Blob to abort a pending copy. + * Get the copyId property: String identifier for this copy operation. Use + * with Get Blob Properties to check the status of this copy operation, or + * pass to Abort Copy Blob to abort a pending copy. * * @return the copyId value. */ @@ -377,8 +399,9 @@ public String getCopyId() { } /** - * Set the copyId property: String identifier for this copy operation. Use with Get Blob Properties to check the - * status of this copy operation, or pass to Abort Copy Blob to abort a pending copy. + * Set the copyId property: String identifier for this copy operation. Use + * with Get Blob Properties to check the status of this copy operation, or + * pass to Abort Copy Blob to abort a pending copy. * * @param copyId the copyId value to set. * @return the FileReadHeaders object itself. @@ -389,11 +412,13 @@ public FileReadHeaders setCopyId(String copyId) { } /** - * Get the copyProgress property: Contains the number of bytes copied and the total bytes in the source in the last - * attempted Copy Blob operation where this file was the destination file. Can show between 0 and Content-Length - * bytes copied. This header does not appear if this file has never been the destination in a Copy Blob operation, - * or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or - * Put Block List. + * Get the copyProgress property: Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy Blob operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. This header does not appear if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @return the copyProgress value. */ @@ -402,11 +427,13 @@ public String getCopyProgress() { } /** - * Set the copyProgress property: Contains the number of bytes copied and the total bytes in the source in the last - * attempted Copy Blob operation where this file was the destination file. Can show between 0 and Content-Length - * bytes copied. This header does not appear if this file has never been the destination in a Copy Blob operation, - * or if this file has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or - * Put Block List. + * Set the copyProgress property: Contains the number of bytes copied and + * the total bytes in the source in the last attempted Copy Blob operation + * where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. This header does not appear if this file + * has never been the destination in a Copy Blob operation, or if this file + * has been modified after a concluded Copy Blob operation using Set Blob + * Properties, Put Blob, or Put Block List. * * @param copyProgress the copyProgress value to set. * @return the FileReadHeaders object itself. @@ -417,10 +444,12 @@ public FileReadHeaders setCopyProgress(String copyProgress) { } /** - * Get the copySource property: URL up to 2 KB in length that specifies the source file or file used in the last - * attempted Copy Blob operation where this file was the destination file. This header does not appear if this file - * has never been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy - * Blob operation using Set Blob Properties, Put Blob, or Put Block List. + * Get the copySource property: URL up to 2 KB in length that specifies the + * source file or file used in the last attempted Copy Blob operation where + * this file was the destination file. This header does not appear if this + * file has never been the destination in a Copy Blob operation, or if this + * file has been modified after a concluded Copy Blob operation using Set + * Blob Properties, Put Blob, or Put Block List. * * @return the copySource value. */ @@ -429,10 +458,12 @@ public String getCopySource() { } /** - * Set the copySource property: URL up to 2 KB in length that specifies the source file or file used in the last - * attempted Copy Blob operation where this file was the destination file. This header does not appear if this file - * has never been the destination in a Copy Blob operation, or if this file has been modified after a concluded Copy - * Blob operation using Set Blob Properties, Put Blob, or Put Block List. + * Set the copySource property: URL up to 2 KB in length that specifies the + * source file or file used in the last attempted Copy Blob operation where + * this file was the destination file. This header does not appear if this + * file has never been the destination in a Copy Blob operation, or if this + * file has been modified after a concluded Copy Blob operation using Set + * Blob Properties, Put Blob, or Put Block List. * * @param copySource the copySource value to set. * @return the FileReadHeaders object itself. @@ -443,8 +474,9 @@ public FileReadHeaders setCopySource(String copySource) { } /** - * Get the copyStatus property: State of the copy operation identified by x-ms-copy-id. Possible values include: - * 'pending', 'success', 'aborted', 'failed'. + * Get the copyStatus property: State of the copy operation identified by + * x-ms-copy-id. Possible values include: 'pending', 'success', 'aborted', + * 'failed'. * * @return the copyStatus value. */ @@ -453,8 +485,9 @@ public CopyStatusType getCopyStatus() { } /** - * Set the copyStatus property: State of the copy operation identified by x-ms-copy-id. Possible values include: - * 'pending', 'success', 'aborted', 'failed'. + * Set the copyStatus property: State of the copy operation identified by + * x-ms-copy-id. Possible values include: 'pending', 'success', 'aborted', + * 'failed'. * * @param copyStatus the copyStatus value to set. * @return the FileReadHeaders object itself. @@ -465,8 +498,9 @@ public FileReadHeaders setCopyStatus(CopyStatusType copyStatus) { } /** - * Get the leaseDuration property: When a file is leased, specifies whether the lease is of infinite or fixed - * duration. Possible values include: 'infinite', 'fixed'. + * Get the leaseDuration property: When a file is leased, specifies whether + * the lease is of infinite or fixed duration. Possible values include: + * 'infinite', 'fixed'. * * @return the leaseDuration value. */ @@ -475,8 +509,9 @@ public LeaseDurationType getLeaseDuration() { } /** - * Set the leaseDuration property: When a file is leased, specifies whether the lease is of infinite or fixed - * duration. Possible values include: 'infinite', 'fixed'. + * Set the leaseDuration property: When a file is leased, specifies whether + * the lease is of infinite or fixed duration. Possible values include: + * 'infinite', 'fixed'. * * @param leaseDuration the leaseDuration value to set. * @return the FileReadHeaders object itself. @@ -487,8 +522,8 @@ public FileReadHeaders setLeaseDuration(LeaseDurationType leaseDuration) { } /** - * Get the leaseState property: Lease state of the file. Possible values include: 'available', 'leased', 'expired', - * 'breaking', 'broken'. + * Get the leaseState property: Lease state of the file. Possible values + * include: 'available', 'leased', 'expired', 'breaking', 'broken'. * * @return the leaseState value. */ @@ -497,8 +532,8 @@ public LeaseStateType getLeaseState() { } /** - * Set the leaseState property: Lease state of the file. Possible values include: 'available', 'leased', 'expired', - * 'breaking', 'broken'. + * Set the leaseState property: Lease state of the file. Possible values + * include: 'available', 'leased', 'expired', 'breaking', 'broken'. * * @param leaseState the leaseState value to set. * @return the FileReadHeaders object itself. @@ -509,8 +544,8 @@ public FileReadHeaders setLeaseState(LeaseStateType leaseState) { } /** - * Get the leaseStatus property: The current lease status of the file. Possible values include: 'locked', - * 'unlocked'. + * Get the leaseStatus property: The current lease status of the file. + * Possible values include: 'locked', 'unlocked'. * * @return the leaseStatus value. */ @@ -519,8 +554,8 @@ public LeaseStatusType getLeaseStatus() { } /** - * Set the leaseStatus property: The current lease status of the file. Possible values include: 'locked', - * 'unlocked'. + * Set the leaseStatus property: The current lease status of the file. + * Possible values include: 'locked', 'unlocked'. * * @param leaseStatus the leaseStatus value to set. * @return the FileReadHeaders object itself. @@ -531,8 +566,9 @@ public FileReadHeaders setLeaseStatus(LeaseStatusType leaseStatus) { } /** - * Get the clientRequestId property: If a client request id header is sent in the request, this header will be - * present in the response with the same value. + * Get the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. * * @return the clientRequestId value. */ @@ -541,8 +577,9 @@ public String getClientRequestId() { } /** - * Set the clientRequestId property: If a client request id header is sent in the request, this header will be - * present in the response with the same value. + * Set the clientRequestId property: If a client request id header is sent + * in the request, this header will be present in the response with the + * same value. * * @param clientRequestId the clientRequestId value to set. * @return the FileReadHeaders object itself. @@ -553,8 +590,8 @@ public FileReadHeaders setClientRequestId(String clientRequestId) { } /** - * Get the requestId property: This header uniquely identifies the request that was made and can be used for - * troubleshooting the request. + * Get the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * * @return the requestId value. */ @@ -563,8 +600,8 @@ public String getRequestId() { } /** - * Set the requestId property: This header uniquely identifies the request that was made and can be used for - * troubleshooting the request. + * Set the requestId property: This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * * @param requestId the requestId value to set. * @return the FileReadHeaders object itself. @@ -575,8 +612,9 @@ public FileReadHeaders setRequestId(String requestId) { } /** - * Get the version property: Indicates the version of the Blob service used to execute the request. This header is - * returned for requests made against version 2009-09-19 and above. + * Get the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. * * @return the version value. */ @@ -585,8 +623,9 @@ public String getVersion() { } /** - * Set the version property: Indicates the version of the Blob service used to execute the request. This header is - * returned for requests made against version 2009-09-19 and above. + * Set the version property: Indicates the version of the Blob service used + * to execute the request. This header is returned for requests made + * against version 2009-09-19 and above. * * @param version the version value to set. * @return the FileReadHeaders object itself. @@ -597,7 +636,8 @@ public FileReadHeaders setVersion(String version) { } /** - * Get the acceptRanges property: Indicates that the service supports requests for partial file content. + * Get the acceptRanges property: Indicates that the service supports + * requests for partial file content. * * @return the acceptRanges value. */ @@ -606,7 +646,8 @@ public String getAcceptRanges() { } /** - * Set the acceptRanges property: Indicates that the service supports requests for partial file content. + * Set the acceptRanges property: Indicates that the service supports + * requests for partial file content. * * @param acceptRanges the acceptRanges value to set. * @return the FileReadHeaders object itself. @@ -617,8 +658,8 @@ public FileReadHeaders setAcceptRanges(String acceptRanges) { } /** - * Get the dateProperty property: UTC date/time value generated by the service that indicates the time at which the - * response was initiated. + * Get the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. * * @return the dateProperty value. */ @@ -630,8 +671,8 @@ public OffsetDateTime getDateProperty() { } /** - * Set the dateProperty property: UTC date/time value generated by the service that indicates the time at which the - * response was initiated. + * Set the dateProperty property: UTC date/time value generated by the + * service that indicates the time at which the response was initiated. * * @param dateProperty the dateProperty value to set. * @return the FileReadHeaders object itself. @@ -646,9 +687,11 @@ public FileReadHeaders setDateProperty(OffsetDateTime dateProperty) { } /** - * Get the isServerEncrypted property: The value of this header is set to true if the file data and application - * metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the - * file is unencrypted, or if only parts of the file/application metadata are encrypted). + * Get the isServerEncrypted property: The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false + * (when the file is unencrypted, or if only parts of the file/application + * metadata are encrypted). * * @return the isServerEncrypted value. */ @@ -657,9 +700,11 @@ public Boolean isServerEncrypted() { } /** - * Set the isServerEncrypted property: The value of this header is set to true if the file data and application - * metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the - * file is unencrypted, or if only parts of the file/application metadata are encrypted). + * Set the isServerEncrypted property: The value of this header is set to + * true if the file data and application metadata are completely encrypted + * using the specified algorithm. Otherwise, the value is set to false + * (when the file is unencrypted, or if only parts of the file/application + * metadata are encrypted). * * @param serverEncrypted the isServerEncrypted value to set. * @return the FileReadHeaders object itself. @@ -670,8 +715,9 @@ public FileReadHeaders setServerEncrypted(Boolean serverEncrypted) { } /** - * Get the encryptionKeySha256 property: The SHA-256 hash of the encryption key used to encrypt the file. This - * header is only returned when the file was encrypted with a customer-provided key. + * Get the encryptionKeySha256 property: The SHA-256 hash of the encryption + * key used to encrypt the file. This header is only returned when the file + * was encrypted with a customer-provided key. * * @return the encryptionKeySha256 value. */ @@ -680,8 +726,9 @@ public String getEncryptionKeySha256() { } /** - * Set the encryptionKeySha256 property: The SHA-256 hash of the encryption key used to encrypt the file. This - * header is only returned when the file was encrypted with a customer-provided key. + * Set the encryptionKeySha256 property: The SHA-256 hash of the encryption + * key used to encrypt the file. This header is only returned when the file + * was encrypted with a customer-provided key. * * @param encryptionKeySha256 the encryptionKeySha256 value to set. * @return the FileReadHeaders object itself. @@ -692,10 +739,11 @@ public FileReadHeaders setEncryptionKeySha256(String encryptionKeySha256) { } /** - * Get the fileContentMD5 property: If the file has a MD5 hash, and if request contains range header - * (Range or x-ms-range), this response header is returned with the value of the whole file's MD5 value. This value - * may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the - * requested range. + * Get the fileContentMD5 property: If the file has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response + * header is returned with the value of the whole file's MD5 value. This + * value may or may not be equal to the value returned in Content-MD5 + * header, with the latter calculated from the requested range. * * @return the fileContentMD5 value. */ @@ -704,10 +752,11 @@ public byte[] getFileContentMd5() { } /** - * Set the fileContentMD5 property: If the file has a MD5 hash, and if request contains range header - * (Range or x-ms-range), this response header is returned with the value of the whole file's MD5 value. This value - * may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the - * requested range. + * Set the fileContentMD5 property: If the file has a MD5 hash, and if + * request contains range header (Range or x-ms-range), this response + * header is returned with the value of the whole file's MD5 value. This + * value may or may not be equal to the value returned in Content-MD5 + * header, with the latter calculated from the requested range. * * @param fileContentMd5 the fileContentMD5 value to set. * @return the FileReadHeaders object itself. @@ -718,10 +767,12 @@ public FileReadHeaders setFileContentMd5(byte[] fileContentMd5) { } /** - * Get the contentCrc64 property: If the request is to read a specified range and the x-ms-range-get-content-crc64 - * is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal - * to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, - * it will fail with 400(Bad Request). + * Get the contentCrc64 property: If the request is to read a specified + * range and the x-ms-range-get-content-crc64 is set to true, then the + * request returns a crc64 for the range, as long as the range size is less + * than or equal to 4 MB. If both x-ms-range-get-content-crc64 & + * x-ms-range-get-content-md5 is specified in the same request, it will + * fail with 400(Bad Request). * * @return the contentCrc64 value. */ @@ -730,10 +781,12 @@ public byte[] getContentCrc64() { } /** - * Set the contentCrc64 property: If the request is to read a specified range and the x-ms-range-get-content-crc64 - * is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal - * to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, - * it will fail with 400(Bad Request). + * Set the contentCrc64 property: If the request is to read a specified + * range and the x-ms-range-get-content-crc64 is set to true, then the + * request returns a crc64 for the range, as long as the range size is less + * than or equal to 4 MB. If both x-ms-range-get-content-crc64 & + * x-ms-range-get-content-md5 is specified in the same request, it will + * fail with 400(Bad Request). * * @param contentCrc64 the contentCrc64 value to set. * @return the FileReadHeaders object itself. @@ -793,8 +846,8 @@ public String getEncryptionContext() { } /** - * Encryption context that can be set on the file. Encryption context is intended to store metadata that can be used - * to decrypt the blob. + * Encryption context that can be set on the file. Encryption context is intended to store metadata that + * can be used to decrypt the blob. * * @param encryptionContext the encryption context to be set on the file. * @return the FileReadHeaders object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemAccessPolicies.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemAccessPolicies.java index a5ee411b6a073..5ea3e34dd35d7 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemAccessPolicies.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemAccessPolicies.java @@ -24,8 +24,6 @@ public FileSystemAccessPolicies(PublicAccessType dataLakeAccessType, List getIdentifiers() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItem.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItem.java index 7850f7f373ccf..75c32652f9f65 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItem.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItem.java @@ -15,12 +15,6 @@ public class FileSystemItem { private FileSystemItemProperties properties; private Map metadata; - /** - * Creates a new instance of {@link FileSystemItem}. - */ - public FileSystemItem() { - } - /** * Get the name property: The name property. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItemProperties.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItemProperties.java index d44d4ed01f803..230c791a94fec 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItemProperties.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemItemProperties.java @@ -11,6 +11,7 @@ * Properties of a file system. */ public final class FileSystemItemProperties { + private DateTimeRfc1123 lastModified; private String eTag; private LeaseStatusType leaseStatus; @@ -22,12 +23,6 @@ public final class FileSystemItemProperties { private String encryptionScope; private Boolean encryptionScopeOverridePrevented; - /** - * Creates a new instance of {@link FileSystemItemProperties}. - */ - public FileSystemItemProperties() { - } - /** * Get the lastModified property: The lastModified property. * @@ -76,7 +71,8 @@ public FileSystemItemProperties setETag(String eTag) { } /** - * Get the leaseStatus property: Possible values include: 'locked', 'unlocked'. + * Get the leaseStatus property: Possible values include: 'locked', + * 'unlocked'. * * @return the leaseStatus value. */ @@ -85,7 +81,8 @@ public LeaseStatusType getLeaseStatus() { } /** - * Set the leaseStatus property: Possible values include: 'locked', 'unlocked'. + * Set the leaseStatus property: Possible values include: 'locked', + * 'unlocked'. * * @param leaseStatus the leaseStatus value to set. * @return the FileSystemItemProperties object itself. @@ -96,7 +93,8 @@ public FileSystemItemProperties setLeaseStatus(LeaseStatusType leaseStatus) { } /** - * Get the leaseState property: Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * Get the leaseState property: Possible values include: 'available', + * 'leased', 'expired', 'breaking', 'broken'. * * @return the leaseState value. */ @@ -105,7 +103,8 @@ public LeaseStateType getLeaseState() { } /** - * Set the leaseState property: Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * Set the leaseState property: Possible values include: 'available', + * 'leased', 'expired', 'breaking', 'broken'. * * @param leaseState the leaseState value to set. * @return the FileSystemItemProperties object itself. @@ -116,7 +115,8 @@ public FileSystemItemProperties setLeaseState(LeaseStateType leaseState) { } /** - * Get the leaseDuration property: Possible values include: 'infinite', 'fixed'. + * Get the leaseDuration property: Possible values include: 'infinite', + * 'fixed'. * * @return the leaseDuration value. */ @@ -125,7 +125,8 @@ public LeaseDurationType getLeaseDuration() { } /** - * Set the leaseDuration property: Possible values include: 'infinite', 'fixed'. + * Set the leaseDuration property: Possible values include: 'infinite', + * 'fixed'. * * @param leaseDuration the leaseDuration value to set. * @return the FileSystemItemProperties object itself. @@ -136,7 +137,8 @@ public FileSystemItemProperties setLeaseDuration(LeaseDurationType leaseDuration } /** - * Get the publicAccess property: Possible values include: 'container', 'blob'. + * Get the publicAccess property: Possible values include: 'container', + * 'blob'. * * @return the publicAccess value. */ @@ -145,7 +147,8 @@ public PublicAccessType getPublicAccess() { } /** - * Set the publicAccess property: Possible values include: 'container', 'blob'. + * Set the publicAccess property: Possible values include: 'container', + * 'blob'. * * @param publicAccess the publicAccess value to set. * @return the FileSystemItemProperties object itself. @@ -156,7 +159,8 @@ public FileSystemItemProperties setPublicAccess(PublicAccessType publicAccess) { } /** - * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy property. + * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy + * property. * * @return the hasImmutabilityPolicy value. */ @@ -165,7 +169,8 @@ public Boolean hasImmutabilityPolicy() { } /** - * Set the hasImmutabilityPolicy property: The hasImmutabilityPolicy property. + * Set the hasImmutabilityPolicy property: The hasImmutabilityPolicy + * property. * * @param hasImmutabilityPolicy the hasImmutabilityPolicy value to set. * @return the FileSystemItemProperties object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemListDetails.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemListDetails.java index 96bc5a3c984bd..b17490deab1d0 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemListDetails.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemListDetails.java @@ -12,6 +12,7 @@ * new object. Null may be passed if none of the options are desirable. */ public final class FileSystemListDetails { + private boolean retrieveMetadata; private boolean retrieveDeleted; private boolean retrieveSystemFileSystems; @@ -20,6 +21,7 @@ public final class FileSystemListDetails { * Creates a new instance of {@link FileSystemListDetails}. */ public FileSystemListDetails() { + } /** @@ -83,8 +85,6 @@ public FileSystemListDetails setRetrieveSystemFileSystems(boolean retrieveSystem } /** - * Gets the listing flags. - * * @return the listing flags */ public ListFileSystemsIncludeType toIncludeType() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemProperties.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemProperties.java index ef47f2b3e71a9..d0e6702e2cb17 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemProperties.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/FileSystemProperties.java @@ -62,8 +62,6 @@ public FileSystemProperties(final Map metadata, final String eTa } /** - * Gets the metadata associated with the file system. - * * @return the metadata associated with the file system */ public Map getMetadata() { @@ -71,8 +69,6 @@ public Map getMetadata() { } /** - * Gets the eTag of the file system. - * * @return the eTag of the file system */ public String getETag() { @@ -80,8 +76,6 @@ public String getETag() { } /** - * Gets the time the file system was last modified. - * * @return the time the file system was last modified */ public OffsetDateTime getLastModified() { @@ -89,8 +83,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the type of lease on the file system. - * * @return the type of lease on the file system */ public LeaseDurationType getLeaseDuration() { @@ -98,8 +90,6 @@ public LeaseDurationType getLeaseDuration() { } /** - * Gets the lease state of the file system. - * * @return the lease state of the file system */ public LeaseStateType getLeaseState() { @@ -107,8 +97,6 @@ public LeaseStateType getLeaseState() { } /** - * Gets the lease status of the file system. - * * @return the lease status of the file system */ public LeaseStatusType getLeaseStatus() { @@ -116,8 +104,6 @@ public LeaseStatusType getLeaseStatus() { } /** - * Gets the access type for the file system. - * * @return the access type for the file system */ public PublicAccessType getDataLakePublicAccess() { @@ -125,8 +111,6 @@ public PublicAccessType getDataLakePublicAccess() { } /** - * Gets the immutability status for the file system. - * * @return the immutability status for the file system */ public boolean hasImmutabilityPolicy() { @@ -134,8 +118,6 @@ public boolean hasImmutabilityPolicy() { } /** - * Gets the legal hold status for the file system. - * * @return the legal hold status for the file system */ public boolean hasLegalHold() { @@ -143,8 +125,6 @@ public boolean hasLegalHold() { } /** - * Gets the file system's encryption scope. - * * @return the file system's encryption scope */ public String getEncryptionScope() { @@ -152,8 +132,6 @@ public String getEncryptionScope() { } /** - * Gets the file system's deny encryption scope override property. - * * @return the file system's deny encryption scope override property. */ public Boolean isEncryptionScopeOverridePrevented() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ListFileSystemsOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ListFileSystemsOptions.java index 40ae87419f748..cd0a9df1c484c 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ListFileSystemsOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/ListFileSystemsOptions.java @@ -15,7 +15,9 @@ public final class ListFileSystemsOptions { private static final ClientLogger LOGGER = new ClientLogger(ListFileSystemsOptions.class); private FileSystemListDetails details; + private String prefix; + private Integer maxResultsPerPage; /** @@ -26,8 +28,6 @@ public ListFileSystemsOptions() { } /** - * Gets the details for listing specific file systems. - * * @return the details for listing specific file systems */ public FileSystemListDetails getDetails() { @@ -35,8 +35,6 @@ public FileSystemListDetails getDetails() { } /** - * Sets the details for listing specific file systems. - * * @param details The details for listing specific file systems * @return the updated FileSystemListDetails object */ diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControl.java index fb87c1fe3b242..76e3cd6ffc020 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControl.java @@ -9,6 +9,7 @@ * This class contains properties that are gettable and settable for path access control. */ public class PathAccessControl { + private final List accessControlList; private final String group; private final String owner; diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControlEntry.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControlEntry.java index 9ff4aef89da8e..a4b83f6653a6f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControlEntry.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathAccessControlEntry.java @@ -65,7 +65,7 @@ public class PathAccessControlEntry { /** * Specifies the entity for which this entry applies. This is an AAD ObjectId. - *

+ * * Must be omitted for types mask or other. It must also be omitted when the user or group is the owner. */ private String entityId; @@ -136,7 +136,7 @@ public String toString() { /** * Parses the provided string into a {@code List<{@link PathAccessControlEntry}>}. - *

+ * * Must be of the format "[scope:][type]:[id]:[permissions]". * * @param str The string representation of the ACL. @@ -234,7 +234,7 @@ public RolePermissions getPermissions() { } /** - * Sets whether this entry is the default for a directory. + * Sets whether or not this entry is the default for a directory. * * @param defaultScope {@code true} to set as the default scope and {@code false} otherwise. * @return The updated PathAccessControlEntry object. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathInfo.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathInfo.java index 59aa550fd70c9..39c8a63069c53 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathInfo.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathInfo.java @@ -10,6 +10,7 @@ * operations. */ public class PathInfo { + private final String eTag; private final OffsetDateTime lastModified; private final boolean isServerEncrypted; @@ -57,8 +58,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the encryption status of the block blob on the server. - * * @return the encryption status of the block blob on the server */ public Boolean isServerEncrypted() { @@ -66,8 +65,6 @@ public Boolean isServerEncrypted() { } /** - * Gets the key used to encrypt the block blob. - * * @return the key used to encrypt the block blob */ public String getEncryptionKeySha256() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathItem.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathItem.java index 52d51e0cd9000..6eda02fefba53 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathItem.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathItem.java @@ -39,7 +39,7 @@ public class PathItem { * @param lastModified Datetime when the path was last modified. * @param contentLength The content length of the path. * @param group The group the path belongs to. - * @param isDirectory Whether the path is a directory. + * @param isDirectory Whether or not the path is a directory. * @param name The name of the path. * @param owner The owner the path belongs to. * @param permissions The permissions set on the path. @@ -55,7 +55,7 @@ public PathItem(String eTag, OffsetDateTime lastModified, long contentLength, St * @param lastModified Datetime when the path was last modified. * @param contentLength The content length of the path. * @param group The group the path belongs to. - * @param isDirectory Whether the path is a directory. + * @param isDirectory Whether or not the path is a directory. * @param name The name of the path. * @param owner The owner the path belongs to. * @param permissions The permissions set on the path. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathPermissions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathPermissions.java index 430a00f560aaf..2087641c853aa 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathPermissions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathPermissions.java @@ -14,6 +14,7 @@ * Manipulating resource permissions is only supported when ADLS interop and Hierarchical Namespace are enabled. */ public class PathPermissions { + private static final String PATH_PERMISSIONS_OCTAL_FORMAT_ERROR = "String cannot be null and must be four " + "characters (first bit--sticky bit--must be set to 0 for umask)."; private static final String PATH_PERMISSIONS_SYMBOLIC_FORMAT_ERROR @@ -93,7 +94,7 @@ public int hashCode() { /** * Converts an octal string into a {@code PathPermissions} object. - *

+ * * e.g. 1752 * 0/1 in the first digit indicates sticky bit. Each subsequent octal character can be expanded into three bits. * In order of MSB to LSB, the bits represent read, write, execute. @@ -118,7 +119,7 @@ public static PathPermissions parseOctal(String octal) { /** * Converts a symbolic representation of the permissions into a {@code PathPermissions} object. - *

+ * * e.g. rwxr-x-wT * Each set of three characters correspondes to owner, owning group, and other respectively. 'r', 'w', and 'x' * respectively refer to read, write, and execute. A '-' indicates the permission is not given. The sticky bit, if @@ -232,7 +233,7 @@ public PathPermissions setOther(RolePermissions other) { } /** - * Returns whether the sticky bit has been set. The sticky bit may be set on directories, the files in that + * Returns whether or not the sticky bit has been set. The sticky bit may be set on directories, the files in that * directory may only be renamed or deleted by the file's owner, the directory's owner, or the root user. * * @return {@code true} if the sticky bit is set and {@code false} otherwise. @@ -254,7 +255,7 @@ public PathPermissions setStickyBit(boolean hasStickyBit) { } /** - * Returns whether there is more permissions information in the ACLs. The permissions string only returns + * Returns whether or not there is more permissions information in the ACLs. The permissions string only returns * information on the owner, owning group, and other, but the ACLs may contain more permissions for specific users * or groups. * diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathProperties.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathProperties.java index bbfe90b43c335..f488933e00713 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathProperties.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathProperties.java @@ -187,8 +187,6 @@ public PathProperties(final OffsetDateTime creationTime, final OffsetDateTime la } /** - * Gets the time when the path was created. - * * @return the time when the path was created */ public OffsetDateTime getCreationTime() { @@ -196,8 +194,6 @@ public OffsetDateTime getCreationTime() { } /** - * Gets the time when the path was last modified. - * * @return the time when the path was last modified */ public OffsetDateTime getLastModified() { @@ -205,8 +201,6 @@ public OffsetDateTime getLastModified() { } /** - * Gets the eTag of the path. - * * @return the eTag of the path */ public String getETag() { @@ -214,8 +208,6 @@ public String getETag() { } /** - * Gets the size of the path in bytes. - * * @return the size of the path in bytes */ public long getFileSize() { @@ -223,8 +215,6 @@ public long getFileSize() { } /** - * Gets the content type of the path. - * * @return the content type of the path */ public String getContentType() { @@ -232,8 +222,6 @@ public String getContentType() { } /** - * Gets the MD5 of the path's content. - * * @return the MD5 of the path's content */ public byte[] getContentMd5() { @@ -241,8 +229,6 @@ public byte[] getContentMd5() { } /** - * Gets the content encoding of the path. - * * @return the content encoding of the path */ public String getContentEncoding() { @@ -250,8 +236,6 @@ public String getContentEncoding() { } /** - * Gets the content disposition of the path. - * * @return the content disposition of the path */ public String getContentDisposition() { @@ -259,8 +243,6 @@ public String getContentDisposition() { } /** - * Gets the content language of the path. - * * @return the content language of the path */ public String getContentLanguage() { @@ -268,8 +250,6 @@ public String getContentLanguage() { } /** - * Gets the cache control of the path. - * * @return the cache control of the path */ public String getCacheControl() { @@ -277,8 +257,6 @@ public String getCacheControl() { } /** - * Gets the lease status of the path. - * * @return the lease status of the path */ public LeaseStatusType getLeaseStatus() { @@ -286,8 +264,6 @@ public LeaseStatusType getLeaseStatus() { } /** - * Gets the lease state of the path. - * * @return the lease state of the path */ public LeaseStateType getLeaseState() { @@ -295,8 +271,6 @@ public LeaseStateType getLeaseState() { } /** - * Gets the lease duration if the path is leased. - * * @return the lease duration if the path is leased */ public LeaseDurationType getLeaseDuration() { @@ -304,8 +278,6 @@ public LeaseDurationType getLeaseDuration() { } /** - * Gets the identifier of the last copy operation. - * * @return the identifier of the last copy operation. If this path hasn't been the target of a copy operation or has * been modified since this won't be set. */ @@ -314,8 +286,6 @@ public String getCopyId() { } /** - * Gets the status of the last copy operation. - * * @return the status of the last copy operation. If this path hasn't been the target of a copy operation or has * been modified since this won't be set. */ @@ -324,8 +294,6 @@ public CopyStatusType getCopyStatus() { } /** - * Gets the source path URL from the last copy operation. - * * @return the source path URL from the last copy operation. If this path hasn't been the target of a copy operation * or has been modified since this won't be set. */ @@ -334,8 +302,6 @@ public String getCopySource() { } /** - * Gets the number of bytes copied and total bytes in the source from the last copy operation. - * * @return the number of bytes copied and total bytes in the source from the last copy operation (bytes copied/total * bytes). If this path hasn't been the target of a copy operation or has been modified since this won't be set. */ @@ -344,8 +310,6 @@ public String getCopyProgress() { } /** - * Gets the completion time of the last copy operation. - * * @return the completion time of the last copy operation. If this path hasn't been the target of a copy operation * or has been modified since this won't be set. */ @@ -354,8 +318,6 @@ public OffsetDateTime getCopyCompletionTime() { } /** - * Gets the description of the last copy failure. - * * @return the description of the last copy failure, this is set when the {@link #getCopyStatus() getCopyStatus} is * {@link CopyStatusType#FAILED failed} or {@link CopyStatusType#ABORTED aborted}. If this path hasn't been the * target of a copy operation or has been modified since this won't be set. @@ -365,8 +327,6 @@ public String getCopyStatusDescription() { } /** - * Gets the status of the path being encrypted on the server. - * * @return the status of the path being encrypted on the server */ public Boolean isServerEncrypted() { @@ -374,8 +334,6 @@ public Boolean isServerEncrypted() { } /** - * Gets the status of the path being an incremental copy file. - * * @return the status of the path being an incremental copy file */ public Boolean isIncrementalCopy() { @@ -383,8 +341,6 @@ public Boolean isIncrementalCopy() { } /** - * Gets the tier of the path. - * * @return the tier of the path. */ public AccessTier getAccessTier() { @@ -392,8 +348,6 @@ public AccessTier getAccessTier() { } /** - * Gets the archive status of the path. - * * @return the archive status of the path. */ public ArchiveStatus getArchiveStatus() { @@ -401,8 +355,6 @@ public ArchiveStatus getArchiveStatus() { } /** - * Gets the SHA256 of the encryption key used to encrypt the path. - * * @return the key used to encrypt the path */ public String getEncryptionKeySha256() { @@ -410,8 +362,6 @@ public String getEncryptionKeySha256() { } /** - * Gets the time when the access tier for the path was last changed. - * * @return the time when the access tier for the path was last changed */ public OffsetDateTime getAccessTierChangeTime() { @@ -419,8 +369,6 @@ public OffsetDateTime getAccessTierChangeTime() { } /** - * Gets the metadata associated to this path. - * * @return the metadata associated to this path */ public Map getMetadata() { @@ -428,17 +376,13 @@ public Map getMetadata() { } /** - * Gets whether this path represents a directory. - * - * @return whether this path represents a directory + * @return whether or not this path represents a directory */ public Boolean isDirectory() { return isDirectory; } /** - * Gets the time when the path is going to expire. - * * @return the time when the path is going to expire. */ public OffsetDateTime getExpiresOn() { @@ -446,8 +390,6 @@ public OffsetDateTime getExpiresOn() { } /** - * Gets the path's encryption scope. - * * @return the path's encryption scope. */ public String getEncryptionScope() { @@ -455,8 +397,6 @@ public String getEncryptionScope() { } /** - * Gets the encryption context for this path. Only applicable for files. - * * @return the encryption context for this path. Only applicable for files. */ public String getEncryptionContext() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathRemoveAccessControlEntry.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathRemoveAccessControlEntry.java index 653054bc78508..128c00bcd4b34 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathRemoveAccessControlEntry.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PathRemoveAccessControlEntry.java @@ -105,7 +105,7 @@ public String toString() { /** * Parses the provided string into a {@code PathAccessControlEntry}. - *

+ * * Must be of the format "[scope:][type]:[id]". * * @param str The string representation of the ACL. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PublicAccessType.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PublicAccessType.java index f127be7d5c491..bbadf1f700ee3 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PublicAccessType.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/PublicAccessType.java @@ -21,15 +21,6 @@ public final class PublicAccessType extends ExpandableStringEnum values() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/RolePermissions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/RolePermissions.java index f7afe282ffa44..d8192dc886d2c 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/RolePermissions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/RolePermissions.java @@ -188,8 +188,6 @@ public int hashCode() { } /** - * Gets the read permission status. - * * @return the read permission status */ public boolean hasReadPermission() { @@ -197,8 +195,6 @@ public boolean hasReadPermission() { } /** - * Gets the write permission status. - * * @return the write permission status */ public boolean hasWritePermission() { @@ -206,8 +202,6 @@ public boolean hasWritePermission() { } /** - * Gets the execute permission status. - * * @return the execute permission status */ public boolean hasExecutePermission() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/UserDelegationKey.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/UserDelegationKey.java index 8d6eb10d89e1e..20a182b08e65d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/UserDelegationKey.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/UserDelegationKey.java @@ -46,13 +46,8 @@ public final class UserDelegationKey { private String value; /** - * Creates a new instance of {@link UserDelegationKey}. - */ - public UserDelegationKey() { - } - - /** - * Get the signedObjectId property: The Azure Active Directory object ID in GUID format. + * Get the signedObjectId property: The Azure Active Directory object ID in + * GUID format. * * @return the signedObjectId value. */ @@ -61,7 +56,8 @@ public String getSignedObjectId() { } /** - * Set the signedObjectId property: The Azure Active Directory object ID in GUID format. + * Set the signedObjectId property: The Azure Active Directory object ID in + * GUID format. * * @param signedObjectId the signedObjectId value to set. * @return the UserDelegationKey object itself. @@ -72,7 +68,8 @@ public UserDelegationKey setSignedObjectId(String signedObjectId) { } /** - * Get the signedTenantId property: The Azure Active Directory tenant ID in GUID format. + * Get the signedTenantId property: The Azure Active Directory tenant ID in + * GUID format. * * @return the signedTenantId value. */ @@ -81,7 +78,8 @@ public String getSignedTenantId() { } /** - * Set the signedTenantId property: The Azure Active Directory tenant ID in GUID format. + * Set the signedTenantId property: The Azure Active Directory tenant ID in + * GUID format. * * @param signedTenantId the signedTenantId value to set. * @return the UserDelegationKey object itself. @@ -132,7 +130,8 @@ public UserDelegationKey setSignedExpiry(OffsetDateTime signedExpiry) { } /** - * Get the signedService property: Abbreviation of the Azure Storage service that accepts the key. + * Get the signedService property: Abbreviation of the Azure Storage + * service that accepts the key. * * @return the signedService value. */ @@ -141,7 +140,8 @@ public String getSignedService() { } /** - * Set the signedService property: Abbreviation of the Azure Storage service that accepts the key. + * Set the signedService property: Abbreviation of the Azure Storage + * service that accepts the key. * * @param signedService the signedService value to set. * @return the UserDelegationKey object itself. @@ -152,7 +152,8 @@ public UserDelegationKey setSignedService(String signedService) { } /** - * Get the signedVersion property: The service version that created the key. + * Get the signedVersion property: The service version that created the + * key. * * @return the signedVersion value. */ @@ -161,7 +162,8 @@ public String getSignedVersion() { } /** - * Set the signedVersion property: The service version that created the key. + * Set the signedVersion property: The service version that created the + * key. * * @param signedVersion the signedVersion value to set. * @return the UserDelegationKey object itself. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileAppendOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileAppendOptions.java index ca3c4f5c04824..3db142885fa06 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileAppendOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileAppendOptions.java @@ -13,6 +13,7 @@ */ @Fluent public class DataLakeFileAppendOptions { + private String leaseId; private byte[] contentMd5; private Boolean flush; @@ -20,12 +21,6 @@ public class DataLakeFileAppendOptions { private Integer leaseDuration; private String proposedLeaseId; - /** - * Creates a new instance of {@link DataLakeFileAppendOptions}. - */ - public DataLakeFileAppendOptions() { - } - /** * Gets the lease ID to access the file. * @@ -128,8 +123,6 @@ public DataLakeFileAppendOptions setLeaseAction(LeaseAction leaseAction) { } /** - * Gets the lease duration in seconds. - * * @return the lease duration in seconds. */ public Integer getLeaseDuration() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileFlushOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileFlushOptions.java index 4b297f15a2f36..6e1c214363d6f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileFlushOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileFlushOptions.java @@ -16,6 +16,7 @@ */ @Fluent public class DataLakeFileFlushOptions { + private Boolean retainUncommittedData; private Boolean close; private PathHttpHeaders pathHttpHeaders; @@ -24,12 +25,6 @@ public class DataLakeFileFlushOptions { private Integer leaseDuration; private String proposedLeaseId; - /** - * Creates a new instance of {@link DataLakeFileFlushOptions}. - */ - public DataLakeFileFlushOptions() { - } - /** * If "true", uncommitted data is retained after the flush operation completes; otherwise, the uncommitted data is * deleted after the flush operation. The default is false. Data at offsets less than the specified position are @@ -166,8 +161,6 @@ public DataLakeFileFlushOptions setLeaseAction(LeaseAction leaseAction) { } /** - * Gets the lease duration in seconds. - * * @return the lease duration in seconds. */ public Integer getLeaseDuration() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileInputStreamOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileInputStreamOptions.java index 861a2af068de1..fa69204126809 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileInputStreamOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileInputStreamOptions.java @@ -13,6 +13,7 @@ */ @Fluent public final class DataLakeFileInputStreamOptions { + private FileRange range; private DataLakeRequestConditions requestConditions; private Integer blockSize; @@ -20,14 +21,6 @@ public final class DataLakeFileInputStreamOptions { private Boolean userPrincipalName; /** - * Creates a new instance of {@link DataLakeFileInputStreamOptions}. - */ - public DataLakeFileInputStreamOptions() { - } - - /** - * Gets the {@link FileRange}. - * * @return {@link FileRange} */ public FileRange getRange() { @@ -35,8 +28,6 @@ public FileRange getRange() { } /** - * Sets the {@link FileRange}. - * * @param range {@link FileRange} * @return The updated options. */ @@ -46,8 +37,6 @@ public DataLakeFileInputStreamOptions setRange(FileRange range) { } /** - * Gets the {@link DataLakeRequestConditions}. - * * @return {@link DataLakeRequestConditions} */ public DataLakeRequestConditions getRequestConditions() { @@ -55,8 +44,6 @@ public DataLakeRequestConditions getRequestConditions() { } /** - * Sets the {@link DataLakeRequestConditions}. - * * @param requestConditions {@link DataLakeRequestConditions} * @return The updated options. */ @@ -66,10 +53,6 @@ public DataLakeFileInputStreamOptions setRequestConditions(DataLakeRequestCondit } /** - * Gets the size of each data chunk returned from the service. If block size is large, input stream will make - * fewer network calls, but each individual call will send more data and will therefore take longer. - * The default value is 4 MB. - * * @return The size of each data chunk returned from the service. If block size is large, input stream will make * fewer network calls, but each individual call will send more data and will therefore take longer. * The default value is 4 MB. @@ -79,10 +62,6 @@ public Integer getBlockSize() { } /** - * Sets the size of each data chunk returned from the service. If block size is large, input stream will make - * fewer network calls, but each individual call will send more data and will therefore take longer. - * The default value is 4 MB. - * * @param blockSize The size of each data chunk returned from the service. If block size is large, input stream * will make fewer network calls, but each individual call will send more data and will therefore take longer. * The default value is 4 MB. @@ -94,8 +73,6 @@ public DataLakeFileInputStreamOptions setBlockSize(Integer blockSize) { } /** - * Gets the {@link ConsistentReadControl} Default is E-Tag. - * * @return {@link ConsistentReadControl} Default is E-Tag. */ public ConsistentReadControl getConsistentReadControl() { @@ -103,8 +80,6 @@ public ConsistentReadControl getConsistentReadControl() { } /** - * Sets the {@link ConsistentReadControl} Default is E-Tag. - * * @param consistentReadControl {@link ConsistentReadControl} Default is E-Tag. * @return The updated options. */ @@ -114,8 +89,6 @@ public DataLakeFileInputStreamOptions setConsistentReadControl(ConsistentReadCon } /** - * Gets the value for the x-ms-upn header. - * * @return The value for the x-ms-upn header. */ public Boolean isUserPrincipalName() { @@ -123,8 +96,6 @@ public Boolean isUserPrincipalName() { } /** - * Sets the value for the x-ms-upn header. - * * @param userPrincipalName The value for the x-ms-upn header. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileOutputStreamOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileOutputStreamOptions.java index 02c6381f02ae6..5f0cb8a8863c6 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileOutputStreamOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeFileOutputStreamOptions.java @@ -22,14 +22,6 @@ public class DataLakeFileOutputStreamOptions { private DataLakeRequestConditions requestConditions; /** - * Creates a new instance of {@link DataLakeFileOutputStreamOptions}. - */ - public DataLakeFileOutputStreamOptions() { - } - - /** - * Gets the {@link ParallelTransferOptions}. - * * @return {@link ParallelTransferOptions} */ public ParallelTransferOptions getParallelTransferOptions() { @@ -37,8 +29,6 @@ public ParallelTransferOptions getParallelTransferOptions() { } /** - * Sets the {@link ParallelTransferOptions}. - * * @param parallelTransferOptions {@link ParallelTransferOptions} * @return The updated options. */ @@ -48,8 +38,6 @@ public DataLakeFileOutputStreamOptions setParallelTransferOptions(ParallelTransf } /** - * Gets the {@link PathHttpHeaders}. - * * @return {@link PathHttpHeaders} */ public PathHttpHeaders getHeaders() { @@ -57,8 +45,6 @@ public PathHttpHeaders getHeaders() { } /** - * Sets the {@link PathHttpHeaders}. - * * @param headers {@link PathHttpHeaders} * @return The updated options. */ @@ -68,8 +54,6 @@ public DataLakeFileOutputStreamOptions setHeaders(PathHttpHeaders headers) { } /** - * Gets the metadata to associate with the file. - * * @return The metadata to associate with the file. */ public Map getMetadata() { @@ -77,8 +61,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the file. - * * @param metadata The metadata to associate with the file. * @return The updated options */ @@ -88,8 +70,6 @@ public DataLakeFileOutputStreamOptions setMetadata(Map metadata) } /** - * Gets the tags to associate with the file. - * * @return The tags to associate with the file. */ public Map getTags() { @@ -97,8 +77,6 @@ public Map getTags() { } /** - * Sets the tags to associate with the file. - * * @param tags The tags to associate with the file. * @return The updated options. */ @@ -108,8 +86,6 @@ public DataLakeFileOutputStreamOptions setTags(Map tags) { } /** - * Gets the {@link AccessTier}. - * * @return {@link AccessTier} */ public AccessTier getAccessTier() { @@ -117,8 +93,6 @@ public AccessTier getAccessTier() { } /** - * Sets the {@link AccessTier}. - * * @param tier {@link AccessTier} * @return The updated options. */ @@ -128,8 +102,6 @@ public DataLakeFileOutputStreamOptions setAccessTier(AccessTier tier) { } /** - * Gets the {@link DataLakeRequestConditions}. - * * @return {@link DataLakeRequestConditions} */ public DataLakeRequestConditions getRequestConditions() { @@ -137,8 +109,6 @@ public DataLakeRequestConditions getRequestConditions() { } /** - * Sets the {@link DataLakeRequestConditions}. - * * @param requestConditions {@link DataLakeRequestConditions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathCreateOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathCreateOptions.java index e9f41879ebc3b..229757e3e81da 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathCreateOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathCreateOptions.java @@ -16,6 +16,7 @@ */ @Fluent public class DataLakePathCreateOptions { + private String permissions; private String umask; private List accessControlEntryList; @@ -37,10 +38,6 @@ public DataLakePathCreateOptions() { } /** - * Gets the POSIX access permissions for the file owner, the file owning group, and others. Each class may be - * granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and - * 4-digit octal notation (e.g. 0766) are supported. - * * @return the permissions */ public String getPermissions() { @@ -61,11 +58,6 @@ public DataLakePathCreateOptions setPermissions(String permissions) { } /** - * Gets the umask restricts the permissions of the file or directory to be created. The resulting permission is - * given by p bitwise-and ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, - * then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The - * default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - * * @return the umask. */ public String getUmask() { @@ -73,11 +65,12 @@ public String getUmask() { } /** - * When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the - * permissions of the file or directory to be created. The resulting permission is given by p bitwise-and ^u, where - * p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is - * 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask - * must be specified in 4-digit octal notation (e.g. 0766). + * When creating a file or directory and the parent folder does not have a default ACL, + * the umask restricts the permissions of the file or directory to be created. The resulting + * permission is given by p bitwise-and ^u, where p is the permission and u is the umask. For example, + * if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is + * 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified + * in 4-digit octal notation (e.g. 0766). * * @param umask The umask. * @return the updated options. @@ -88,8 +81,6 @@ public DataLakePathCreateOptions setUmask(String umask) { } /** - * Gets the POSIX access control list for the file/directory. - * * @return the POSIX access control list for the file/directory. */ public List getAccessControlList() { @@ -108,8 +99,6 @@ public DataLakePathCreateOptions setAccessControlList(List getMetadata() { @@ -227,8 +210,6 @@ public DataLakePathCreateOptions setRequestConditions(DataLakeRequestConditions } /** - * Gets the source lease ID. - * * @return the source lease ID */ public String getSourceLeaseId() { @@ -246,8 +227,6 @@ public DataLakePathCreateOptions setSourceLeaseId(String leaseId) { } /** - * Gets the proposed lease ID. - * * @return the proposed lease ID. */ public String getProposedLeaseId() { @@ -267,8 +246,6 @@ public DataLakePathCreateOptions setProposedLeaseId(String leaseId) { } /** - * Gets the lease duration in seconds. - * * @return the lease duration in seconds. */ public Integer getLeaseDuration() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathDeleteOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathDeleteOptions.java index 788e242d6fd73..2825aafc5cff3 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathDeleteOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathDeleteOptions.java @@ -11,6 +11,7 @@ */ @Fluent public class DataLakePathDeleteOptions { + private boolean isRecursive; private DataLakeRequestConditions requestConditions; @@ -21,8 +22,6 @@ public DataLakePathDeleteOptions() { } /** - * Gets whether everything under the resource should be deleted recursively. - * * @return whether everything under the resource should be deleted recursively */ public boolean getIsRecursive() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathScheduleDeletionOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathScheduleDeletionOptions.java index 0feb5e5293d34..617cd092291d2 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathScheduleDeletionOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakePathScheduleDeletionOptions.java @@ -14,6 +14,7 @@ */ @Fluent public class DataLakePathScheduleDeletionOptions { + private final OffsetDateTime expiresOn; private final Duration timeToExpire; @@ -39,8 +40,6 @@ public DataLakePathScheduleDeletionOptions(Duration timeToExpire) { } /** - * Gets the expiry date. - * * @return the expiry date. */ public OffsetDateTime getExpiresOn() { @@ -48,8 +47,6 @@ public OffsetDateTime getExpiresOn() { } /** - * Gets the time to expire. - * * @return the time to expire. */ public Duration getTimeToExpire() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileParallelUploadOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileParallelUploadOptions.java index ca25c5dbf58a5..8d391cc61c7ee 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileParallelUploadOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileParallelUploadOptions.java @@ -38,7 +38,6 @@ public class FileParallelUploadOptions { * @param dataFlux The data to write to the file. Unlike other upload methods, this method does not require that * the {@code Flux} be replayable. In other words, it does not have to support multiple subscribers and is not * expected to produce the same values across subscriptions. - * @throws NullPointerException If {@code dataFlux} is null. */ public FileParallelUploadOptions(Flux dataFlux) { StorageImplUtils.assertNotNull("dataFlux", dataFlux); @@ -52,7 +51,6 @@ public FileParallelUploadOptions(Flux dataFlux) { * Constructs a new {@code FileParallelUploadOptions}. * * @param data The {@link BinaryData} to write to the file. - * @throws NullPointerException If {@code data} is null. */ public FileParallelUploadOptions(BinaryData data) { StorageImplUtils.assertNotNull("data must not be null", data); @@ -64,7 +62,7 @@ public FileParallelUploadOptions(BinaryData data) { /** * Constructs a new {@code FileParallelUploadOptions}. - *

+ * * Use {@link #FileParallelUploadOptions(InputStream)} instead to supply an InputStream without knowing the exact * length beforehand. * @@ -73,8 +71,6 @@ public FileParallelUploadOptions(BinaryData data) { * mark support. * @param length The exact length of the data. It is important that this value match precisely the length of the * data provided in the {@link InputStream}. - * @throws NullPointerException If {@code dataStream} is null. - * @throws IllegalArgumentException If {@code length} is less than 0 or greater than {@link Long#MAX_VALUE}. * @deprecated length is no longer necessary; use {@link #FileParallelUploadOptions(InputStream)} instead. */ @Deprecated @@ -88,7 +84,6 @@ public FileParallelUploadOptions(InputStream dataStream, long length) { * @param dataStream The data to write to the blob. The data must be markable. This is in order to support retries. * If the data is not markable, consider wrapping your data source in a {@link java.io.BufferedInputStream} to add * mark support. - * @throws NullPointerException If {@code dataStream} is null. */ public FileParallelUploadOptions(InputStream dataStream) { this(dataStream, null); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileQueryOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileQueryOptions.java index 3eb9a36c50f5c..9f4f3cdc6e61f 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileQueryOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileQueryOptions.java @@ -18,6 +18,7 @@ */ @Fluent public class FileQueryOptions { + private final String expression; private final OutputStream outputStream; private FileQuerySerialization inputSerialization; @@ -29,7 +30,6 @@ public class FileQueryOptions { /** * Constructs a {@link FileQueryOptions}. * @param expression The query expression. - * @throws NullPointerException If {@code expression} is null. */ public FileQueryOptions(String expression) { StorageImplUtils.assertNotNull("expression", expression); @@ -41,7 +41,6 @@ public FileQueryOptions(String expression) { * Constructs a {@link FileQueryOptions}. * @param expression The query expression. * @param outputStream Gets the OutputStream where the downloaded data will be written. - * @throws NullPointerException If {@code expression} or {@code outputStream} is null. */ public FileQueryOptions(String expression, OutputStream outputStream) { StorageImplUtils.assertNotNull("expression", expression); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileScheduleDeletionOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileScheduleDeletionOptions.java index 8c272d58d048d..e1b1078414b3d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileScheduleDeletionOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileScheduleDeletionOptions.java @@ -33,7 +33,6 @@ public FileScheduleDeletionOptions() { * @param timeToExpire Duration before file will be deleted. * @param expiryRelativeTo Specifies if TimeToExpire should be * set relative to the file's creation time, or the current time. - * @throws NullPointerException If {@code timeToExpire} or {@code expiryRelativeTo} is null. */ public FileScheduleDeletionOptions(Duration timeToExpire, FileExpirationOffset expiryRelativeTo) { StorageImplUtils.assertNotNull("timeToExpire", timeToExpire); @@ -46,7 +45,6 @@ public FileScheduleDeletionOptions(Duration timeToExpire, FileExpirationOffset e /** * Sets the {@link OffsetDateTime} when the file will be deleted. * @param expiresOn The {@link OffsetDateTime} when the file will be deleted. - * @throws NullPointerException If {@code expiresOn} is null. */ public FileScheduleDeletionOptions(OffsetDateTime expiresOn) { StorageImplUtils.assertNotNull("expiresOn", expiresOn); @@ -56,8 +54,6 @@ public FileScheduleDeletionOptions(OffsetDateTime expiresOn) { } /** - * Gets the duration before the file will be deleted. - * * @return Duration before file should be deleted. */ public Duration getTimeToExpire() { @@ -65,18 +61,16 @@ public Duration getTimeToExpire() { } /** - * Gets the offset to set the expiry time relative to. - * - * @return if {@link #getTimeToExpire()} should be set relative to the file's creation time, or the current time. + * @return if {@link #getTimeToExpire()} should be + * set relative to the file's creation time, or the current time. */ public FileExpirationOffset getExpiryRelativeTo() { return expiryRelativeTo; } /** - * Gets the {@link OffsetDateTime} to set for when the file will be deleted. - * - * @return The {@link OffsetDateTime} to set for when the file will be deleted. + * @return The {@link OffsetDateTime} to set for when + * the file will be deleted. */ public OffsetDateTime getExpiresOn() { return expiresOn; diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemEncryptionScopeOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemEncryptionScopeOptions.java index dfba5e7d55dce..bd683b0e9a1a5 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemEncryptionScopeOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemEncryptionScopeOptions.java @@ -14,6 +14,7 @@ * Encryption scope options to be used when creating a file system. */ public final class FileSystemEncryptionScopeOptions implements JsonSerializable { + /* * Optional. Version 2021-06-08 and later. Specifies the default * encryption scope to set on the container and use for all future writes. @@ -27,12 +28,6 @@ public final class FileSystemEncryptionScopeOptions implements JsonSerializable< */ private Boolean encryptionScopeOverridePrevented; - /** - * Creates a new instance of {@link FileSystemEncryptionScopeOptions}. - */ - public FileSystemEncryptionScopeOptions() { - } - /** * Get the defaultEncryptionScope property: Optional. Version 2021-06-08 and later. Specifies the default encryption * scope to set on the file system and use for all future writes. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemRenameOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemRenameOptions.java index 8f7d0dbda208b..c9fbf98af3d23 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemRenameOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemRenameOptions.java @@ -13,6 +13,7 @@ */ @Fluent class FileSystemRenameOptions { + private final String destinationFileSystemName; private DataLakeRequestConditions requestConditions; diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemUndeleteOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemUndeleteOptions.java index 5f55103038530..251eaa8e0f7f6 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemUndeleteOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/FileSystemUndeleteOptions.java @@ -20,7 +20,6 @@ public final class FileSystemUndeleteOptions { * * @param deletedFileSystemName The name of the previously deleted file system. * @param deletedFileSystemVersion The version of the previously deleted file system. - * @throws NullPointerException If {@code deletedFileSystemName} or {@code deletedFileSystemVersion} is null. */ public FileSystemUndeleteOptions(String deletedFileSystemName, String deletedFileSystemVersion) { StorageImplUtils.assertNotNull("deletedFileSystemName", deletedFileSystemName); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathGetPropertiesOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathGetPropertiesOptions.java index f1bb3f147afb7..ad253933faf96 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathGetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathGetPropertiesOptions.java @@ -14,14 +14,6 @@ public class PathGetPropertiesOptions { private Boolean userPrincipalName; /** - * Creates a new instance of {@link PathGetPropertiesOptions}. - */ - public PathGetPropertiesOptions() { - } - - /** - * Gets the {@link DataLakeRequestConditions}. - * * @return {@link DataLakeRequestConditions} */ public DataLakeRequestConditions getRequestConditions() { @@ -29,8 +21,6 @@ public DataLakeRequestConditions getRequestConditions() { } /** - * Sets the {@link DataLakeRequestConditions}. - * * @param requestConditions {@link DataLakeRequestConditions} * @return The updated options. */ @@ -40,8 +30,6 @@ public PathGetPropertiesOptions setRequestConditions(DataLakeRequestConditions r } /** - * Gets the value for the x-ms-upn header. - * * @return The value for the x-ms-upn header. */ public Boolean isUserPrincipalName() { @@ -49,8 +37,6 @@ public Boolean isUserPrincipalName() { } /** - * Sets the value for the x-ms-upn header. - * * @param userPrincipalName The value for the x-ms-upn header. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathRemoveAccessControlRecursiveOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathRemoveAccessControlRecursiveOptions.java index e3b441a1ee813..194716212c5a3 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathRemoveAccessControlRecursiveOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathRemoveAccessControlRecursiveOptions.java @@ -25,7 +25,6 @@ public class PathRemoveAccessControlRecursiveOptions { /** * Constructs a new options object. * @param accessControlList The POSIX access control list for the file or directory. - * @throws NullPointerException If {@code accessControlList} is null. */ public PathRemoveAccessControlRecursiveOptions(List accessControlList) { StorageImplUtils.assertNotNull("accessControllList", accessControlList); @@ -72,7 +71,7 @@ public PathRemoveAccessControlRecursiveOptions setBatchSize(Integer batchSize) { *

* If maximum is reached before all subpaths are processed then continuation token can be used to resume operation. * Empty value indicates that maximum number of batches in unbound and operation continues till end. Operation may - * also halt if an error is hit and {@code continueOnFailure} is false. + * * also halt if an error is hit and {@code continueOnFailure} is false. * * @return The maximum number of batches. */ @@ -85,7 +84,7 @@ public Integer getMaxBatches() { *

* If maximum is reached before all subpaths are processed then continuation token can be used to resume operation. * Empty value indicates that maximum number of batches in unbound and operation continues till end. Operation may - * also halt if an error is hit and {@code continueOnFailure} is false. + * * also halt if an error is hit and {@code continueOnFailure} is false. * * @param maxBatches The maximum number of batches. * @return The updated object. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathSetAccessControlRecursiveOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathSetAccessControlRecursiveOptions.java index 28a56c4c12993..7ed3f57cf2d99 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathSetAccessControlRecursiveOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathSetAccessControlRecursiveOptions.java @@ -25,7 +25,6 @@ public class PathSetAccessControlRecursiveOptions { /** * Constructs a new options object. * @param accessControlList The POSIX access control list for the file or directory. - * @throws NullPointerException If {@code accessControlList} is null. */ public PathSetAccessControlRecursiveOptions(List accessControlList) { StorageImplUtils.assertNotNull("accessControllList", accessControlList); @@ -72,7 +71,7 @@ public PathSetAccessControlRecursiveOptions setBatchSize(Integer batchSize) { *

* If maximum is reached before all subpaths are processed then continuation token can be used to resume operation. * Empty value indicates that maximum number of batches in unbound and operation continues till end. Operation may - * also halt if an error is hit and {@code continueOnFailure} is false. + * * also halt if an error is hit and {@code continueOnFailure} is false. * * @return The maximum number of batches. */ @@ -85,7 +84,7 @@ public Integer getMaxBatches() { *

* If maximum is reached before all subpaths are processed then continuation token can be used to resume operation. * Empty value indicates that maximum number of batches in unbound and operation continues till end. Operation may - * also halt if an error is hit and {@code continueOnFailure} is false. + * * also halt if an error is hit and {@code continueOnFailure} is false. * * @param maxBatches The maximum number of batches. * @return The updated object. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathUpdateAccessControlRecursiveOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathUpdateAccessControlRecursiveOptions.java index 6cd538518092f..0495f62fcbc9b 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathUpdateAccessControlRecursiveOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/PathUpdateAccessControlRecursiveOptions.java @@ -25,7 +25,6 @@ public class PathUpdateAccessControlRecursiveOptions { /** * Constructs a new options object. * @param accessControlList The POSIX access control list for the file or directory. - * @throws NullPointerException If {@code accessControlList} is null. */ public PathUpdateAccessControlRecursiveOptions(List accessControlList) { StorageImplUtils.assertNotNull("accessControllList", accessControlList); @@ -85,7 +84,7 @@ public Integer getMaxBatches() { *

* If maximum is reached before all subpaths are processed then continuation token can be used to resume operation. * Empty value indicates that maximum number of batches in unbound and operation continues till end. Operation may - * also halt if an error is hit and {@code continueOnFailure} is false. + * * also halt if an error is hit and {@code continueOnFailure} is false. * * @param maxBatches The maximum number of batches. * @return The updated object. diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java index 28006b6466c1e..648be9f88748a 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java @@ -31,7 +31,6 @@ public class ReadToFileOptions { * Constructs a {@link ReadToFileOptions}. * * @param filePath Path of the file to download to. - * @throws NullPointerException If {@code filePath} is null. */ public ReadToFileOptions(String filePath) { StorageImplUtils.assertNotNull("filePath", filePath); @@ -39,17 +38,13 @@ public ReadToFileOptions(String filePath) { } /** - * Gets the path of the file to download to. - * - * @return The path where the downloaded data will be written. + * @return A {@link String} representing the filePath where the downloaded data will be written. */ public String getFilePath() { return filePath; } /** - * Gets the {@link FileRange}. - * * @return {@link FileRange} */ public FileRange getRange() { @@ -57,8 +52,6 @@ public FileRange getRange() { } /** - * Sets the {@link FileRange}. - * * @param range {@link FileRange} * @return The updated options. */ @@ -68,20 +61,14 @@ public ReadToFileOptions setRange(FileRange range) { } /** - * Gets the {@link ParallelTransferOptions} to use to download to file. Number of parallel transfers parameter is - * ignored. - * - * @return {@link ParallelTransferOptions} to use to download to file. Number of parallel transfers parameter is - * ignored. + * @return {@link ParallelTransferOptions} to use to download to file. Number of parallel + * transfers parameter is ignored. */ public ParallelTransferOptions getParallelTransferOptions() { return parallelTransferOptions; } /** - * Sets the {@link ParallelTransferOptions} to use to download to file. Number of parallel transfers parameter is - * ignored. - * * @param parallelTransferOptions {@link ParallelTransferOptions} to use to download to file. Number of parallel * transfers parameter is ignored. * @return The updated options. @@ -92,8 +79,6 @@ public ReadToFileOptions setParallelTransferOptions(ParallelTransferOptions para } /** - * Gets the {@link DownloadRetryOptions}. - * * @return {@link DownloadRetryOptions} */ public DownloadRetryOptions getDownloadRetryOptions() { @@ -101,8 +86,6 @@ public DownloadRetryOptions getDownloadRetryOptions() { } /** - * Sets the {@link DownloadRetryOptions}. - * * @param downloadRetryOptions {@link DownloadRetryOptions} * @return The updated options. */ @@ -112,8 +95,6 @@ public ReadToFileOptions setDownloadRetryOptions(DownloadRetryOptions downloadRe } /** - * Gets the {@link DataLakeRequestConditions}. - * * @return requestConditions {@link DataLakeRequestConditions} */ public DataLakeRequestConditions getDataLakeRequestConditions() { @@ -121,8 +102,6 @@ public DataLakeRequestConditions getDataLakeRequestConditions() { } /** - * Sets the {@link DataLakeRequestConditions}. - * * @param dataLakeRequestConditions {@link DataLakeRequestConditions} * @return The updated options. * @throws UncheckedIOException If an I/O error occurs. @@ -133,8 +112,6 @@ public ReadToFileOptions setDataLakeRequestConditions(DataLakeRequestConditions } /** - * Gets whether the contentMD5 for the specified file range should be returned. - * * @return Whether the contentMD5 for the specified file range should be returned. */ public Boolean isRangeGetContentMd5() { @@ -142,8 +119,6 @@ public Boolean isRangeGetContentMd5() { } /** - * Sets whether the contentMD5 for the specified file range should be returned. - * * @param rangeGetContentMd5 Whether the contentMD5 for the specified file range should be returned. * @return The updated options. */ @@ -153,8 +128,6 @@ public ReadToFileOptions setRangeGetContentMd5(Boolean rangeGetContentMd5) { } /** - * Gets the {@link OpenOption OpenOptions} to use to configure how to open or create the file. - * * @return {@link OpenOption OpenOptions} to use to configure how to open or create the file. */ public Set getOpenOptions() { @@ -162,8 +135,6 @@ public Set getOpenOptions() { } /** - * Sets the {@link OpenOption OpenOptions} to use to configure how to open or create the file. - * * @param openOptions {@link OpenOption OpenOptions} to use to configure how to open or create the file. * @return The updated options. */ @@ -173,8 +144,6 @@ public ReadToFileOptions setOpenOptions(Set openOptions) { } /** - * Gets the value for the x-ms-upn header. - * * @return The value for the x-ms-upn header. */ public Boolean isUserPrincipalName() { @@ -182,8 +151,6 @@ public Boolean isUserPrincipalName() { } /** - * Sets the value for the x-ms-upn header. - * * @param userPrincipalName The value for the x-ms-upn header. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/DataLakeServiceSasSignatureValues.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/DataLakeServiceSasSignatureValues.java index 5177240086e52..bee1c2b9c62b2 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/DataLakeServiceSasSignatureValues.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/DataLakeServiceSasSignatureValues.java @@ -26,23 +26,38 @@ * User Delegation SAS */ public final class DataLakeServiceSasSignatureValues { + private static final String VERSION = Configuration.getGlobalConfiguration() .get(Constants.PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, DataLakeServiceVersion.getLatest().getVersion()); private SasProtocol protocol; + private OffsetDateTime startTime; + private OffsetDateTime expiryTime; + private String permissions; + private SasIpRange sasIpRange; + private String identifier; + private String cacheControl; + private String contentDisposition; + private String contentEncoding; + private String contentLanguage; + private String contentType; + private String preauthorizedAgentObjectId; /* saoid */ + private String agentObjectId; /* suoid */ + private String correlationId; + private String encryptionScope; /** @@ -83,9 +98,6 @@ public DataLakeServiceSasSignatureValues(String identifier) { } /** - * Gets the version of the service this SAS will target. If not specified, it will default to the version targeted - * by the library. - * * @return the version of the service this SAS will target. If not specified, it will default to the version * targeted by the library. */ @@ -109,8 +121,6 @@ public DataLakeServiceSasSignatureValues setVersion(String version) { } /** - * Gets the {@link SasProtocol} which determines the protocols allowed by the SAS. - * * @return the {@link SasProtocol} which determines the protocols allowed by the SAS. */ public SasProtocol getProtocol() { @@ -129,8 +139,6 @@ public DataLakeServiceSasSignatureValues setProtocol(SasProtocol protocol) { } /** - * Gets when the SAS will take effect. - * * @return when the SAS will take effect. */ public OffsetDateTime getStartTime() { @@ -149,8 +157,6 @@ public DataLakeServiceSasSignatureValues setStartTime(OffsetDateTime startTime) } /** - * Gets the time after which the SAS will no longer work. - * * @return the time after which the SAS will no longer work. */ public OffsetDateTime getExpiryTime() { @@ -169,9 +175,6 @@ public DataLakeServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime } /** - * Gets the permissions string allowed by the SAS. Please refer to either {@link FileSystemSasPermission} or - * {@link PathSasPermission} depending on the resource being accessed for help determining the permissions allowed. - * * @return the permissions string allowed by the SAS. Please refer to either {@link FileSystemSasPermission} or * {@link PathSasPermission} depending on the resource being accessed for help determining the permissions allowed. */ @@ -206,8 +209,6 @@ public DataLakeServiceSasSignatureValues setPermissions(FileSystemSasPermission } /** - * Gets the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. - * * @return the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. */ public SasIpRange getSasIpRange() { @@ -227,10 +228,6 @@ public DataLakeServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange) { } /** - * Gets the name of the access policy on the file system this SAS references if any. Please see - * here - * for more information. - * * @return the name of the access policy on the file system this SAS references if any. Please see * here * for more information. @@ -253,8 +250,6 @@ public DataLakeServiceSasSignatureValues setIdentifier(String identifier) { } /** - * Gets the cache-control header for the SAS. - * * @return the cache-control header for the SAS. */ public String getCacheControl() { @@ -273,8 +268,6 @@ public DataLakeServiceSasSignatureValues setCacheControl(String cacheControl) { } /** - * Gets the content-disposition header for the SAS. - * * @return the content-disposition header for the SAS. */ public String getContentDisposition() { @@ -293,8 +286,6 @@ public DataLakeServiceSasSignatureValues setContentDisposition(String contentDis } /** - * Gets the content-encoding header for the SAS. - * * @return the content-encoding header for the SAS. */ public String getContentEncoding() { @@ -313,8 +304,6 @@ public DataLakeServiceSasSignatureValues setContentEncoding(String contentEncodi } /** - * Gets the content-language header for the SAS. - * * @return the content-language header for the SAS. */ public String getContentLanguage() { @@ -333,8 +322,6 @@ public DataLakeServiceSasSignatureValues setContentLanguage(String contentLangua } /** - * Gets the content-type header for the SAS. - * * @return the content-type header for the SAS. */ public String getContentType() { @@ -353,9 +340,6 @@ public DataLakeServiceSasSignatureValues setContentType(String contentType) { } /** - * Gets the AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the - * action granted by the SAS token. - * * @return The AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform * the action granted by the SAS token. The service will validate the SAS token and ensure that the owner of the * user delegation key has the required permissions before granting access but no additional permission check for @@ -381,9 +365,6 @@ public DataLakeServiceSasSignatureValues setPreauthorizedAgentObjectId(String pr } /** - * Gets the AAD object ID of a user assumed to be unauthorized by the owner of the user delegation key to perform - * the action granted by the SAS token. - * * @return The AAD object ID of a user assumed to be unauthorized by the owner of the user delegation key to * perform the action granted by the SAS token. The service will validate the SAS token and ensure that the owner * of the user delegation key has the required permissions before granting access and the service will perform an @@ -409,8 +390,6 @@ public DataLakeServiceSasSignatureValues setAgentObjectId(String agentObjectId) } /** - * Gets the correlation id value for the SAS. - * * @return the correlation id value for the SAS. */ public String getCorrelationId() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/FileSystemSasPermission.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/FileSystemSasPermission.java index b6e53bfeed4ed..8c99fd2b719f8 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/FileSystemSasPermission.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/FileSystemSasPermission.java @@ -15,14 +15,23 @@ */ public final class FileSystemSasPermission { private boolean readPermission; + private boolean addPermission; + private boolean createPermission; + private boolean writePermission; + private boolean deletePermission; + private boolean listPermission; + private boolean movePermission; + private boolean executePermission; + private boolean manageOwnershipPermission; + private boolean manageAccessControlPermission; /** @@ -95,8 +104,6 @@ public static FileSystemSasPermission parse(String permissionString) { } /** - * Gets the read permission status. - * * @return the read permission status */ public boolean hasReadPermission() { @@ -115,8 +122,6 @@ public FileSystemSasPermission setReadPermission(boolean hasReadPermission) { } /** - * Gets the add permission status. - * * @return the add permission status */ public boolean hasAddPermission() { @@ -135,8 +140,6 @@ public FileSystemSasPermission setAddPermission(boolean hasAddPermission) { } /** - * Gets the create permission status. - * * @return the create permission status */ public boolean hasCreatePermission() { @@ -155,8 +158,6 @@ public FileSystemSasPermission setCreatePermission(boolean hasCreatePermission) } /** - * Gets the write permission status. - * * @return the write permission status */ public boolean hasWritePermission() { @@ -175,8 +176,6 @@ public FileSystemSasPermission setWritePermission(boolean hasWritePermission) { } /** - * Gets the delete permission status. - * * @return the delete permission status */ public boolean hasDeletePermission() { @@ -195,8 +194,6 @@ public FileSystemSasPermission setDeletePermission(boolean hasDeletePermission) } /** - * Gets the list permission status. - * * @return the list permission status */ public boolean hasListPermission() { @@ -215,8 +212,6 @@ public FileSystemSasPermission setListPermission(boolean hasListPermission) { } /** - * Gets the move permission status. - * * @return the move permission status. */ public boolean hasMovePermission() { @@ -235,8 +230,6 @@ public FileSystemSasPermission setMovePermission(boolean hasMovePermission) { } /** - * Gets the execute permission status. - * * @return the execute permission status. */ public boolean hasExecutePermission() { @@ -255,8 +248,6 @@ public FileSystemSasPermission setExecutePermission(boolean hasExecutePermission } /** - * Gets the manage ownership permission status. - * * @return the manage ownership permission status. */ public boolean hasManageOwnershipPermission() { @@ -275,8 +266,6 @@ public FileSystemSasPermission setManageOwnershipPermission(boolean hasManageOwn } /** - * Gets the manage access control permission status. - * * @return the manage access control permission status. */ public boolean hasManageAccessControlPermission() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/PathSasPermission.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/PathSasPermission.java index 8f1d1a3664608..db30565378154 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/PathSasPermission.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/PathSasPermission.java @@ -14,15 +14,25 @@ * this class guarantees correctness. */ public final class PathSasPermission { + private boolean readPermission; + private boolean addPermission; + private boolean createPermission; + private boolean writePermission; + private boolean deletePermission; + private boolean listPermission; + private boolean movePermission; + private boolean executePermission; + private boolean manageOwnershipPermission; + private boolean manageAccessControlPermission; /** @@ -95,8 +105,6 @@ public static PathSasPermission parse(String permissionString) { } /** - * Gets the read permission status. - * * @return the read permission status. */ public boolean hasReadPermission() { @@ -115,8 +123,6 @@ public PathSasPermission setReadPermission(boolean hasReadPermission) { } /** - * Gets the add permission status. - * * @return the add permission status. */ public boolean hasAddPermission() { @@ -135,8 +141,6 @@ public PathSasPermission setAddPermission(boolean hasAddPermission) { } /** - * Gets the create permission status. - * * @return the create permission status. */ public boolean hasCreatePermission() { @@ -155,8 +159,6 @@ public PathSasPermission setCreatePermission(boolean hasCreatePermission) { } /** - * Gets the write permission status. - * * @return the write permission status. */ public boolean hasWritePermission() { @@ -175,8 +177,6 @@ public PathSasPermission setWritePermission(boolean hasWritePermission) { } /** - * Gets the delete permission status. - * * @return the delete permission status. */ public boolean hasDeletePermission() { @@ -195,8 +195,6 @@ public PathSasPermission setDeletePermission(boolean hasDeletePermission) { } /** - * Gets the list permission status. - * * @return the list permission status. */ public boolean hasListPermission() { @@ -215,8 +213,6 @@ public PathSasPermission setListPermission(boolean hasListPermission) { } /** - * Gets the move permission status. - * * @return the move permission status. */ public boolean hasMovePermission() { @@ -235,8 +231,6 @@ public PathSasPermission setMovePermission(boolean hasMovePermission) { } /** - * Gets the execute permission status. - * * @return the execute permission status. */ public boolean hasExecutePermission() { @@ -255,8 +249,6 @@ public PathSasPermission setExecutePermission(boolean hasExecutePermission) { } /** - * Gets the manage ownership permission status. - * * @return the manage ownership permission status. */ public boolean hasManageOwnershipPermission() { @@ -275,8 +267,6 @@ public PathSasPermission setManageOwnershipPermission(boolean hasManageOwnership } /** - * Gets the manage access control permission status. - * * @return the manage access control permission status. */ public boolean hasManageAccessControlPermission() { diff --git a/sdk/storage/azure-storage-file-datalake/swagger/README.md b/sdk/storage/azure-storage-file-datalake/swagger/README.md index 8fab00739a0f9..074d40b9459ab 100644 --- a/sdk/storage/azure-storage-file-datalake/swagger/README.md +++ b/sdk/storage/azure-storage-file-datalake/swagger/README.md @@ -15,22 +15,28 @@ autorest ### Code generation settings ``` yaml -use: '@autorest/java@4.1.42' +use: '@autorest/java@4.1.39' input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/688a906172823628e75b19ea8964d998cb7560fd/specification/storage/data-plane/Azure.Storage.Files.DataLake/preview/2023-05-03/DataLakeStorage.json java: true output-folder: ../ namespace: com.azure.storage.file.datalake generate-client-as-impl: true +generate-client-interfaces: false +service-interface-as-public: true license-header: MICROSOFT_MIT_SMALL enable-sync-stack: true +context-client-method-parameter: true optional-constant-as-enum: true default-http-exception-type: com.azure.storage.file.datalake.implementation.models.DataLakeStorageExceptionInternal models-subpackage: implementation.models custom-types: FileSystemInfo,FileSystemItem,FileSystemProperties,PathInfo,PathItem,PathProperties,ListFileSystemsOptions,PathHttpHeaders,EncryptionAlgorithmType,LeaseAction custom-types-subpackage: models customization-class: src/main/java/DataLakeStorageCustomization.java +generic-response-type: true use-input-stream-for-binary: true +no-custom-headers: true disable-client-builder: true +stream-style-serialization: true ``` ### Make the body of append octet-stream /{filesystem}/{path}?action=append diff --git a/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java b/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java index 1eec836eec9cc..9318f528c2abd 100644 --- a/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java +++ b/sdk/storage/azure-storage-file-datalake/swagger/src/main/java/DataLakeStorageCustomization.java @@ -31,6 +31,61 @@ public class DataLakeStorageCustomization extends Customization { public void customize(LibraryCustomization customization, Logger logger) { PackageCustomization models = customization.getPackage("com.azure.storage.file.datalake.implementation.models"); + //customizing BlobHierarchyListSegment + ClassCustomization blobHierarchy = models.getClass("BlobHierarchyListSegment"); + blobHierarchy.customizeAst(ast -> { + ClassOrInterfaceDeclaration clazz = ast.getClassByName(blobHierarchy.getClassName()).get(); + + replaceMethodToXml(clazz, + "{\n" + + "rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Blobs\" : rootElementName;\n" + + " xmlWriter.writeStartElement(rootElementName);\n" + + " if (this.blobPrefixes != null) {\n" + + " for (BlobPrefix element : this.blobPrefixes) {\n" + + " xmlWriter.writeXml(element, \"BlobPrefix\");\n" + + " }\n" + + " }\n" + + " if (this.blobItems != null) {\n" + + " for (BlobItemInternal element : this.blobItems) {\n" + + " xmlWriter.writeXml(element, \"Blob\");\n" + + " }\n" + + " }\n" + + " return xmlWriter.writeEndElement();\n" + + "}" + ); + + replaceMethodFromXml(clazz, + "{\n" + + "String finalRootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Blobs\" : rootElementName;\n" + + " return xmlReader.readObject(finalRootElementName, reader -> {\n" + + " BlobHierarchyListSegment deserializedBlobHierarchyListSegment = new BlobHierarchyListSegment();\n" + + " while (reader.nextElement() != XmlToken.END_ELEMENT) {\n" + + " QName elementName = reader.getElementName();\n" + + "\n" + + " if (\"BlobPrefix\".equals(elementName.getLocalPart())) {\n" + + " if (deserializedBlobHierarchyListSegment.blobPrefixes == null) {\n" + + " deserializedBlobHierarchyListSegment.blobPrefixes = new ArrayList<>();\n" + + " }\n" + + " deserializedBlobHierarchyListSegment.blobPrefixes\n" + + " .add(BlobPrefix.fromXml(reader, \"BlobPrefix\"));\n" + + " } else if (\"Blob\".equals(elementName.getLocalPart())) {\n" + + " if (deserializedBlobHierarchyListSegment.blobItems == null) {\n" + + " deserializedBlobHierarchyListSegment.blobItems = new ArrayList<>();\n" + + " }\n" + + " deserializedBlobHierarchyListSegment.blobItems\n" + + " .add(BlobItemInternal.fromXml(reader, \"Blob\"));\n" + + " } else {\n" + + " reader.skipElement();\n" + + " }\n" + + " }\n" + + "\n" + + " return deserializedBlobHierarchyListSegment;\n" + + " });\n" + + "}" + + ); + }); + //customizing Path ClassCustomization path = models.getClass("Path"); path.customizeAst(ast -> { diff --git a/sdk/storage/azure-storage-file-share-stress/pom.xml b/sdk/storage/azure-storage-file-share-stress/pom.xml index a0fca7e750cc2..1668f38b439be 100644 --- a/sdk/storage/azure-storage-file-share-stress/pom.xml +++ b/sdk/storage/azure-storage-file-share-stress/pom.xml @@ -40,7 +40,7 @@ com.azure azure-storage-file-share - 12.26.0-beta.1 + 12.25.2 com.azure diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index 5bfb166a9b9e4..822e956797cd2 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -1,21 +1,22 @@ # Release History -## 12.26.0-beta.1 (Unreleased) +## 12.25.2 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-storage-common` from `12.28.0` to version `12.28.1`. +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. -### Other Changes ## 12.25.1 (2024-12-04) ### Bugs Fixed - `ShareFileClient.downloadToFile()` now retries for a maximum of 5 times when the download fails due to a network error. - Previously, the maximum number of retries was unintentionally higher (maximum of 15), which could lead to writing in - incorrect positions in the file when retried more than 5 times. +Previously, the maximum number of retries was unintentionally higher (maximum of 15), which could lead to writing in +incorrect positions in the file when retried more than 5 times. ## 12.25.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-file-share/README.md b/sdk/storage/azure-storage-file-share/README.md index 51c3853570ef9..15b7ffa5cbe92 100644 --- a/sdk/storage/azure-storage-file-share/README.md +++ b/sdk/storage/azure-storage-file-share/README.md @@ -60,7 +60,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-file-share - 12.25.1 + 12.25.2 ``` [//]: # ({x-version-update-end}) @@ -586,18 +586,18 @@ For details on contributing to this repository, see the [contributing guide](htt [source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/src/ [reference_docs]: https://azure.github.io/azure-sdk-for-java/ -[rest_api_documentation]: https://learn.microsoft.com/rest/api/storageservices/file-service-rest-api -[storage_docs]: https://learn.microsoft.com/azure/storage/files/storage-files-introduction -[jdk]: https://learn.microsoft.com/java/azure/jdk/ +[rest_api_documentation]: https://docs.microsoft.com/rest/api/storageservices/file-service-rest-api +[storage_docs]: https://docs.microsoft.com/azure/storage/files/storage-files-introduction +[jdk]: https://docs.microsoft.com/java/azure/jdk/ [maven]: https://maven.apache.org/ [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://learn.microsoft.com/cli/azure -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://docs.microsoft.com/cli/azure +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 [RFC_URL_1]: https://www.ietf.org/rfc/rfc2616.txt [RFL_URL_2]: https://www.ietf.org/rfc/rfc3987.txt -[csharp_identifiers]: https://learn.microsoft.com/dotnet/csharp/language-reference/ -[storage_file_rest]: https://learn.microsoft.com/rest/api/storageservices/file-service-error-codes +[csharp_identifiers]: https://docs.microsoft.com/dotnet/csharp/language-reference/ +[storage_file_rest]: https://docs.microsoft.com/rest/api/storageservices/file-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/src/samples [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index f14509bcc8302..d23e1e4fd5412 100644 --- a/sdk/storage/azure-storage-file-share/assets.json +++ b/sdk/storage/azure-storage-file-share/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/storage/azure-storage-file-share", - "Tag": "java/storage/azure-storage-file-share_1ec39c35ed" + "Tag": "java/storage/azure-storage-file-share_7e9f790981" } diff --git a/sdk/storage/azure-storage-file-share/pom.xml b/sdk/storage/azure-storage-file-share/pom.xml index dd4d5eb7acb4d..f9652c6c1f14c 100644 --- a/sdk/storage/azure-storage-file-share/pom.xml +++ b/sdk/storage/azure-storage-file-share/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-file-share - 12.26.0-beta.1 + 12.25.2 Microsoft Azure client library for File Share Storage This module contains client library for Microsoft Azure File Share Storage. @@ -60,6 +60,7 @@ com.azure.json,com.azure.xml,com.azure.core.* ${basedir}/src/main/java:${basedir}/../../core/azure-core/src/main/java:${basedir}/../../serialization/azure-json/src/main/java:${basedir}/../../serialization/azure-xml/src/main/java + - @@ -81,13 +82,13 @@ com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 tests test-jar test @@ -118,27 +119,7 @@ com.azure azure-storage-blob - 12.30.0-beta.1 - test - - - org.mockito - mockito-core - 4.11.0 - test - - - - - net.bytebuddy - byte-buddy - 1.15.5 - test - - - net.bytebuddy - byte-buddy-agent - 1.15.5 + 12.29.1 test diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileConstants.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileConstants.java index 5a3179a178ec8..2761a77b47b60 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileConstants.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileConstants.java @@ -7,12 +7,6 @@ * Holds the Constants used for the File Service. */ public final class FileConstants { - /** - * Creates a new instance of {@link FileConstants}. - */ - public FileConstants() { - } - /** * Default header value for file permission. */ @@ -75,7 +69,7 @@ static final class HeaderConstants { public static final String FILE_ID = "x-ms-file-id"; /** - * Header that specifies file parent id. + * Header that spcifies file parent id. */ public static final String FILE_PARENT_ID = "x-ms-file-parent-id"; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileSmbProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileSmbProperties.java index 3ae99da78cb34..6c9dcd917d26f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileSmbProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileSmbProperties.java @@ -15,6 +15,7 @@ * A class used to represent the SMB properties of a file. */ public class FileSmbProperties { + private String filePermissionKey; private EnumSet ntfsFileAttributes; private OffsetDateTime fileCreationTime; @@ -33,8 +34,6 @@ public FileSmbProperties() { } /** - * Gets the file's permission key. - * * @return The file's permission key. */ public String getFilePermissionKey() { @@ -42,8 +41,6 @@ public String getFilePermissionKey() { } /** - * Gets the file's {@link NtfsFileAttributes}. - * * @return The file's {@link NtfsFileAttributes}. */ public EnumSet getNtfsFileAttributes() { @@ -51,8 +48,6 @@ public EnumSet getNtfsFileAttributes() { } /** - * Gets the file's creation time. - * * @return The file's creation time. */ public OffsetDateTime getFileCreationTime() { @@ -60,8 +55,6 @@ public OffsetDateTime getFileCreationTime() { } /** - * Gets the file's last write time. - * * @return The file's last write time. */ public OffsetDateTime getFileLastWriteTime() { @@ -69,8 +62,6 @@ public OffsetDateTime getFileLastWriteTime() { } /** - * Gets the file's change time. - * * @return The file's change time. */ public OffsetDateTime getFileChangeTime() { @@ -78,8 +69,6 @@ public OffsetDateTime getFileChangeTime() { } /** - * Gets the file's ID. - * * @return The file's ID. */ public String getFileId() { @@ -87,8 +76,6 @@ public String getFileId() { } /** - * Gets the file's parent ID. - * * @return The file's parent ID. */ public String getParentId() { @@ -233,6 +220,11 @@ static String parseFileSMBDate(OffsetDateTime time) { } static { - FileSmbPropertiesHelper.setAccessor(FileSmbProperties::new); + FileSmbPropertiesHelper.setAccessor(new FileSmbPropertiesHelper.FileSmbPropertiesAccessor() { + @Override + public FileSmbProperties create(HttpHeaders httpHeaders) { + return new FileSmbProperties(httpHeaders); + } + }); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/StorageFileOutputStream.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/StorageFileOutputStream.java index b357fa3bd276e..9711706c38e19 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/StorageFileOutputStream.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/StorageFileOutputStream.java @@ -5,9 +5,11 @@ import com.azure.storage.common.StorageOutputStream; import com.azure.storage.common.implementation.Constants; +import com.azure.storage.file.share.models.ShareStorageException; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.io.IOException; import java.nio.ByteBuffer; /** @@ -25,7 +27,12 @@ public class StorageFileOutputStream extends StorageOutputStream { } private Mono uploadData(Flux inputData, long writeLength, long offset) { - return client.uploadWithResponse(inputData, writeLength, offset).then(); + return client.uploadWithResponse(inputData, writeLength, offset) + .then() + .onErrorResume(t -> t instanceof IOException || t instanceof ShareStorageException, e -> { + this.lastError = new IOException(e); + return null; + }); } @Override diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoriesGetPropertiesHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoriesGetPropertiesHeaders.java index 54bb3b21b808f..114e495fcb4e7 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoriesGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoriesGetPropertiesHeaders.java @@ -10,7 +10,7 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.util.DateTimeRfc1123; import java.time.OffsetDateTime; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -146,7 +146,7 @@ public DirectoriesGetPropertiesHeaders(HttpHeaders rawHeaders) { if (xMsFileLastWriteTime != null) { this.xMsFileLastWriteTime = OffsetDateTime.parse(xMsFileLastWriteTime); } - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java index 0f39db9c986b3..c0941172f6b8f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.share.implementation.models; import com.azure.core.annotation.Fluent; @@ -20,6 +19,7 @@ */ @Fluent public final class FilesAndDirectoriesListSegment implements XmlSerializable { + /* * The DirectoryItems property. */ @@ -38,7 +38,7 @@ public FilesAndDirectoriesListSegment() { /** * Get the directoryItems property: The DirectoryItems property. - * + * * @return the directoryItems value. */ public List getDirectoryItems() { @@ -47,7 +47,7 @@ public List getDirectoryItems() { /** * Set the directoryItems property: The DirectoryItems property. - * + * * @param directoryItems the directoryItems value to set. * @return the FilesAndDirectoriesListSegment object itself. */ @@ -58,7 +58,7 @@ public FilesAndDirectoriesListSegment setDirectoryItems(List dire /** * Get the fileItems property: The FileItems property. - * + * * @return the fileItems value. */ public List getFileItems() { @@ -67,7 +67,7 @@ public List getFileItems() { /** * Set the fileItems property: The FileItems property. - * + * * @param fileItems the fileItems value to set. * @return the FilesAndDirectoriesListSegment object itself. */ @@ -100,7 +100,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of FilesAndDirectoriesListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of FilesAndDirectoriesListSegment if the XmlReader was pointing to an instance of it, or null * if it was pointing to XML null. @@ -112,7 +112,7 @@ public static FilesAndDirectoriesListSegment fromXml(XmlReader xmlReader) throws /** * Reads an instance of FilesAndDirectoriesListSegment from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -128,17 +128,21 @@ public static FilesAndDirectoriesListSegment fromXml(XmlReader xmlReader, String = new FilesAndDirectoriesListSegment(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Directory".equals(elementName.getLocalPart())) { + if (deserializedFilesAndDirectoriesListSegment.directoryItems == null) { + deserializedFilesAndDirectoriesListSegment.directoryItems = new ArrayList<>(); + } deserializedFilesAndDirectoriesListSegment.directoryItems .add(DirectoryItem.fromXml(reader, "Directory")); } else if ("File".equals(elementName.getLocalPart())) { + if (deserializedFilesAndDirectoriesListSegment.fileItems == null) { + deserializedFilesAndDirectoriesListSegment.fileItems = new ArrayList<>(); + } deserializedFilesAndDirectoriesListSegment.fileItems.add(FileItem.fromXml(reader, "File")); } else { reader.skipElement(); } } - return deserializedFilesAndDirectoriesListSegment; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesDownloadHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesDownloadHeaders.java index 5ead3f5728bf5..6898a849229fe 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesDownloadHeaders.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesDownloadHeaders.java @@ -16,7 +16,7 @@ import com.azure.storage.file.share.models.LeaseStatusType; import java.time.OffsetDateTime; import java.util.Base64; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -332,7 +332,7 @@ public FilesDownloadHeaders(HttpHeaders rawHeaders) { if (xMsFileLastWriteTime != null) { this.xMsFileLastWriteTime = OffsetDateTime.parse(xMsFileLastWriteTime); } - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetPropertiesHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetPropertiesHeaders.java index 78ab0071595bf..e3dd28b445f2a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetPropertiesHeaders.java @@ -16,7 +16,7 @@ import com.azure.storage.file.share.models.LeaseStatusType; import java.time.OffsetDateTime; import java.util.Base64; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -297,7 +297,7 @@ public FilesGetPropertiesHeaders(HttpHeaders rawHeaders) { if (xMsFileLastWriteTime != null) { this.xMsFileLastWriteTime = OffsetDateTime.parse(xMsFileLastWriteTime); } - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java index 7dddc8651c97b..c439554bcab6f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java @@ -14,7 +14,7 @@ import com.azure.storage.file.share.models.LeaseStatusType; import com.azure.storage.file.share.models.ShareRootSquash; import java.time.OffsetDateTime; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -328,7 +328,7 @@ public SharesGetPropertiesHeaders(HttpHeaders rawHeaders) { if (xMsShareProvisionedEgressMbps != null) { this.xMsShareProvisionedEgressMbps = Integer.parseInt(xMsShareProvisionedEgressMbps); } - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/DownloadRetryOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/DownloadRetryOptions.java index a3c921ae09757..d01394495c5b8 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/DownloadRetryOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/DownloadRetryOptions.java @@ -19,18 +19,12 @@ public final class DownloadRetryOptions { private static final ClientLogger LOGGER = new ClientLogger(DownloadRetryOptions.class); /* - * We use "retry" here because by the time the user passes this type, the initial request, or try, has already been - * issued and returned. This is in contrast to the retry policy options, which includes the initial try in its - * count, thus the difference in verbiage. + We use "retry" here because by the time the user passes this type, the initial request, or try, has already been + issued and returned. This is in contrast to the retry policy options, which includes the initial try in its count, + thus the difference in verbiage. */ private int maxRetryRequests = 5; - /** - * Creates a new instance of {@link DownloadRetryOptions}. - */ - public DownloadRetryOptions() { - } - /** * Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a * response body. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ListSharesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ListSharesOptions.java index a809630f4f14f..1cad82449288a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ListSharesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ListSharesOptions.java @@ -40,12 +40,6 @@ public final class ListSharesOptions { private boolean includeSnapshots; private boolean includeDeleted; - /** - * Creates a new instance of {@link ListSharesOptions}. - */ - public ListSharesOptions() { - } - /** * Sets the prefix that a share must match to be included in the listing. * diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/Range.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/Range.java index 32b8a9695a622..7ebc5f84254da 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/Range.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/Range.java @@ -29,12 +29,6 @@ public final class Range implements XmlSerializable { */ private long end; - /** - * Creates a new instance of the Range class. - */ - public Range() { - } - /** * Get the start property: Start of the range. * diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFilePermission.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFilePermission.java index efcb009b76211..03fc4ecc8b810 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFilePermission.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFilePermission.java @@ -17,12 +17,6 @@ public class ShareFilePermission { */ private String permission; - /** - * Creates a new instance of {@link ShareFilePermission}. - */ - public ShareFilePermission() { - } - /** * Get the format of file permission. * diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java index 8db238249fc27..50915f488d122 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -20,6 +19,7 @@ */ @Fluent public final class ShareFileRangeList implements XmlSerializable { + /* * The Ranges property. */ @@ -38,7 +38,7 @@ public ShareFileRangeList() { /** * Get the ranges property: The Ranges property. - * + * * @return the ranges value. */ public List getRanges() { @@ -47,7 +47,7 @@ public List getRanges() { /** * Set the ranges property: The Ranges property. - * + * * @param ranges the ranges value to set. * @return the ShareFileRangeList object itself. */ @@ -58,7 +58,7 @@ public ShareFileRangeList setRanges(List ranges) { /** * Get the clearRanges property: The ClearRanges property. - * + * * @return the clearRanges value. */ public List getClearRanges() { @@ -67,7 +67,7 @@ public List getClearRanges() { /** * Set the clearRanges property: The ClearRanges property. - * + * * @param clearRanges the clearRanges value to set. * @return the ShareFileRangeList object itself. */ @@ -100,7 +100,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of ShareFileRangeList from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of ShareFileRangeList if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -112,7 +112,7 @@ public static ShareFileRangeList fromXml(XmlReader xmlReader) throws XMLStreamEx /** * Reads an instance of ShareFileRangeList from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -126,16 +126,20 @@ public static ShareFileRangeList fromXml(XmlReader xmlReader, String rootElement ShareFileRangeList deserializedShareFileRangeList = new ShareFileRangeList(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Range".equals(elementName.getLocalPart())) { + if (deserializedShareFileRangeList.ranges == null) { + deserializedShareFileRangeList.ranges = new ArrayList<>(); + } deserializedShareFileRangeList.ranges.add(FileRange.fromXml(reader, "Range")); } else if ("ClearRange".equals(elementName.getLocalPart())) { + if (deserializedShareFileRangeList.clearRanges == null) { + deserializedShareFileRangeList.clearRanges = new ArrayList<>(); + } deserializedShareFileRangeList.clearRanges.add(ClearRange.fromXml(reader, "ClearRange")); } else { reader.skipElement(); } } - return deserializedShareFileRangeList; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareItem.java index 8d5dedd976b7d..c76a5ce0ed532 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareItem.java @@ -51,12 +51,6 @@ public final class ShareItem implements XmlSerializable { */ private Map metadata; - /** - * Creates an instance of ShareItem. - */ - public ShareItem() { - } - /** * Get the name property: The name property. * diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java index 1aa3056540334..6ef443ff34e64 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java @@ -162,12 +162,6 @@ public final class ShareProperties implements XmlSerializable { */ private OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime; - /** - * Creates a new instance of {@link ShareProperties}. - */ - public ShareProperties() { - } - /** * Get the lastModified property: The lastModified property. * diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java index 8c07e9870bd08..4217e9e1da8ee 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java @@ -137,8 +137,7 @@ public ShareCreateOptions setRootSquash(ShareRootSquash rootSquash) { /** * Get the enableSnapshotVirtualDirectoryAccess property: The EnableSnapshotVirtualDirectoryAccess property. * Optional. Supported in version 2023-08-03 and above. Only applicable for premium file storage accounts. - * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS - * is enabled. + * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled. * If not specified, the default is true. * @return the enableSnapshotVirtualDirectoryAccess value. */ @@ -149,8 +148,7 @@ public Boolean isSnapshotVirtualDirectoryAccessEnabled() { /** * Set the enableSnapshotVirtualDirectoryAccess property: * Optional. Supported in version 2023-08-03 and above. Only applicable for premium file storage accounts. - * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS - * is enabled. + * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled. * If not specified, the default is true. * @param snapshotVirtualDirectoryAccessEnabled the enableSnapshotVirtualDirectoryAccess value to set. * @return the ShareCreateOptions object itself. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareDirectorySetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareDirectorySetPropertiesOptions.java index d3d5eac2b25d4..559301c69961f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareDirectorySetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareDirectorySetPropertiesOptions.java @@ -15,14 +15,6 @@ public class ShareDirectorySetPropertiesOptions { private ShareFilePermission filePermissions; /** - * Creates a new instance of {@link ShareDirectorySetPropertiesOptions}. - */ - public ShareDirectorySetPropertiesOptions() { - } - - /** - * Gets the optional SMB properties to set on the destination file or directory. - * * @return Optional SMB properties to set on the destination file or directory. The only properties that are * considered are file attributes, file creation time, file last write time, and file permission key. The rest are * ignored. @@ -32,8 +24,6 @@ public FileSmbProperties getSmbProperties() { } /** - * Sets the optional SMB properties to set on the destination file or directory. - * * @param smbProperties Optional SMB properties to set on the destination file or directory. The only properties * that are considered are file attributes, file creation time, file last write time, and file permission key. The * rest are ignored. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileCreateOptions.java index bddc32347af46..dc3021cb4a0f6 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileCreateOptions.java @@ -25,8 +25,6 @@ public class ShareFileCreateOptions { private ShareRequestConditions requestConditions; /** - * Creates a new instance of {@link ShareFileCreateOptions}. - * * @param size Specifies the maximum size for the file share. */ public ShareFileCreateOptions(long size) { @@ -34,8 +32,6 @@ public ShareFileCreateOptions(long size) { } /** - * Gets the maximum size for the file share. - * * @return Specifies the maximum size for the file share. */ public long getSize() { @@ -43,8 +39,6 @@ public long getSize() { } /** - * Gets the file's http headers. - * * @return the file's http headers. */ public ShareFileHttpHeaders getShareFileHttpHeaders() { @@ -53,7 +47,6 @@ public ShareFileHttpHeaders getShareFileHttpHeaders() { /** * Sets the file's http headers. - * * @param headers the http headers. * @return the updated options. */ @@ -63,8 +56,6 @@ public ShareFileCreateOptions setShareFileHttpHeaders(ShareFileHttpHeaders heade } /** - * Gets the optional SMB properties to set on the destination file or directory. - * * @return Optional SMB properties to set on the destination file or directory. The only properties that are * considered are file attributes, file creation time, file last write time, and file permission key. The rest are * ignored. @@ -74,8 +65,6 @@ public FileSmbProperties getSmbProperties() { } /** - * Sets the optional SMB properties to set on the destination file or directory. - * * @param smbProperties Optional SMB properties to set on the destination file or directory. The only properties * that are considered are file attributes, file creation time, file last write time, and file permission key. The * rest are ignored. @@ -87,8 +76,6 @@ public ShareFileCreateOptions setSmbProperties(FileSmbProperties smbProperties) } /** - * Gets the metadata to associate with the share. - * * @return Metadata to associate with the share */ public Map getMetadata() { @@ -96,8 +83,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the share. - * * @param metadata Metadata to associate with the share. If there is leading or trailing whitespace in any * metadata key or value, it must be removed or encoded. * @return The updated options. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileDownloadOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileDownloadOptions.java index abd06ec0a4d9c..a5d5a858402ea 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileDownloadOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileDownloadOptions.java @@ -13,20 +13,13 @@ */ @Fluent public final class ShareFileDownloadOptions { + private ShareFileRange range; private Boolean rangeContentMd5Requested; private ShareRequestConditions requestConditions; private DownloadRetryOptions retryOptions; /** - * Creates a new instance of {@link ShareFileDownloadOptions}. - */ - public ShareFileDownloadOptions() { - } - - /** - * Gets the range of bytes over which to list ranges, inclusively. - * * @return The range of bytes over which to list ranges, inclusively. */ public ShareFileRange getRange() { @@ -34,8 +27,6 @@ public ShareFileRange getRange() { } /** - * Sets the range of bytes over which to list ranges, inclusively. - * * @param range The range of bytes over which to list ranges, inclusively. * @return The updated options. */ @@ -45,18 +36,14 @@ public ShareFileDownloadOptions setRange(ShareFileRange range) { } /** - * Gets whether the service returns the MD5 hash for the range. - * - * @return Whether the service returns the MD5 hash for the range. + * @return Whether or not the service returns the MD5 hash for the range. */ public Boolean isRangeContentMd5Requested() { return rangeContentMd5Requested; } /** - * Sets whether the service returns the MD5 hash for the range. - * - * @param rangeContentMd5Requested Whether the service returns the MD5 hash for the range. + * @param rangeContentMd5Requested Whether or not the service returns the MD5 hash for the range. * @return The updated options. */ public ShareFileDownloadOptions setRangeContentMd5Requested(Boolean rangeContentMd5Requested) { @@ -65,8 +52,6 @@ public ShareFileDownloadOptions setRangeContentMd5Requested(Boolean rangeContent } /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions} */ public ShareRequestConditions getRequestConditions() { @@ -74,8 +59,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions} for the file. - * * @param requestConditions {@link ShareRequestConditions} for the file. * @return The updated options. */ @@ -85,8 +68,6 @@ public ShareFileDownloadOptions setRequestConditions(ShareRequestConditions requ } /** - * Gets the {@link DownloadRetryOptions}. - * * @return {@link DownloadRetryOptions} */ public DownloadRetryOptions getRetryOptions() { @@ -94,8 +75,6 @@ public DownloadRetryOptions getRetryOptions() { } /** - * Sets the {@link DownloadRetryOptions}. - * * @param retryOptions {@link DownloadRetryOptions} * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileListRangesDiffOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileListRangesDiffOptions.java index 546fe98f72b33..cec098d946c3e 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileListRangesDiffOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileListRangesDiffOptions.java @@ -13,18 +13,16 @@ */ @Fluent public class ShareFileListRangesDiffOptions { + private ShareFileRange range; private final String previousSnapshot; private ShareRequestConditions requestConditions; private Boolean supportRename; /** - * Creates a new instance of {@link ShareFileListRangesDiffOptions}. - * * @param previousSnapshot Specifies that the response will contain only ranges that were changed between target * file and previous snapshot. Changed ranges include both updated and cleared ranges. The target file may be a * snapshot, as long as the snapshot specified by previousSnapshot is the older of the two. - * @throws NullPointerException If {@code previousSnapshot} is null. */ public ShareFileListRangesDiffOptions(String previousSnapshot) { StorageImplUtils.assertNotNull("previousSnapshot", previousSnapshot); @@ -32,8 +30,6 @@ public ShareFileListRangesDiffOptions(String previousSnapshot) { } /** - * Gets the range of bytes over which to list ranges, inclusively. - * * @return The range of bytes over which to list ranges, inclusively. */ public ShareFileRange getRange() { @@ -41,8 +37,6 @@ public ShareFileRange getRange() { } /** - * Sets the range of bytes over which to list ranges, inclusively. - * * @param range The range of bytes over which to list ranges, inclusively. * @return The updated options. */ @@ -52,8 +46,6 @@ public ShareFileListRangesDiffOptions setRange(ShareFileRange range) { } /** - * Gets the previous snapshot to compare to. - * * @return The previous snapshot to compare to. */ public String getPreviousSnapshot() { @@ -61,8 +53,6 @@ public String getPreviousSnapshot() { } /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions} */ public ShareRequestConditions getRequestConditions() { @@ -70,8 +60,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions} for the file. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileRenameOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileRenameOptions.java index 9d770f7385ea3..1dc298368d2d6 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileRenameOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileRenameOptions.java @@ -34,7 +34,6 @@ public final class ShareFileRenameOptions { * Creates a {@code ShareFileRenameOptions} object. * * @param destinationPath Relative path from the share to rename the file to. - * @throws NullPointerException If {@code destinationPath} is null. */ public ShareFileRenameOptions(String destinationPath) { StorageImplUtils.assertNotNull("destinationPath", destinationPath); @@ -42,8 +41,6 @@ public ShareFileRenameOptions(String destinationPath) { } /** - * Gets the path to which the file should be renamed. - * * @return The path to which the file should be renamed. */ public String getDestinationPath() { @@ -51,9 +48,6 @@ public String getDestinationPath() { } /** - * Gets a boolean value which, if the destination file already exists, determines whether this request will - * overwrite the file or not. - * * @return A boolean value which, if the destination file already exists, determines whether this * request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. * If not provided or if false and the destination file does exist, the request will not overwrite the destination @@ -64,9 +58,6 @@ public Boolean getReplaceIfExists() { } /** - * Sets a boolean value which, if the destination file already exists, determines whether this request will - * overwrite the file or not. - * * @param replaceIfExists A boolean value which, if the destination file already exists, determines whether this * request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. * If not provided or if false and the destination file does exist, the request will not overwrite the destination @@ -79,9 +70,6 @@ public ShareFileRenameOptions setReplaceIfExists(Boolean replaceIfExists) { } /** - * Gets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be - * respected. - * * @return A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be * respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly * attribute set will cause the rename to fail. @@ -91,9 +79,6 @@ public Boolean isIgnoreReadOnly() { } /** - * Sets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be - * respected. - * * @param ignoreReadOnly A boolean value that specifies whether the ReadOnly attribute on a preexisting destination * file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with * the ReadOnly attribute set will cause the rename to fail. @@ -105,8 +90,6 @@ public ShareFileRenameOptions setIgnoreReadOnly(Boolean ignoreReadOnly) { } /** - * Gets the source request conditions. This parameter is only applicable if the source is a file. - * * @return Source request conditions. This parameter is only applicable if the source is a file. */ public ShareRequestConditions getSourceRequestConditions() { @@ -114,8 +97,6 @@ public ShareRequestConditions getSourceRequestConditions() { } /** - * Sets the source request conditions. This parameter is only applicable if the source is a file. - * * @param sourceRequestConditions Source request conditions. This parameter is only applicable if the source is a * file. * @return The updated options. @@ -126,8 +107,6 @@ public ShareFileRenameOptions setSourceRequestConditions(ShareRequestConditions } /** - * Gets the destination request conditions. - * * @return The destination request conditions. */ public ShareRequestConditions getDestinationRequestConditions() { @@ -135,8 +114,6 @@ public ShareRequestConditions getDestinationRequestConditions() { } /** - * Sets the destination request conditions. - * * @param destinationRequestConditions The destination request conditions. * @return The updated options. */ @@ -146,9 +123,6 @@ public ShareFileRenameOptions setDestinationRequestConditions(ShareRequestCondit } /** - * Gets the optional file permission to set on the destination file or directory. The value in SmbProperties will be - * ignored. - * * @return Optional file permission to set on the destination file or directory. The value in SmbProperties will be * ignored. */ @@ -157,9 +131,6 @@ public String getFilePermission() { } /** - * Sets the optional file permission to set on the destination file or directory. The value in SmbProperties will be - * ignored. - * * @param filePermission Optional file permission to set on the destination file or directory. The value in * SmbProperties will be ignored. * @return The updated options. @@ -170,8 +141,6 @@ public ShareFileRenameOptions setFilePermission(String filePermission) { } /** - * Gets the optional SMB properties to set on the destination file or directory. - * * @return Optional SMB properties to set on the destination file or directory. The only properties that are * considered are file attributes, file creation time, file last write time, and file permission key. The rest are * ignored. @@ -181,8 +150,6 @@ public FileSmbProperties getSmbProperties() { } /** - * Sets the optional SMB properties to set on the destination file or directory. - * * @param smbProperties Optional SMB properties to set on the destination file or directory. The only properties * that are considered are file attributes, file creation time, file last write time, and file permission key. The * rest are ignored. @@ -194,8 +161,6 @@ public ShareFileRenameOptions setSmbProperties(FileSmbProperties smbProperties) } /** - * Gets the metadata to associate with the renamed file. - * * @return The metadata to associate with the renamed file. */ public Map getMetadata() { @@ -203,8 +168,6 @@ public Map getMetadata() { } /** - * Sets the metadata to associate with the renamed file. - * * @param metadata The metadata to associate with the renamed file. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelReadOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelReadOptions.java index b55cee38c5ec1..c19a67b6fd931 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelReadOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelReadOptions.java @@ -13,14 +13,6 @@ public final class ShareFileSeekableByteChannelReadOptions { private Long chunkSizeInBytes; /** - * Creates a new instance of {@link ShareFileSeekableByteChannelReadOptions}. - */ - public ShareFileSeekableByteChannelReadOptions() { - } - - /** - * Gets the size of individual writes to the service. - * * @return The size of individual writes to the service. */ public Long getChunkSizeInBytes() { @@ -28,8 +20,6 @@ public Long getChunkSizeInBytes() { } /** - * Sets the size of individual writes to the service. - * * @param chunkSizeInBytes The size of individual writes to the service. * @return The updated instance. */ @@ -39,8 +29,6 @@ public ShareFileSeekableByteChannelReadOptions setChunkSizeInBytes(Long chunkSiz } /** - * Gets the request conditions to be used by the resulting channel. - * * @return Request conditions to be used by the resulting channel. */ public ShareRequestConditions getRequestConditions() { @@ -48,8 +36,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the request conditions to be used by the resulting channel. - * * @param requestConditions Request conditions to be used by the resulting channel. * @return The updated instance. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelWriteOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelWriteOptions.java index 9e73f93d0529f..6ba4d3a8952c5 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelWriteOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSeekableByteChannelWriteOptions.java @@ -28,8 +28,6 @@ public ShareFileSeekableByteChannelWriteOptions(boolean overwriteMode) { } /** - * Gets whether the channel is in write mode. - * * @return Whether the channel is in write mode. */ public boolean isOverwriteMode() { @@ -45,8 +43,6 @@ public Long getFileSizeInBytes() { } /** - * Gets the size of individual writes to the service. - * * @param fileSize New size of the target file. * @return The updated instance. * @throws UnsupportedOperationException When setting a file size on options that don't create a new file. @@ -66,8 +62,6 @@ public ShareFileSeekableByteChannelWriteOptions setFileSize(Long fileSize) { } /** - * Gets the size of individual writes to the service. - * * @return The size of individual writes to the service. */ public Long getChunkSizeInBytes() { @@ -75,8 +69,6 @@ public Long getChunkSizeInBytes() { } /** - * Sets the size of individual writes to the service. - * * @param chunkSizeInBytes The size of individual writes to the service. * @return The updated instance. */ @@ -86,8 +78,6 @@ public ShareFileSeekableByteChannelWriteOptions setChunkSizeInBytes(Long chunkSi } /** - * Gets the request conditions to be used by the resulting channel. - * * @return Request conditions to be used by the resulting channel. */ public ShareRequestConditions getRequestConditions() { @@ -95,8 +85,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the request conditions to be used by the resulting channel. - * * @param requestConditions Request conditions to be used by the resulting channel. * @return The updated instance. */ @@ -106,18 +94,14 @@ public ShareFileSeekableByteChannelWriteOptions setRequestConditions(ShareReques } /** - * Gets the last written mode to be used by the resulting channel. - * - * @return The last written mode to be used by the resulting channel. + * @return The last wriiten mode to be used by the resulting channel. */ public FileLastWrittenMode getFileLastWrittenMode() { return fileLastWrittenMode; } /** - * Sets the last written mode to be used by the resulting channel. - * - * @param fileLastWrittenMode The last written mode to be used by the resulting channel. + * @param fileLastWrittenMode The last wriiten mode to be used by the resulting channel. * @return The updated instance. */ public ShareFileSeekableByteChannelWriteOptions setFileLastWrittenMode(FileLastWrittenMode fileLastWrittenMode) { diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSetPropertiesOptions.java index 463bdc5588c9b..b6c5b5802d73f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileSetPropertiesOptions.java @@ -20,8 +20,6 @@ public class ShareFileSetPropertiesOptions { private ShareRequestConditions requestConditions; /** - * Creates a new instance of {@link ShareFileSetPropertiesOptions}. - * * @param sizeInBytes Specifies the new size for the file share in bytes. If the specified byte value is less than the * current size of the file, then all ranges above the specified byte value are cleared. */ @@ -30,8 +28,6 @@ public ShareFileSetPropertiesOptions(long sizeInBytes) { } /** - * Gets the new size for the file share. - * * @return Gets the new size for the file share. */ public long getSizeInBytes() { @@ -39,8 +35,6 @@ public long getSizeInBytes() { } /** - * Gets the file's http headers. - * * @return the file's http headers. */ public ShareFileHttpHeaders getHttpHeaders() { @@ -58,8 +52,6 @@ public ShareFileSetPropertiesOptions setHttpHeaders(ShareFileHttpHeaders httpHea } /** - * Gets the optional SMB properties to set on the destination file or directory. - * * @return Optional SMB properties to set on the destination file or directory. The only properties that are * considered are file attributes, file creation time, file last write time, and file permission key. The rest are * ignored. @@ -69,8 +61,6 @@ public FileSmbProperties getSmbProperties() { } /** - * Sets the optional SMB properties to set on the destination file or directory. - * * @param smbProperties Optional SMB properties to set on the destination file or directory. The only properties * that are considered are file attributes, file creation time, file last write time, and file permission key. The * rest are ignored. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileUploadRangeFromUrlOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileUploadRangeFromUrlOptions.java index dbd32297f2300..51582ca09ab28 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileUploadRangeFromUrlOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileUploadRangeFromUrlOptions.java @@ -23,11 +23,8 @@ public final class ShareFileUploadRangeFromUrlOptions { private FileLastWrittenMode lastWrittenMode; /** - * Creates a new instance of {@link ShareFileUploadRangeFromUrlOptions}. - * * @param length data length to upload for this operation. * @param sourceUrl source URL for this operation. - * @throws NullPointerException if {@code sourceUrl} is null. */ public ShareFileUploadRangeFromUrlOptions(long length, String sourceUrl) { StorageImplUtils.assertNotNull("sourceUrl", sourceUrl); @@ -36,8 +33,6 @@ public ShareFileUploadRangeFromUrlOptions(long length, String sourceUrl) { } /** - * Gets the length of the data to upload for this operation. - * * @return data length to upload for this operation. */ public long getLength() { @@ -45,8 +40,6 @@ public long getLength() { } /** - * Gets the source URL for this operation. - * * @return source URL for this operation. */ public String getSourceUrl() { @@ -54,8 +47,6 @@ public String getSourceUrl() { } /** - * Gets the destination offset for this operation. - * * @return destination offset for this operation. */ public long getDestinationOffset() { @@ -63,8 +54,6 @@ public long getDestinationOffset() { } /** - * Sets the destination offset for this operation. - * * @param destinationOffset offset for upload destination. * @return modified options. */ @@ -74,8 +63,6 @@ public ShareFileUploadRangeFromUrlOptions setDestinationOffset(long destinationO } /** - * Gets the source offset for this operation. - * * @return source offset for this operation. */ public long getSourceOffset() { @@ -83,8 +70,6 @@ public long getSourceOffset() { } /** - * Sets the source offset for this operation. - * * @param sourceOffset offset for upload source. * @return modified options. */ @@ -94,9 +79,6 @@ public ShareFileUploadRangeFromUrlOptions setSourceOffset(long sourceOffset) { } /** - * Gets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by - * Storage. - * * @return optional auth header for access to source URL for this operation. */ public HttpAuthorization getSourceAuthorization() { @@ -116,8 +98,6 @@ public ShareFileUploadRangeFromUrlOptions setSourceAuthorization(HttpAuthorizati } /** - * Gets {@link ShareRequestConditions} for this operation. - * * @return {@link ShareRequestConditions} for this operation. */ public ShareRequestConditions getDestinationRequestConditions() { @@ -125,8 +105,6 @@ public ShareRequestConditions getDestinationRequestConditions() { } /** - * Sets {@link ShareRequestConditions} for this operation. - * * @param destinationRequestConditions {@link ShareRequestConditions} for this operation. * @return modified options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetAccessPolicyOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetAccessPolicyOptions.java index a1bf06b71807a..2b880340eb3fe 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetAccessPolicyOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetAccessPolicyOptions.java @@ -11,17 +11,10 @@ */ @Fluent public class ShareGetAccessPolicyOptions { - private ShareRequestConditions requestConditions; - /** - * Creates a new instance of {@link ShareGetAccessPolicyOptions}. - */ - public ShareGetAccessPolicyOptions() { - } + private ShareRequestConditions requestConditions; /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions}. */ public ShareRequestConditions getRequestConditions() { @@ -29,8 +22,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions}. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetPropertiesOptions.java index 38f70f6574c08..7ecb4e99dafc7 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetPropertiesOptions.java @@ -11,17 +11,10 @@ */ @Fluent public class ShareGetPropertiesOptions { - private ShareRequestConditions requestConditions; - /** - * Creates a new instance of {@link ShareGetPropertiesOptions}. - */ - public ShareGetPropertiesOptions() { - } + private ShareRequestConditions requestConditions; /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions}. */ public ShareRequestConditions getRequestConditions() { @@ -29,8 +22,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions}. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetStatisticsOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetStatisticsOptions.java index 0821b23220155..0d7ef0009fe3e 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetStatisticsOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareGetStatisticsOptions.java @@ -11,17 +11,10 @@ */ @Fluent public class ShareGetStatisticsOptions { - private ShareRequestConditions requestConditions; - /** - * Creates a new instance of {@link ShareGetStatisticsOptions}. - */ - public ShareGetStatisticsOptions() { - } + private ShareRequestConditions requestConditions; /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions}. */ public ShareRequestConditions getRequestConditions() { @@ -29,8 +22,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions}. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java index 0b5138331c401..e336dd7911516 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java @@ -16,14 +16,6 @@ public final class ShareListFilesAndDirectoriesOptions { private Boolean includeExtendedInfo; /** - * Creates a new instance of {@link ShareListFilesAndDirectoriesOptions}. - */ - public ShareListFilesAndDirectoriesOptions() { - } - - /** - * Gets the prefix for a listing operation. - * * @return prefix for this listing operation. */ public String getPrefix() { @@ -42,8 +34,6 @@ public ShareListFilesAndDirectoriesOptions setPrefix(String prefix) { } /** - * Gets the max results per page for a listing operation. - * * @return max results per page for this listing operation. */ public Integer getMaxResultsPerPage() { @@ -64,7 +54,7 @@ public ShareListFilesAndDirectoriesOptions setMaxResultsPerPage(Integer maxResul /** * Note that setting timestamps, etag, attributes, or permission key will also set this option as true. Attempting * to set it back to false while any of these options are true will be unsuccessful. - *

+ * * Including extended info in a listing operation can result in a more expensive operation, but will present * more accurate information on the listing item. * @@ -77,9 +67,9 @@ public Boolean includeExtendedInfo() { /** * Note that setting timestamps, etag, attributes, or permission key will also set this option as true. Attempting * to set it back to false will be unsuccessful. - *

+ * * Sets the prefix for a listing operation. - *

+ * * Including extended info in a listing operation can result in a more expensive operation, but will present * more accurate information on the listing item. * @@ -93,8 +83,6 @@ public ShareListFilesAndDirectoriesOptions setIncludeExtendedInfo(Boolean includ } /** - * Gets whether to include timestamps on a listing operation. - * * @return whether to include timestamps on this listing operation. */ public boolean includeTimestamps() { @@ -102,8 +90,6 @@ public boolean includeTimestamps() { } /** - * Sets whether to include timestamps on a listing operation. - * * @param includeTimestamps whether to include timestamps on this listing operation. * @return updated options */ @@ -113,8 +99,6 @@ public ShareListFilesAndDirectoriesOptions setIncludeTimestamps(boolean includeT } /** - * Gets whether to include the etag on a listing operation. - * * @return whether to include the etag on this listing operation. */ public boolean includeETag() { @@ -122,8 +106,6 @@ public boolean includeETag() { } /** - * Sets whether to include the etag on a listing operation. - * * @param includeETag whether to include the etag on this listing operation. * @return updated options */ @@ -133,8 +115,6 @@ public ShareListFilesAndDirectoriesOptions setIncludeETag(boolean includeETag) { } /** - * Gets whether to include file attributes on a listing operation. - * * @return whether to include file attributes on this listing operation. */ public boolean includeAttributes() { @@ -142,8 +122,6 @@ public boolean includeAttributes() { } /** - * Sets whether to include file attributes on a listing operation. - * * @param includeAttributes whether to include file attributes on this listing operation. * @return updated options */ @@ -153,8 +131,6 @@ public ShareListFilesAndDirectoriesOptions setIncludeAttributes(boolean includeA } /** - * Gets whether to include the permission key on a listing operation. - * * @return whether to include the permission key on this listing operation. */ public boolean includePermissionKey() { @@ -162,8 +138,6 @@ public boolean includePermissionKey() { } /** - * Sets whether to include the permission key on a listing operation. - * * @param includePermissionKey whether to include the permission key on this listing operation. * @return updated options */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetAccessPolicyOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetAccessPolicyOptions.java index 63bed05e0dca9..c86c19a6af608 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetAccessPolicyOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetAccessPolicyOptions.java @@ -15,18 +15,11 @@ */ @Fluent public class ShareSetAccessPolicyOptions { + private List permissions; private ShareRequestConditions requestConditions; /** - * Creates a new instance of {@link ShareSetAccessPolicyOptions}. - */ - public ShareSetAccessPolicyOptions() { - } - - /** - * Gets the access policies to set on the share. - * * @return Access policies to set on the share. */ public List getPermissions() { @@ -34,8 +27,6 @@ public List getPermissions() { } /** - * Sets the access policies to set on the share. - * * @param permissions Access policies to set on the share. * @return The updated options. */ @@ -45,8 +36,6 @@ public ShareSetAccessPolicyOptions setPermissions(List pe } /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions}. */ public ShareRequestConditions getRequestConditions() { @@ -54,8 +43,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions}. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetMetadataOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetMetadataOptions.java index b28f360c8fe0c..ad0282ad6b8f5 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetMetadataOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetMetadataOptions.java @@ -14,18 +14,11 @@ */ @Fluent public class ShareSetMetadataOptions { + private Map metadata; private ShareRequestConditions requestConditions; /** - * Creates a new instance of {@link ShareSetMetadataOptions}. - */ - public ShareSetMetadataOptions() { - } - - /** - * Gets the metadata to set on the share. - * * @return Metadata to set on the share, if null is passed the metadata for the share is cleared. */ public Map getMetadata() { @@ -33,8 +26,6 @@ public Map getMetadata() { } /** - * Sets the metadata to set on the share. - * * @param metadata Metadata to set on the share, if null is passed the metadata for the share is cleared. * @return The updated options. */ @@ -44,8 +35,6 @@ public ShareSetMetadataOptions setMetadata(Map metadata) { } /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions}. */ public ShareRequestConditions getRequestConditions() { @@ -53,8 +42,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions}. * @return The updated options. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java index 1e398ee52872d..33b10d2155f09 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java @@ -13,6 +13,7 @@ */ @Fluent public class ShareSetPropertiesOptions { + private Integer quotaInGb; private ShareAccessTier accessTier; private ShareRootSquash rootSquash; @@ -25,14 +26,6 @@ public class ShareSetPropertiesOptions { private Long provisionedMaxBandwidthMibps; /** - * Creates a new instance of {@link ShareSetPropertiesOptions}. - */ - public ShareSetPropertiesOptions() { - } - - /** - * Gets the {@link ShareAccessTier}. - * * @return {@link ShareAccessTier} */ public ShareAccessTier getAccessTier() { @@ -40,8 +33,6 @@ public ShareAccessTier getAccessTier() { } /** - * Sets the {@link ShareAccessTier}. - * * @param accessTier {@link ShareAccessTier}. * @return The updated options. */ @@ -51,8 +42,6 @@ public ShareSetPropertiesOptions setAccessTier(ShareAccessTier accessTier) { } /** - * Gets the size in GB to limit the share's growth. - * * @return Size in GB to limit the share's growth. */ public Integer getQuotaInGb() { @@ -60,8 +49,6 @@ public Integer getQuotaInGb() { } /** - * Sets the size in GB to limit the share's growth. - * * @param quotaInGb Size in GB to limit the share's growth. * @return The updated options. */ @@ -71,8 +58,6 @@ public ShareSetPropertiesOptions setQuotaInGb(Integer quotaInGb) { } /** - * Gets the root squash to set for the share. Only valid for NFS. - * * @return The root squash to set for the share. Only valid for NFS. */ public ShareRootSquash getRootSquash() { @@ -80,8 +65,6 @@ public ShareRootSquash getRootSquash() { } /** - * Sets the root squash to set for the share. Only valid for NFS. - * * @param rootSquash The root squash to set for the share. Only valid for NFS. * @return The updated options. */ @@ -91,8 +74,6 @@ public ShareSetPropertiesOptions setRootSquash(ShareRootSquash rootSquash) { } /** - * Gets the {@link ShareRequestConditions}. - * * @return {@link ShareRequestConditions}. */ public ShareRequestConditions getRequestConditions() { @@ -100,8 +81,6 @@ public ShareRequestConditions getRequestConditions() { } /** - * Sets the {@link ShareRequestConditions}. - * * @param requestConditions {@link ShareRequestConditions}. * @return The updated options. */ @@ -113,8 +92,7 @@ public ShareSetPropertiesOptions setRequestConditions(ShareRequestConditions req /** * Get the enableSnapshotVirtualDirectoryAccess property: The EnableSnapshotVirtualDirectoryAccess property. * Optional. Supported in version 2023-08-03 and above. Only applicable for premium file storage accounts. - * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS - * is enabled. + * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled. * If not specified, the default is true. * * @return the enableSnapshotVirtualDirectoryAccess value. @@ -126,8 +104,7 @@ public Boolean isSnapshotVirtualDirectoryAccessEnabled() { /** * Set the enableSnapshotVirtualDirectoryAccess property: The EnableSnapshotVirtualDirectoryAccess property. * Optional. Supported in version 2023-08-03 and above. Only applicable for premium file storage accounts. - * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS - * is enabled. + * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled. * If not specified, the default is true. * * @param snapshotVirtualDirectoryAccessEnabled the enableSnapshotVirtualDirectoryAccess value to set. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareFileSasPermission.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareFileSasPermission.java index 128bcc7c4827d..c48ae72dd4363 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareFileSasPermission.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareFileSasPermission.java @@ -24,8 +24,11 @@ */ public final class ShareFileSasPermission { private boolean readPermission; + private boolean createPermission; + private boolean writePermission; + private boolean deletePermission; /** diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareSasPermission.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareSasPermission.java index 7400a94ca4d1c..650b00768869a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareSasPermission.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareSasPermission.java @@ -16,9 +16,13 @@ */ public final class ShareSasPermission { private boolean readPermission; + private boolean createPermission; + private boolean writePermission; + private boolean deletePermission; + private boolean listPermission; /** @@ -70,8 +74,6 @@ public static ShareSasPermission parse(String permissionString) { } /** - * Gets the read permission status. - * * @return the read permission status */ public boolean hasReadPermission() { @@ -90,8 +92,6 @@ public ShareSasPermission setReadPermission(boolean hasReadPermission) { } /** - * Gets the create permission status. - * * @return the create permission status */ public boolean hasCreatePermission() { @@ -110,8 +110,6 @@ public ShareSasPermission setCreatePermission(boolean hasCreatePermission) { } /** - * Gets the write permission status. - * * @return the write permission status */ public boolean hasWritePermission() { @@ -130,8 +128,6 @@ public ShareSasPermission setWritePermission(boolean hasWritePermission) { } /** - * Gets the delete permission status. - * * @return the delete permission status */ public boolean hasDeletePermission() { @@ -150,8 +146,6 @@ public ShareSasPermission setDeletePermission(boolean hasDeletePermission) { } /** - * Gets the list permission status. - * * @return the list permission status */ public boolean hasListPermission() { diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasQueryParameters.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasQueryParameters.java index 24bf48d34cb62..83d6e8bcb5526 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasQueryParameters.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasQueryParameters.java @@ -24,12 +24,19 @@ */ @Deprecated public final class ShareServiceSasQueryParameters extends BaseSasQueryParameters { + private final String identifier; + private final String resource; + private final String cacheControl; + private final String contentDisposition; + private final String contentEncoding; + private final String contentLanguage; + private final String contentType; /** @@ -92,8 +99,6 @@ public ShareServiceSasQueryParameters(Map queryParamsMap, bool } /** - * Gets the signed identifier (only for {@link ShareServiceSasSignatureValues}) or {@code null}. - * * @return The signed identifier (only for {@link ShareServiceSasSignatureValues}) or {@code null}. Please see * here * for more information. @@ -105,8 +110,6 @@ public String getIdentifier() { } /** - * Gets the storage share or file (only for {@link ShareServiceSasSignatureValues}). - * * @return The storage share or file (only for {@link ShareServiceSasSignatureValues}). * @deprecated Please use {@link ShareServiceSasSignatureValues} */ @@ -116,8 +119,6 @@ public String getResource() { } /** - * Gets the Cache-Control header value when a client accesses the resource with this sas token. - * * @return The Cache-Control header value when a client accesses the resource with this sas token. * @deprecated Please use {@link ShareServiceSasSignatureValues} */ @@ -127,8 +128,6 @@ public String getCacheControl() { } /** - * Gets the Content-Disposition header value when a client accesses the resource with this sas token. - * * @return The Content-Disposition header value when a client accesses the resource with this sas token. * @deprecated Please use {@link ShareServiceSasSignatureValues} */ @@ -138,8 +137,6 @@ public String getContentDisposition() { } /** - * Gets the Content-Encoding header value when a client accesses the resource with this sas token. - * * @return The Content-Encoding header value when a client accesses the resource with this sas token. * @deprecated Please use {@link ShareServiceSasSignatureValues} */ @@ -149,8 +146,6 @@ public String getContentEncoding() { } /** - * Gets the Content-Language header value when a client accesses the resource with this sas token. - * * @return The Content-Language header value when a client accesses the resource with this sas token. * @deprecated Please use {@link ShareServiceSasSignatureValues} */ @@ -160,8 +155,6 @@ public String getContentLanguage() { } /** - * Gets the Content-Type header value when a client accesses the resource with this sas token. - * * @return The Content-Type header value when a client accesses the resource with this sas token. * @deprecated Please use {@link ShareServiceSasSignatureValues} */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasSignatureValues.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasSignatureValues.java index 3272eb4fdcada..30d3be044cb13 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasSignatureValues.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/sas/ShareServiceSasSignatureValues.java @@ -39,17 +39,29 @@ public final class ShareServiceSasSignatureValues { .get(Constants.PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, ShareServiceVersion.getLatest().getVersion()); private SasProtocol protocol; + private OffsetDateTime startTime; + private OffsetDateTime expiryTime; + private String permissions; + private SasIpRange sasIpRange; + private String shareName; + private String filePath; + private String identifier; + private String cacheControl; + private String contentDisposition; + private String contentEncoding; + private String contentLanguage; + private String contentType; /** @@ -99,9 +111,6 @@ public ShareServiceSasSignatureValues(String identifier) { } /** - * Gets the version of the service this SAS will target. If not specified, it will default to the version targeted - * by the library. - * * @return the version of the service this SAS will target. If not specified, it will default to the version * targeted by the library. */ @@ -125,8 +134,6 @@ public ShareServiceSasSignatureValues setVersion(String version) { } /** - * Gets the {@link SasProtocol} which determines the protocols allowed by the SAS. - * * @return the {@link SasProtocol} which determines the protocols allowed by the SAS. */ public SasProtocol getProtocol() { @@ -145,8 +152,6 @@ public ShareServiceSasSignatureValues setProtocol(SasProtocol protocol) { } /** - * Gets when the SAS will take effect. - * * @return when the SAS will take effect. */ public OffsetDateTime getStartTime() { @@ -165,8 +170,6 @@ public ShareServiceSasSignatureValues setStartTime(OffsetDateTime startTime) { } /** - * Gets the time after which the SAS will no longer work. - * * @return the time after which the SAS will no longer work. */ public OffsetDateTime getExpiryTime() { @@ -185,10 +188,6 @@ public ShareServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime) { } /** - * - * Gets the permissions string allowed by the SAS. Please refer to either {@link ShareSasPermission} or {@link - * ShareFileSasPermission} depending on the resource being accessed for help determining the permissions allowed. - * * @return the permissions string allowed by the SAS. Please refer to either {@link ShareSasPermission} or {@link * ShareFileSasPermission} depending on the resource being accessed for help determining the permissions allowed. */ @@ -223,8 +222,6 @@ public ShareServiceSasSignatureValues setPermissions(ShareFileSasPermission perm } /** - * Gets the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. - * * @return the {@link SasIpRange} which determines the IP ranges that are allowed to use the SAS. */ public SasIpRange getSasIpRange() { @@ -297,10 +294,6 @@ public ShareServiceSasSignatureValues setFilePath(String filePath) { } /** - * Gets the name of the access policy on the share this SAS references if any. Please see - * - * Establishing a stored access policy for more information. - * * @return the name of the access policy on the share this SAS references if any. Please see * * Establishing a stored access policy for more information. @@ -323,8 +316,6 @@ public ShareServiceSasSignatureValues setIdentifier(String identifier) { } /** - * Gets the cache-control header for the SAS. - * * @return the cache-control header for the SAS. */ public String getCacheControl() { @@ -343,8 +334,6 @@ public ShareServiceSasSignatureValues setCacheControl(String cacheControl) { } /** - * Gets the content-disposition header for the SAS. - * * @return the content-disposition header for the SAS. */ public String getContentDisposition() { @@ -363,8 +352,6 @@ public ShareServiceSasSignatureValues setContentDisposition(String contentDispos } /** - * Gets the content-encoding header for the SAS. - * * @return the content-encoding header for the SAS. */ public String getContentEncoding() { @@ -383,8 +370,6 @@ public ShareServiceSasSignatureValues setContentEncoding(String contentEncoding) } /** - * Gets the content-language header for the SAS. - * * @return the content-language header for the SAS. */ public String getContentLanguage() { @@ -403,8 +388,6 @@ public ShareServiceSasSignatureValues setContentLanguage(String contentLanguage) } /** - * Gets the content-type header for the SAS. - * * @return the content-type header for the SAS. */ public String getContentType() { diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java index 7d7d799303608..383c28e82b634 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java @@ -86,12 +86,6 @@ public final class ShareLeaseClientBuilder { private boolean allowSourceTrailingDot; private boolean allowTrailingDot; - /** - * Creates a new instance of {@link ShareLeaseClientBuilder}. - */ - public ShareLeaseClientBuilder() { - } - /** * Creates a {@link ShareLeaseClient} based on the configurations set in the builder. * diff --git a/sdk/storage/azure-storage-file-share/src/samples/README.md b/sdk/storage/azure-storage-file-share/src/samples/README.md index b6a7685d818d6..f24d9e8325bb1 100644 --- a/sdk/storage/azure-storage-file-share/src/samples/README.md +++ b/sdk/storage/azure-storage-file-share/src/samples/README.md @@ -51,8 +51,8 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [samples_directory]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/DirectorySample.java [samples_file]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/FileSample.java [samples_async]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/AsyncSample.java -[storage_file_rest]: https://learn.microsoft.com/rest/api/storageservices/file-service-rest-api -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[storage_file_rest]: https://docs.microsoft.com/rest/api/storageservices/file-service-rest-api +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes [file_key_concept]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/README.md#key-concepts [samples]: java/samples/ [SDK_README_GETTING_STARTDED]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-file-share/README.md#getting-started diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/BuilderHelperTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/BuilderHelperTests.java index 149b21eb30f9a..2fd573ee252ba 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/BuilderHelperTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/BuilderHelperTests.java @@ -34,6 +34,8 @@ import reactor.test.StepVerifier; import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -54,17 +56,16 @@ public class BuilderHelperTests { private static final RetryOptions CORE_RETRY_OPTIONS = new RetryOptions(new FixedDelayOptions(1, Duration.ofSeconds(2))); - private static HttpRequest request(String url) { - return new HttpRequest(HttpMethod.HEAD, url) - .setHeaders(new HttpHeaders().set(HttpHeaderName.CONTENT_LENGTH, "0")) - .setBody(Flux.empty()); + private static HttpRequest request(String url) throws MalformedURLException { + return new HttpRequest(HttpMethod.HEAD, new URL(url), new HttpHeaders().set(HttpHeaderName.CONTENT_LENGTH, "0"), + Flux.empty()); } /** * Tests that a new date will be applied to every retry when using the default pipeline builder. */ @Test - public void freshDateAppliedOnRetry() { + public void freshDateAppliedOnRetry() throws MalformedURLException { HttpClient httpClient = new FreshDateTestClient(); HttpLogOptions httpLogOptions = BuilderHelper.getDefaultHttpLogOptions(); ClientOptions clientOptions = new ClientOptions(); @@ -83,7 +84,7 @@ public void freshDateAppliedOnRetry() { * Tests that a new date will be applied to every retry when using the service client builder's default pipeline. */ @Test - public void serviceClientFreshDateOnRetry() { + public void serviceClientFreshDateOnRetry() throws MalformedURLException { ShareServiceClient serviceClient = new ShareServiceClientBuilder().endpoint(ENDPOINT) .credential(CREDENTIALS) .httpClient(new FreshDateTestClient()) @@ -99,7 +100,7 @@ public void serviceClientFreshDateOnRetry() { * Tests that a new date will be applied to every retry when using the share client builder's default pipeline. */ @Test - public void shareClientFreshDateOnRetry() { + public void shareClientFreshDateOnRetry() throws MalformedURLException { ShareClient shareClient = new ShareClientBuilder().endpoint(ENDPOINT) .shareName("share") .credential(CREDENTIALS) @@ -116,7 +117,7 @@ public void shareClientFreshDateOnRetry() { * Tests that a new date will be applied to every retry when using the file client builder's default pipeline. */ @Test - void fileClientFreshDateOnRetry() { + void fileClientFreshDateOnRetry() throws MalformedURLException { ShareFileClientBuilder fileClientBuilder = new ShareFileClientBuilder().endpoint(ENDPOINT) .shareName("fileSystem") .resourcePath("path") @@ -140,7 +141,8 @@ void fileClientFreshDateOnRetry() { */ @ParameterizedTest @MethodSource("customApplicationIdInUAStringSupplier") - public void customApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) { + public void customApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) + throws MalformedURLException { HttpClient httpClient = new ApplicationIdUAStringTestClient(expectedUA); HttpLogOptions httpLogOptions = new HttpLogOptions().setApplicationId(logOptionsUA); ClientOptions clientOptions = new ClientOptions().setApplicationId(clientOptionsUA); @@ -161,7 +163,8 @@ public void customApplicationIdInUAString(String logOptionsUA, String clientOpti */ @ParameterizedTest @MethodSource("customApplicationIdInUAStringSupplier") - void serviceClientCustomApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) { + void serviceClientCustomApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) + throws MalformedURLException { ShareServiceClient serviceClient = new ShareServiceClientBuilder().endpoint(ENDPOINT) .credential(CREDENTIALS) .httpLogOptions(new HttpLogOptions().setApplicationId(logOptionsUA)) @@ -180,7 +183,8 @@ void serviceClientCustomApplicationIdInUAString(String logOptionsUA, String clie */ @ParameterizedTest @MethodSource("customApplicationIdInUAStringSupplier") - void shareClientCustomApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) { + void shareClientCustomApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) + throws MalformedURLException { ShareClient shareClient = new ShareClientBuilder().endpoint(ENDPOINT) .shareName("share") .credential(CREDENTIALS) @@ -200,7 +204,8 @@ void shareClientCustomApplicationIdInUAString(String logOptionsUA, String client */ @ParameterizedTest @MethodSource("customApplicationIdInUAStringSupplier") - void fileClientCustomApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) { + void fileClientCustomApplicationIdInUAString(String logOptionsUA, String clientOptionsUA, String expectedUA) + throws MalformedURLException { ShareFileClientBuilder fileClientBuilder = new ShareFileClientBuilder().endpoint(ENDPOINT) .shareName("fileSystem") .resourcePath("path") @@ -230,7 +235,7 @@ private static Stream customApplicationIdInUAStringSupplier() { * Tests that a custom headers will be honored when using the default pipeline builder. */ @Test - void customHeadersClientOptions() { + void customHeadersClientOptions() throws MalformedURLException { List

headers = new ArrayList<>(); headers.add(new Header("custom", "header")); headers.add(new Header("Authorization", "notthis")); @@ -250,7 +255,7 @@ void customHeadersClientOptions() { * Tests that custom headers will be honored when using the service client builder's default pipeline. */ @Test - void serviceClientCustomHeadersClientOptions() { + void serviceClientCustomHeadersClientOptions() throws MalformedURLException { List
headers = new ArrayList<>(); headers.add(new Header("custom", "header")); headers.add(new Header("Authorization", "notthis")); @@ -271,7 +276,7 @@ void serviceClientCustomHeadersClientOptions() { * Tests that custom headers will be honored when using the share client builder's default pipeline. */ @Test - void shareClientCustomHeadersClientOptions() { + void shareClientCustomHeadersClientOptions() throws MalformedURLException { List
headers = new ArrayList<>(); headers.add(new Header("custom", "header")); headers.add(new Header("Authorization", "notthis")); @@ -293,7 +298,7 @@ void shareClientCustomHeadersClientOptions() { * Tests that custom headers will be honored when using the blob client builder's default pipeline. */ @Test - void blobClientCustomHeadersClientOptions() { + void blobClientCustomHeadersClientOptions() throws MalformedURLException { List
headers = new ArrayList<>(); headers.add(new Header("custom", "header")); headers.add(new Header("Authorization", "notthis")); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java index f3cc49ec2ff7f..f7596a82c1b06 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java @@ -82,7 +82,8 @@ public void setup() { shareClient.create(); primaryDirectoryClient = directoryBuilderHelper(shareName, directoryPath).buildDirectoryClient(); testMetadata = Collections.singletonMap("testmetadata", "value"); - smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); + smbProperties + = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); } @Test @@ -281,7 +282,7 @@ public void createDirectoryPermissionAndKeyError(String filePermissionKey, Strin private static Stream permissionAndKeySupplier() { return Stream.of(Arguments.of("filePermissionKey", FILE_PERMISSION), - Arguments.of(null, FileShareTestHelper.getRandomString(9 * Constants.KB))); + Arguments.of(null, new String(FileShareTestHelper.getRandomBuffer(9 * Constants.KB)))); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2022-11-02") @@ -1644,7 +1645,7 @@ public void testPerCallPolicy() { .buildDirectoryClient(); Response response = directoryClient.getPropertiesWithResponse(null, null); - assertDoesNotThrow(() -> response.getHeaders().getValue(X_MS_VERSION).equals("2017-11-09")); + assertDoesNotThrow(() -> response.getHeaders().getValue("x-ms-version").equals("2017-11-09")); } @ParameterizedTest diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java index a8b2c05922d55..214cb5348a6f2 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java @@ -71,7 +71,8 @@ public void setup() { shareClient.create(); primaryDirectoryAsyncClient = directoryBuilderHelper(shareName, directoryPath).buildDirectoryAsyncClient(); testMetadata = Collections.singletonMap("testmetadata", "value"); - smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); + smbProperties + = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); } @Test @@ -410,8 +411,8 @@ public void setPropertiesError() { .verifyErrorSatisfies(it -> assertInstanceOf(IllegalArgumentException.class, it)); StepVerifier - .create( - primaryDirectoryAsyncClient.setProperties(null, FileShareTestHelper.getRandomString(9 * Constants.KB))) + .create(primaryDirectoryAsyncClient.setProperties(null, + new String(FileShareTestHelper.getRandomBuffer(9 * Constants.KB)))) .verifyErrorSatisfies(it -> assertInstanceOf(IllegalArgumentException.class, it)); } @@ -551,8 +552,8 @@ public void forceCloseHandleMin() { StepVerifier .create(primaryDirectoryAsyncClient.create().then(primaryDirectoryAsyncClient.forceCloseHandle("1"))) .assertNext(it -> { - assertEquals(0, it.getClosedHandles()); - assertEquals(0, it.getFailedHandles()); + assertEquals(it.getClosedHandles(), 0); + assertEquals(it.getFailedHandles(), 0); }) .verifyComplete(); } @@ -571,8 +572,8 @@ public void forceCloseAllHandlesMin() { StepVerifier .create(primaryDirectoryAsyncClient.create().then(primaryDirectoryAsyncClient.forceCloseAllHandles(false))) .assertNext(it -> { - assertEquals(0, it.getClosedHandles()); - assertEquals(0, it.getFailedHandles()); + assertEquals(it.getClosedHandles(), 0); + assertEquals(it.getFailedHandles(), 0); }) .verifyComplete(); } @@ -974,9 +975,9 @@ public void renameDirectoryFilePermissionFormat(FilePermissionFormat filePermiss return r.getValue().getProperties(); }); - StepVerifier.create(response) - .assertNext(r -> assertNotNull(r.getSmbProperties().getFilePermissionKey())) - .verifyComplete(); + StepVerifier.create(response).assertNext(r -> { + assertNotNull(r.getSmbProperties().getFilePermissionKey()); + }).verifyComplete(); } @Test diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java index 931442c3ac943..9bb254f8ba21e 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java @@ -125,7 +125,8 @@ public void setup() { primaryFileClient = fileBuilderHelper(shareName, filePath).buildFileClient(); testMetadata = Collections.singletonMap("testmetadata", "value"); httpHeaders = new ShareFileHttpHeaders().setContentLanguage("en").setContentType("application/octet-stream"); - smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); + smbProperties + = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); } @Test @@ -180,7 +181,7 @@ public void existsError() { primaryFileClient = fileBuilderHelper(shareName, filePath).sasToken("sig=dummyToken").buildFileClient(); ShareStorageException e = assertThrows(ShareStorageException.class, () -> primaryFileClient.exists()); - assertEquals(403, e.getResponse().getStatusCode()); + assertEquals(e.getResponse().getStatusCode(), 403); } @Test @@ -306,7 +307,7 @@ public void createFilePermissionAndKeyError(String filePermissionKey, String per private static Stream permissionAndKeySupplier() { return Stream.of(Arguments.of("filePermissionKey", FILE_PERMISSION), - Arguments.of(null, FileShareTestHelper.getRandomString(9 * Constants.KB))); + Arguments.of(null, new String(FileShareTestHelper.getRandomBuffer(9 * Constants.KB)))); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2022-11-02") @@ -788,12 +789,12 @@ public void uploadRange4TB() { @ParameterizedTest @ValueSource( - ints = { + longs = { 4 * Constants.MB, // max put range 5 * Constants.MB }) - public void uploadBufferedRangeGreaterThanMaxPutRange(int length) { + public void uploadBufferedRangeGreaterThanMaxPutRange(long length) { primaryFileClient.create(length); - ByteArrayInputStream data = new ByteArrayInputStream(getRandomByteArray(length)); + ByteArrayInputStream data = new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer((int) length)); assertDoesNotThrow(() -> primaryFileClient.upload(data, length, null)); } @@ -854,7 +855,8 @@ public void uploadRangeOAuth() { @MethodSource("bufferedUploadVariousPartitions") public void bufferedUploadVariousPartitions(Long length, Long uploadChunkLength) { primaryFileClient.create(length); - ByteArrayInputStream data = new ByteArrayInputStream(getRandomByteArray(Math.toIntExact(length))); + ByteArrayInputStream data + = new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(Math.toIntExact(length))); assertNotNull( primaryFileClient.upload(data, length, new ParallelTransferOptions().setBlockSizeLong(uploadChunkLength) .setMaxSingleUploadSizeLong(uploadChunkLength))); @@ -868,10 +870,10 @@ private static Stream bufferedUploadVariousPartitions() { @Test public void bufferedUploadErrorPartitionTooBig() { - int length = 20 * Constants.MB; + long length = 20 * Constants.MB; long uploadChunkLength = 20 * Constants.MB; primaryFileClient.create(length); - ByteArrayInputStream data = new ByteArrayInputStream(getRandomByteArray(length)); + ByteArrayInputStream data = new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer((int) length)); assertThrows(Exception.class, () -> primaryFileClient.upload(data, length, @@ -1047,9 +1049,11 @@ public void downloadDataError() { } @Test - public void uploadFileDoesNotExist() throws IOException { + public void uploadFileDoesNotExist() { File uploadFile = new File(testFolder.getPath() + "/fakefile.txt"); - Files.deleteIfExists(uploadFile.toPath()); + if (uploadFile.exists()) { + assert uploadFile.delete(); + } UncheckedIOException e = assertThrows(UncheckedIOException.class, () -> primaryFileClient.uploadFromFile(uploadFile.getPath())); assertInstanceOf(NoSuchFileException.class, e.getCause()); @@ -1078,7 +1082,7 @@ public void downloadFileBufferCopy(int fileSize) throws IOException { ShareFileClient fileClient = shareServiceClient.getShareClient(shareName).createFile(filePath, fileSize); - File file = getRandomFile(fileSize); + File file = FileShareTestHelper.getRandomFile(fileSize); fileClient.uploadFromFile(file.toPath().toString()); File outFile = new File(generatePathName() + ".txt"); if (outFile.exists()) { @@ -1086,7 +1090,7 @@ public void downloadFileBufferCopy(int fileSize) throws IOException { } fileClient.downloadToFile(outFile.toPath().toString()); - assertTrue(compareFiles(file, outFile, 0, fileSize)); + assertTrue(FileShareTestHelper.compareFiles(file, outFile, 0, fileSize)); //cleanup shareServiceClient.deleteShare(shareName); @@ -1142,9 +1146,9 @@ public void uploadRangePreserveFileLastWrittenOn() { for (FileLastWrittenMode mode : modes) { primaryFileClient.create(Constants.KB); ShareFileProperties initialProps = primaryFileClient.getProperties(); - primaryFileClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(new ByteArrayInputStream(getRandomByteArray(Constants.KB)), - Constants.KB).setLastWrittenMode(mode), + primaryFileClient.uploadRangeWithResponse(new ShareFileUploadRangeOptions( + new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(Constants.KB)), Constants.KB) + .setLastWrittenMode(mode), null, null); ShareFileProperties resultProps = primaryFileClient.getProperties(); @@ -1180,9 +1184,9 @@ public void uploadRangeFromURL(String pathSuffix) { .generateSasQueryParameters(credential) .encode(); - ShareFileClient client - = fileBuilderHelper(shareName, "destination" + pathSuffix).endpoint(primaryFileClient.getFileUrl()) - .buildFileClient(); + ShareFileClient client = fileBuilderHelper(shareName, "destination" + pathSuffix) + .endpoint(primaryFileClient.getFileUrl().toString()) + .buildFileClient(); client.create(1024); client.uploadRangeFromUrl(length, destinationOffset, sourceOffset, @@ -1190,7 +1194,7 @@ public void uploadRangeFromURL(String pathSuffix) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); client.download(stream); - String result = stream.toString(); + String result = new String(stream.toByteArray()); for (int i = 0; i < length; i++) { //the groovy test was not asserting this line properly. need to come back and investigate this test further. @@ -1254,7 +1258,7 @@ public void uploadRangeFromURLOAuth() { FileShareTestHelper.assertResponseStatusCode(uploadResponse, 201); assertTrue(downloadResponse.getStatusCode() == 200 || downloadResponse.getStatusCode() == 206); - assertEquals(1024, headers.getContentLength()); + assertEquals(headers.getContentLength(), 1024); assertNotNull(headers.getETag()); assertNotNull(headers.getLastModified()); @@ -1267,7 +1271,7 @@ public void uploadRangeFromURLOAuth() { assertNotNull(headers.getFileId()); //u - assertEquals(117, stream.toByteArray()[0]); + assertEquals(stream.toByteArray()[0], 117); } @@ -1280,7 +1284,8 @@ public void uploadRangeFromUrlPreserveFileLastWrittenOn() { ShareFileClient destinationClient = shareClient.getFileClient(generatePathName()); destinationClient.create(Constants.KB); ShareFileProperties initialProps = destinationClient.getProperties(); - primaryFileClient.uploadRange(new ByteArrayInputStream(getRandomByteArray(Constants.KB)), Constants.KB); + primaryFileClient.uploadRange(new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(Constants.KB)), + Constants.KB); StorageSharedKeyCredential credential = StorageSharedKeyCredential.fromConnectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()); @@ -1321,7 +1326,8 @@ public void uploadRangeFromUrlTrailingDot() { ShareFileClient destinationClient = directoryClient.getFileClient(generatePathName() + "."); destinationClient.create(Constants.KB); - sourceClient.uploadRange(new ByteArrayInputStream(getRandomByteArray(Constants.KB)), Constants.KB); + sourceClient.uploadRange(new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(Constants.KB)), + Constants.KB); ShareFileSasPermission permissions = new ShareFileSasPermission().setReadPermission(true) .setWritePermission(true) .setCreatePermission(true) @@ -1419,14 +1425,14 @@ public void startCopyTrailingDot() { ShareFileClient destClient = shareClient.getFileClient(generatePathName() + "."); destClient.create(1024); - byte[] data = getRandomByteArray(Constants.KB); + byte[] data = FileShareTestHelper.getRandomBuffer(Constants.KB); ByteArrayInputStream inputStream = new ByteArrayInputStream(data); sourceClient.uploadRange(inputStream, Constants.KB); SyncPoller poller = destClient.beginCopy(sourceClient.getFileUrl(), new ShareFileCopyOptions(), null); poller.waitForCompletion(); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, poller.poll().getStatus()); + assertEquals(poller.poll().getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2022-11-02") @@ -1492,7 +1498,7 @@ public void startCopyWithOptions(boolean setFilePermissionKey, boolean setFilePe SyncPoller poller = primaryFileClient.beginCopy(sourceURL, options, null); PollResponse pollResponse = poller.poll(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); } @Test @@ -1504,7 +1510,7 @@ public void startCopyWithOptionsIgnoreReadOnlyAndSetArchive() { SyncPoller poller = primaryFileClient.beginCopy(sourceURL, options, null); PollResponse pollResponse = poller.poll(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-06-08") @@ -1529,7 +1535,7 @@ public void startCopyWithOptionsFilePermission() { FileSmbProperties properties = primaryFileClient.getProperties().getSmbProperties(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); FileShareTestHelper.compareDatesWithPrecision(properties.getFileCreationTime(), smbProperties.getFileCreationTime()); FileShareTestHelper.compareDatesWithPrecision(properties.getFileLastWriteTime(), @@ -1554,7 +1560,7 @@ public void startCopyFilePermissionFormat(FilePermissionFormat filePermissionFor FileSmbProperties properties = primaryFileClient.getProperties().getSmbProperties(); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); assertNotNull(properties.getFilePermissionKey()); } @@ -1574,7 +1580,7 @@ public void startCopyWithOptionsChangeTime() { PollResponse pollResponse = poller.poll(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); FileShareTestHelper.compareDatesWithPrecision(smbProperties.getFileChangeTime(), primaryFileClient.getProperties().getSmbProperties().getFileChangeTime()); } @@ -1601,7 +1607,7 @@ public void startCopyWithOptionsCopySmbFilePropertiesPermissionKey() { FileSmbProperties properties = primaryFileClient.getProperties().getSmbProperties(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); FileShareTestHelper.compareDatesWithPrecision(properties.getFileCreationTime(), smbProperties.getFileCreationTime()); FileShareTestHelper.compareDatesWithPrecision(properties.getFileLastWriteTime(), @@ -1620,7 +1626,7 @@ public void startCopyWithOptionLease() { PollResponse pollResponse = poller.poll(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); } @Test @@ -1645,7 +1651,7 @@ public void startCopyWithOptionsMetadata() { PollResponse pollResponse = poller.poll(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-06-08") @@ -1674,7 +1680,7 @@ public void startCopyWithOptionsWithOriginalSmbProperties() { ShareFileProperties resultProperties = primaryFileClient.getProperties(); assertNotNull(pollResponse.getValue().getCopyId()); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollResponse.getStatus()); + assertEquals(pollResponse.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); FileShareTestHelper.compareDatesWithPrecision(creationTime, resultProperties.getSmbProperties().getFileCreationTime()); FileShareTestHelper.compareDatesWithPrecision(lastWrittenTime, @@ -2105,10 +2111,10 @@ public void setHttpHeadersOAuth() { FileShareTestHelper.assertResponseStatusCode(res, 200); assertNotNull(res.getValue().getETag()); assertEquals(res.getValue().getETag(), res.getHeaders().getValue(HttpHeaderName.ETAG)); - assertEquals("application/octet-stream", properties.getContentType()); - assertEquals("attachment", properties.getContentDisposition()); - assertEquals("no-transform", properties.getCacheControl()); - assertEquals("gzip", properties.getContentEncoding()); + assertEquals(properties.getContentType(), "application/octet-stream"); + assertEquals(properties.getContentDisposition(), "attachment"); + assertEquals(properties.getCacheControl(), "no-transform"); + assertEquals(properties.getContentEncoding(), "gzip"); assertNull(properties.getContentMd5()); } @@ -2298,14 +2304,15 @@ public void listRangesOAuth() throws IOException { public void listRangesDiff(List rangesToUpdate, List rangesToClear, List expectedRanges, List expectedClearRanges) { primaryFileClient.create(4 * Constants.MB); - primaryFileClient.uploadRange(new ByteArrayInputStream(getRandomByteArray(4 * Constants.MB)), 4 * Constants.MB); + primaryFileClient.uploadRange(new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(4 * Constants.MB)), + 4 * Constants.MB); String snapshotId = primaryFileServiceClient.getShareClient(primaryFileClient.getShareName()).createSnapshot().getSnapshot(); rangesToUpdate.forEach(it -> { long size = it.getEnd() - it.getStart() + 1; - primaryFileClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(new ByteArrayInputStream(getRandomByteArray((int) size)), size) + primaryFileClient.uploadRangeWithResponse(new ShareFileUploadRangeOptions( + new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer((int) size)), size) .setOffset(it.getStart()), null, null); }); @@ -2344,7 +2351,8 @@ public void listRangesDiffOAuth() { dirClient.create(); ShareFileClient fileClient = dirClient.getFileClient(generatePathName()); fileClient.create(Constants.KB); - fileClient.uploadRange(new ByteArrayInputStream(getRandomByteArray(Constants.KB)), Constants.KB); + fileClient.uploadRange(new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(Constants.KB)), + Constants.KB); String snapshotId = primaryFileServiceClient.getShareClient(fileClient.getShareName()).createSnapshot().getSnapshot(); @@ -2355,8 +2363,8 @@ public void listRangesDiffOAuth() { rangesToUpdate.forEach(it -> { long size = it.getEnd() - it.getStart() + 1; - fileClient.uploadWithResponse(new ByteArrayInputStream(getRandomByteArray((int) size)), size, it.getStart(), - null, null); + fileClient.uploadWithResponse(new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer((int) size)), + size, it.getStart(), null, null); }); rangesToClear.forEach(it -> { @@ -2441,7 +2449,7 @@ public void listRangesDiffWithRename(Boolean renameSupport) throws IOException { primaryFileClient.create(Constants.MB); //upload some content - ByteArrayInputStream content = new ByteArrayInputStream(getRandomByteArray(Constants.KB)); + ByteArrayInputStream content = new ByteArrayInputStream(FileShareTestHelper.getRandomBuffer(Constants.KB)); String uploadFile = FileShareTestHelper.createRandomFileWithLength(Constants.KB, testFolder, fileName); primaryFileClient.uploadFromFile(uploadFile); primaryFileClient.uploadRange(content, Constants.KB); @@ -2579,7 +2587,7 @@ public void listHandlesAccessRights() { ShareDirectoryClient directoryClient = shareClient.getDirectoryClient("mydirectory"); ShareFileClient fileClient = directoryClient.getFileClient("myfile"); List list = fileClient.listHandles().stream().collect(Collectors.toList()); - assertEquals(ShareFileHandleAccessRights.WRITE, list.get(0).getAccessRights().get(0)); + assertEquals(list.get(0).getAccessRights().get(0), ShareFileHandleAccessRights.WRITE); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2023-01-03") @@ -2909,7 +2917,7 @@ public void renameContentType() { ShareFileClient renamedClient = resp.getValue(); ShareFileProperties props = renamedClient.getProperties(); - assertEquals("mytype", props.getContentType()); + assertEquals(props.getContentType(), "mytype"); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-04-10") @@ -2978,7 +2986,7 @@ public void perCallPolicy() { .buildFileClient(); Response response = fileClient.getPropertiesWithResponse(null, null); - assertEquals("2017-11-09", response.getHeaders().getValue(X_MS_VERSION)); + assertEquals(response.getHeaders().getValue(X_MS_VERSION), "2017-11-09"); } @Test diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAsyncApiTests.java index e1a8025e184a9..427241fc2c4e8 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAsyncApiTests.java @@ -4,6 +4,7 @@ package com.azure.storage.file.share; import com.azure.core.exception.UnexpectedLengthException; +import com.azure.core.http.rest.Response; import com.azure.core.util.CoreUtils; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -18,6 +19,7 @@ import com.azure.storage.file.share.models.CopyableFileSmbPropertiesList; import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.FileRange; +import com.azure.storage.file.share.models.HandleItem; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.PermissionCopyModeType; import com.azure.storage.file.share.models.ShareAudience; @@ -29,7 +31,6 @@ import com.azure.storage.file.share.models.ShareFilePermission; import com.azure.storage.file.share.models.ShareFileProperties; import com.azure.storage.file.share.models.ShareFileRange; -import com.azure.storage.file.share.models.ShareFileUploadInfo; import com.azure.storage.file.share.models.ShareFileUploadRangeOptions; import com.azure.storage.file.share.models.ShareRequestConditions; import com.azure.storage.file.share.models.ShareSnapshotInfo; @@ -71,6 +72,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Scanner; import java.util.stream.Stream; @@ -80,9 +82,9 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -@SuppressWarnings("deprecation") public class FileAsyncApiTests extends FileShareTestBase { private ShareFileAsyncClient primaryFileAsyncClient; private ShareAsyncClient shareAsyncClient; @@ -103,7 +105,8 @@ public void setup() { primaryFileAsyncClient = fileBuilderHelper(shareName, filePath).buildFileAsyncClient(); testMetadata = Collections.singletonMap("testmetadata", "value"); httpHeaders = new ShareFileHttpHeaders().setContentLanguage("en").setContentType("application/octet-stream"); - smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); + smbProperties + = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); } @Test @@ -147,23 +150,26 @@ public void createFileFilePermissionFormat(FilePermissionFormat filePermissionFo @Test public void createFileWithArgsFpk() { - StepVerifier.create(shareAsyncClient.createPermission(FILE_PERMISSION).flatMap(filePermissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()) - .setFilePermissionKey(filePermissionKey); - return primaryFileAsyncClient.createWithResponse(1024, httpHeaders, smbProperties, null, testMetadata); - })).assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 201); - assertNotNull(it.getValue().getLastModified()); - assertNotNull(it.getValue().getSmbProperties()); - assertNotNull(it.getValue().getSmbProperties().getFilePermissionKey()); - assertNotNull(it.getValue().getSmbProperties().getNtfsFileAttributes()); - assertNotNull(it.getValue().getSmbProperties().getFileLastWriteTime()); - assertNotNull(it.getValue().getSmbProperties().getFileCreationTime()); - assertNotNull(it.getValue().getSmbProperties().getFileChangeTime()); - assertNotNull(it.getValue().getSmbProperties().getParentId()); - assertNotNull(it.getValue().getSmbProperties().getFileId()); - }).verifyComplete(); + String filePermissionKey = shareAsyncClient.createPermission(FILE_PERMISSION).block(); + smbProperties.setFileCreationTime(testResourceNamer.now()) + .setFileLastWriteTime(testResourceNamer.now()) + .setFilePermissionKey(filePermissionKey); + + StepVerifier + .create(primaryFileAsyncClient.createWithResponse(1024, httpHeaders, smbProperties, null, testMetadata)) + .assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 201); + assertNotNull(it.getValue().getLastModified()); + assertNotNull(it.getValue().getSmbProperties()); + assertNotNull(it.getValue().getSmbProperties().getFilePermissionKey()); + assertNotNull(it.getValue().getSmbProperties().getNtfsFileAttributes()); + assertNotNull(it.getValue().getSmbProperties().getFileLastWriteTime()); + assertNotNull(it.getValue().getSmbProperties().getFileCreationTime()); + assertNotNull(it.getValue().getSmbProperties().getFileChangeTime()); + assertNotNull(it.getValue().getSmbProperties().getParentId()); + assertNotNull(it.getValue().getSmbProperties().getFileId()); + }) + .verifyComplete(); } @Test @@ -197,25 +203,58 @@ public void createFileWithArgsError() { @Test public void createLease() { - StepVerifier - .create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.createWithResponse(DATA.getDefaultDataSizeLong() + 1, null, - null, null, null, new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + + StepVerifier.create(primaryFileAsyncClient.createWithResponse(DATA.getDefaultDataSizeLong() + 1, null, null, + null, null, new ShareRequestConditions().setLeaseId(leaseId))).expectNextCount(1); } @Test public void createLeaseFail() { + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); StepVerifier - .create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .then(primaryFileAsyncClient.createWithResponse(DATA.getDefaultDataSizeLong() + 1, null, null, null, - null, new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.createWithResponse(DATA.getDefaultDataSizeLong() + 1, null, null, null, null, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } + /* + * Tests downloading a file using a default clientThatdoesn't have a HttpClient passed to it. + */ + // @LiveOnly + // @ParameterizedTest + // @ValueSource(longs = { + // 0, // empty file + // 20, // small file + // 16 * 1024 * 1024, // medium file in several chunks + // 8 * 1026 * 1024 + 10, // medium file not aligned to block + // 50 * Constants.MB // large file requiring multiple requests + // }) + // public void downloadFileBufferCopy(long fileSize) throws IOException { + // ShareServiceAsyncClient shareServiceAsyncClient = new ShareServiceClientBuilder() + // .connectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()) + // .buildAsyncClient(); + // + // ShareFileAsyncClient fileClient = shareServiceAsyncClient.getShareAsyncClient(shareName) + // .createFile(filePath, fileSize).block(); + // + // File file = FileShareTestHelper.getRandomFile((int) fileSize); + // fileClient.uploadFromFile(file.toPath().toString()).block(); + // File outFile = new File(generatePathName() + ".txt"); + // if (outFile.exists()) { + // assertTrue(outFile.delete()); + // } + // fileClient.downloadToFile(outFile.toPath().toString()).block(); + // FileShareTestHelper.compareFiles(file, outFile, 0, fileSize); + // + // // cleanup + // shareServiceAsyncClient.deleteShare(shareName).block(); + // outFile.delete(); + // file.delete(); + // } + /* * Tests downloading a file using a default client that doesn't have a HttpClient passed to it. */ @@ -235,67 +274,62 @@ public void downloadFileBufferCopy(int fileSize) throws IOException { .buildAsyncClient(); ShareFileAsyncClient fileClient - = shareServiceAsyncClient.getShareAsyncClient(shareName).getFileClient(filePath); + = shareServiceAsyncClient.getShareAsyncClient(shareName).createFile(filePath, fileSize).block(); - File file = getRandomFile(fileSize); + File file = FileShareTestHelper.getRandomFile(fileSize); assertNotNull(fileClient); - + fileClient.uploadFromFile(file.toPath().toString()).block(); File outFile = new File(generatePathName() + ".txt"); if (outFile.exists()) { assertTrue(outFile.delete()); } - StepVerifier.create(fileClient.create(fileSize) - .then(fileClient.uploadFromFile(file.toPath().toString())) - .then(fileClient.downloadToFile(outFile.toPath().toString())) - .then(Mono.defer(() -> { - try { - assertTrue(compareFiles(file, outFile, 0, fileSize)); - } catch (IOException e) { - throw new RuntimeException(e); - } - return Mono.empty(); - })) - .then(shareServiceAsyncClient.deleteShare(shareName))).verifyComplete(); + fileClient.downloadToFile(outFile.toPath().toString()).block(); + assertTrue(FileShareTestHelper.compareFiles(file, outFile, 0, fileSize)); - file.delete(); + //cleanup + shareServiceAsyncClient.deleteShare(shareName).block(); outFile.delete(); + file.delete(); } @Test public void uploadAndDownloadData() { - StepVerifier.create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(primaryFileAsyncClient.uploadRangeWithResponse( + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + + StepVerifier + .create(primaryFileAsyncClient.uploadRangeWithResponse( new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()))) - .flatMap(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 201); - return primaryFileAsyncClient.downloadWithResponse(null); - }) - .flatMap(response -> { - assertTrue((response.getStatusCode() == 200) || (response.getStatusCode() == 206)); - ShareFileDownloadHeaders headers = response.getDeserializedHeaders(); - assertEquals(DATA.getDefaultDataSizeLong(), headers.getContentLength()); - assertNotNull(headers.getETag()); - assertNotNull(headers.getLastModified()); - assertNotNull(headers.getFilePermissionKey()); - assertNotNull(headers.getFileAttributes()); - assertNotNull(headers.getFileLastWriteTime()); - assertNotNull(headers.getFileCreationTime()); - assertNotNull(headers.getFileChangeTime()); - assertNotNull(headers.getFileParentId()); - assertNotNull(headers.getFileId()); - return FluxUtil.collectBytesInByteBufferStream(response.getValue()).flatMap(actualData -> { - assertArrayEquals(DATA.getDefaultBytes(), actualData); - return Mono.empty(); - }); - })).verifyComplete(); + .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) + .verifyComplete(); + + StepVerifier.create(primaryFileAsyncClient.downloadWithResponse(null)).assertNext(response -> { + assertTrue((response.getStatusCode() == 200) || (response.getStatusCode() == 206)); + ShareFileDownloadHeaders headers = response.getDeserializedHeaders(); + assertEquals(DATA.getDefaultDataSizeLong(), headers.getContentLength()); + assertNotNull(headers.getETag()); + assertNotNull(headers.getLastModified()); + assertNotNull(headers.getFilePermissionKey()); + assertNotNull(headers.getFileAttributes()); + assertNotNull(headers.getFileLastWriteTime()); + assertNotNull(headers.getFileCreationTime()); + assertNotNull(headers.getFileChangeTime()); + assertNotNull(headers.getFileParentId()); + assertNotNull(headers.getFileId()); + FluxUtil.collectBytesInByteBufferStream(response.getValue()).flatMap(actualData -> { + assertArrayEquals(DATA.getDefaultBytes(), actualData); + return Mono.empty(); + }); + }).verifyComplete(); } @Test public void uploadAndDownloadDataWithArgs() { - StepVerifier.create(primaryFileAsyncClient.create(1024) - .then(primaryFileAsyncClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()).setOffset(1L)))) + primaryFileAsyncClient.create(1024).block(); + + StepVerifier + .create(primaryFileAsyncClient.uploadRangeWithResponse( + new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()).setOffset(1L))) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); @@ -322,33 +356,34 @@ public void uploadDataError() { @Test public void uploadLease() { - StepVerifier - .create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()) - .setRequestConditions(new ShareRequestConditions().setLeaseId(leaseId))))) - .expectNextCount(1) - .verifyComplete(); + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + + StepVerifier.create(primaryFileAsyncClient.uploadRangeWithResponse( + new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()) + .setRequestConditions(new ShareRequestConditions().setLeaseId(leaseId)))) + .expectNextCount(1); } @Test public void uploadLeaseFail() { - StepVerifier.create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .then(primaryFileAsyncClient.uploadRangeWithResponse( + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + + StepVerifier + .create(primaryFileAsyncClient.uploadRangeWithResponse( new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()) - .setRequestConditions(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))))) + .setRequestConditions(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) .verifyError(ShareStorageException.class); } @ParameterizedTest @MethodSource("uploadDataLengthMismatchSupplier") public void uploadDataLengthMismatch(long size, String errMsg) { + primaryFileAsyncClient.create(1024).block(); StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(primaryFileAsyncClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), size).setOffset(0L)))) + .create(primaryFileAsyncClient + .uploadRangeWithResponse(new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), size).setOffset(0L))) .verifyErrorSatisfies(it -> { assertInstanceOf(UnexpectedLengthException.class, it); assertTrue(it.getMessage().contains(errMsg)); @@ -368,21 +403,21 @@ public void downloadDataError() { @Test public void downloadLease() { - StepVerifier.create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.downloadWithResponse(null, null, - new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier + .create(primaryFileAsyncClient.downloadWithResponse(null, null, + new ShareRequestConditions().setLeaseId(leaseId))) + .expectNextCount(1); } @Test public void downloadLeaseFail() { + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); StepVerifier - .create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .then(primaryFileAsyncClient.downloadWithResponse(null, null, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.downloadWithResponse(null, null, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @@ -390,18 +425,17 @@ public void downloadLeaseFail() { public void uploadAndClearRange() { String fullInfoString = "please clear the range"; ByteBuffer fullInfoData = ByteBuffer.wrap(fullInfoString.getBytes(StandardCharsets.UTF_8)); + primaryFileAsyncClient.create(fullInfoString.length()).block(); + primaryFileAsyncClient.upload(Flux.just(fullInfoData), fullInfoString.length()).block(); - Mono createAndUpload = primaryFileAsyncClient.create(fullInfoString.length()) - .then(primaryFileAsyncClient.upload(Flux.just(fullInfoData), fullInfoString.length())); - - StepVerifier.create(createAndUpload.then(primaryFileAsyncClient.clearRangeWithResponse(7, 0))) + StepVerifier.create(primaryFileAsyncClient.clearRangeWithResponse(7, 0)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); StepVerifier.create(primaryFileAsyncClient.downloadWithResponse(new ShareFileRange(0, 6L), false)) .assertNext(it -> FluxUtil.collectBytesInByteBufferStream(it.getValue()).flatMap(data -> { for (byte b : data) { - assertEquals(0, b); + assertEquals(b, 0); } return Mono.empty(); })) @@ -412,18 +446,20 @@ public void uploadAndClearRange() { public void uploadAndClearRangeWithArgs() { String fullInfoString = "please clear the range"; ByteBuffer fullInfoData = ByteBuffer.wrap(fullInfoString.getBytes(StandardCharsets.UTF_8)); + primaryFileAsyncClient.create(fullInfoString.length()).block(); + primaryFileAsyncClient.uploadRange(Flux.just(fullInfoData), fullInfoString.length()).block(); - StepVerifier.create(primaryFileAsyncClient.create(fullInfoString.length()) - .then(primaryFileAsyncClient.uploadRange(Flux.just(fullInfoData), fullInfoString.length())) - .then(primaryFileAsyncClient.clearRangeWithResponse(7, 1)) - .doOnNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) - .then(primaryFileAsyncClient.downloadWithResponse(new ShareFileRange(1, 7L), false)) - .flatMap(it -> FluxUtil.collectBytesInByteBufferStream(it.getValue()).flatMap(data -> { + StepVerifier.create(primaryFileAsyncClient.clearRangeWithResponse(7, 1)).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 201); + }).verifyComplete(); + StepVerifier.create(primaryFileAsyncClient.downloadWithResponse(new ShareFileRange(1, 7L), false)) + .assertNext(it -> FluxUtil.collectBytesInByteBufferStream(it.getValue()).flatMap(data -> { for (byte b : data) { - assertEquals(0, b); + assertEquals(b, 0); } return Mono.empty(); - }))).verifyComplete(); + })) + .verifyComplete(); // cleanup fullInfoData.clear(); @@ -433,11 +469,10 @@ public void uploadAndClearRangeWithArgs() { public void clearRangeError() { String fullInfoString = "please clear the range"; ByteBuffer fullInfoData = ByteBuffer.wrap(fullInfoString.getBytes(StandardCharsets.UTF_8)); + primaryFileAsyncClient.create(fullInfoString.length()).block(); + primaryFileAsyncClient.uploadRange(Flux.just(fullInfoData), fullInfoString.length()).block(); - StepVerifier - .create(primaryFileAsyncClient.create(fullInfoString.length()) - .then(primaryFileAsyncClient.uploadRange(Flux.just(fullInfoData), fullInfoString.length())) - .then(primaryFileAsyncClient.clearRange(30))) + StepVerifier.create(primaryFileAsyncClient.clearRange(30)) .verifyErrorSatisfies( it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 416, ShareErrorCode.INVALID_RANGE)); } @@ -446,11 +481,10 @@ public void clearRangeError() { public void clearRangeErrorArgs() { String fullInfoString = "please clear the range"; ByteBuffer fullInfoData = ByteBuffer.wrap(fullInfoString.getBytes(StandardCharsets.UTF_8)); + primaryFileAsyncClient.create(fullInfoString.length()).block(); + primaryFileAsyncClient.upload(Flux.just(fullInfoData), fullInfoString.length()).block(); - StepVerifier - .create(primaryFileAsyncClient.create(fullInfoString.length()) - .then(primaryFileAsyncClient.upload(Flux.just(fullInfoData), fullInfoString.length())) - .then(primaryFileAsyncClient.clearRangeWithResponse(7, 20))) + StepVerifier.create(primaryFileAsyncClient.clearRangeWithResponse(7, 20)) .verifyErrorSatisfies( it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 416, ShareErrorCode.INVALID_RANGE)); @@ -460,21 +494,22 @@ public void clearRangeErrorArgs() { @Test public void clearRangeLease() { - StepVerifier.create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.clearRangeWithResponse(1, 0, - new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier + .create( + primaryFileAsyncClient.clearRangeWithResponse(1, 0, new ShareRequestConditions().setLeaseId(leaseId))) + .expectNextCount(1); } @Test public void clearRangeLeaseFail() { + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier - .create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .then(primaryFileAsyncClient.clearRangeWithResponse(1, 0, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.clearRangeWithResponse(1, 0, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @@ -500,12 +535,12 @@ public void uploadAndDownloadFileExists() throws IOException { if (!downloadFile.exists()) { assertTrue(downloadFile.createNewFile()); } + primaryFileAsyncClient.create(data.length()).block(); + primaryFileAsyncClient + .uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes(StandardCharsets.UTF_8))), data.length()) + .block(); - StepVerifier - .create(primaryFileAsyncClient.create(data.length()) - .then(primaryFileAsyncClient - .uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes(StandardCharsets.UTF_8))), data.length())) - .then(primaryFileAsyncClient.downloadToFile(downloadFile.getPath()))) + StepVerifier.create(primaryFileAsyncClient.downloadToFile(downloadFile.getPath())) .verifyErrorSatisfies(it -> assertInstanceOf(FileAlreadyExistsException.class, it.getCause())); // cleanup @@ -521,14 +556,14 @@ public void uploadAndDownloadToFileDoesNotExist() throws FileNotFoundException { assertTrue(downloadFile.delete()); } - StepVerifier - .create(primaryFileAsyncClient.create(data.length()) - .then(primaryFileAsyncClient - .uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes(StandardCharsets.UTF_8))), data.length())) - .then(primaryFileAsyncClient.downloadToFile(downloadFile.getPath()))) + primaryFileAsyncClient.create(data.length()).block(); + primaryFileAsyncClient + .uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes(StandardCharsets.UTF_8))), data.length()) + .block(); + + StepVerifier.create(primaryFileAsyncClient.downloadToFile(downloadFile.getPath())) .assertNext(it -> assertEquals(it.getContentLength(), data.length())) .verifyComplete(); - Scanner scanner = new Scanner(downloadFile).useDelimiter("\\Z"); assertEquals(data, scanner.next()); scanner.close(); @@ -539,13 +574,13 @@ public void uploadAndDownloadToFileDoesNotExist() throws FileNotFoundException { @Test public void uploadFromFileLease() throws IOException { + primaryFileAsyncClient.create(1024).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); String fileName = generatePathName(); String uploadFile = FileShareTestHelper.createRandomFileWithLength(1024, testFolder, fileName); - StepVerifier.create(primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.uploadFromFile(uploadFile, - new ShareRequestConditions().setLeaseId(leaseId)))) + StepVerifier + .create(primaryFileAsyncClient.uploadFromFile(uploadFile, new ShareRequestConditions().setLeaseId(leaseId))) .verifyComplete(); // cleanup @@ -554,18 +589,15 @@ public void uploadFromFileLease() throws IOException { @Test public void uploadFromFileLeaseFail() throws IOException { + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); String fileName = generatePathName(); String uploadFile = FileShareTestHelper.createRandomFileWithLength(1024, testFolder, fileName); StepVerifier - .create(primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.uploadFromFile(uploadFile, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) - .verifyErrorSatisfies(r -> { - ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); - assertEquals("LeaseIdMismatchWithFileOperation", e.getErrorCode().getValue()); - }); + .create(primaryFileAsyncClient.uploadFromFile(uploadFile, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) + .verifyError(ShareStorageException.class); // cleanup FileShareTestHelper.deleteFileIfExists(testFolder.getPath(), fileName); @@ -573,18 +605,16 @@ public void uploadFromFileLeaseFail() throws IOException { @Test public void downloadToFileLease() { - Mono leaseIdMono = primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(primaryFileAsyncClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()))) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()); - + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + primaryFileAsyncClient + .uploadRangeWithResponse( + new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong())) + .block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); File downloadFile = new File(String.format("%s/%s.txt", testFolder.getPath(), prefix)); - StepVerifier.create(leaseIdMono - .flatMap(leaseId -> primaryFileAsyncClient.downloadToFileWithResponse(downloadFile.toPath().toString(), - null, new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + StepVerifier.create(primaryFileAsyncClient.downloadToFileWithResponse(downloadFile.toPath().toString(), null, + new ShareRequestConditions().setLeaseId(leaseId))).expectNextCount(1).verifyComplete(); // cleanup downloadFile.delete(); @@ -592,17 +622,17 @@ null, new ShareRequestConditions().setLeaseId(leaseId)))) @Test public void downloadToFileLeaseFail() { - Mono leaseIdMono = primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()) - .then(primaryFileAsyncClient.uploadRangeWithResponse( - new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong()))) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()); - + primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()).block(); + primaryFileAsyncClient + .uploadRangeWithResponse( + new ShareFileUploadRangeOptions(DATA.getDefaultFlux(), DATA.getDefaultDataSizeLong())) + .block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); File downloadFile = new File(String.format("%s/%s.txt", testFolder.getPath(), prefix)); StepVerifier - .create(leaseIdMono - .flatMap(leaseId -> primaryFileAsyncClient.downloadToFileWithResponse(downloadFile.toPath().toString(), - null, new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.downloadToFileWithResponse(downloadFile.toPath().toString(), null, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); // cleanup @@ -734,6 +764,21 @@ public void uploadRangeFromURL() { }).verifyComplete(); } + /*@RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") + @Test + public void uploadRangeFromURLSourceErrorAndStatusCode() { + ShareFileAsyncClient destinationClient = shareAsyncClient.getFileClient(generatePathName()); + + StepVerifier.create(primaryFileAsyncClient.create(1024).then(destinationClient.create(1024)) + .then(destinationClient.uploadRangeFromUrl(5, 0, 0, primaryFileAsyncClient.getFileUrl()))) + .verifyErrorSatisfies(r -> { + ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); + assertTrue(e.getStatusCode() == 401); + assertTrue(e.getServiceMessage().contains("NoAuthenticationInformation")); + assertTrue(e.getServiceMessage().contains("Server failed to authenticate the request. Please refer to the information in the www-authenticate header.")); + }); + }*/ + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-04-10") @Test public void uploadRangeFromURLOAuth() { @@ -741,15 +786,17 @@ public void uploadRangeFromURLOAuth() { new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); ShareDirectoryAsyncClient dirClient = oAuthServiceClient.getShareAsyncClient(shareName).getDirectoryClient(generatePathName()); - + dirClient.create().block(); String fileName = generatePathName(); ShareFileAsyncClient fileClient = dirClient.getFileClient(fileName); + fileClient.create(1024).block(); String data = "The quick brown fox jumps over the lazy dog"; int sourceOffset = 5; int length = 5; int destinationOffset = 0; + fileClient.uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length()).block(); StorageSharedKeyCredential credential = StorageSharedKeyCredential.fromConnectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()); String sasToken = new ShareServiceSasSignatureValues().setExpiryTime(testResourceNamer.now().plusDays(1)) @@ -761,49 +808,44 @@ public void uploadRangeFromURLOAuth() { String fileNameDest = generatePathName(); ShareFileAsyncClient fileClientDest = dirClient.getFileClient(fileNameDest); + fileClientDest.create(1024).block(); - StepVerifier.create(dirClient.create() - .then(fileClient.create(1024)) - .then(fileClient.uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length())) - .then(fileClientDest.create(1024)) - .then(fileClientDest.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, + StepVerifier + .create(fileClientDest.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, fileClient.getFileUrl() + "?" + sasToken)) - .flatMap(r -> { - assertEquals(201, r.getStatusCode()); - return fileClientDest.downloadWithResponse(null); - }) - .flatMap(r -> { - assertTrue(r.getStatusCode() == 200 || r.getStatusCode() == 206); - ShareFileDownloadHeaders headers = r.getDeserializedHeaders(); - - assertNotNull(headers.getETag()); - assertNotNull(headers.getLastModified()); - assertNotNull(headers.getFilePermissionKey()); - assertNotNull(headers.getFileAttributes()); - assertNotNull(headers.getFileLastWriteTime()); - assertNotNull(headers.getFileCreationTime()); - assertNotNull(headers.getFileChangeTime()); - assertNotNull(headers.getFileParentId()); - assertNotNull(headers.getFileId()); - - return FluxUtil.collectBytesInByteBufferStream(r.getValue()); - })).assertNext(bytes -> { - //u - assertEquals(bytes[0], 117); - }).verifyComplete(); + .assertNext(r -> assertEquals(r.getStatusCode(), 201)) + .verifyComplete(); + + StepVerifier.create(fileClientDest.downloadWithResponse(null).flatMap(r -> { + assertTrue(r.getStatusCode() == 200 || r.getStatusCode() == 206); + ShareFileDownloadHeaders headers = r.getDeserializedHeaders(); + + assertNotNull(headers.getETag()); + assertNotNull(headers.getLastModified()); + assertNotNull(headers.getFilePermissionKey()); + assertNotNull(headers.getFileAttributes()); + assertNotNull(headers.getFileLastWriteTime()); + assertNotNull(headers.getFileCreationTime()); + assertNotNull(headers.getFileChangeTime()); + assertNotNull(headers.getFileParentId()); + assertNotNull(headers.getFileId()); + + return FluxUtil.collectBytesInByteBufferStream(r.getValue()); + })).assertNext(bytes -> { + //u + assertEquals(bytes[0], 117); + }).verifyComplete(); } @Test public void uploadRangeFromURLLease() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String data = "The quick brown fox jumps over the lazy dog"; long sourceOffset = 5; int length = 5; long destinationOffset = 0; - Mono uploadRangeMono = createFileMono - .then(primaryFileAsyncClient.uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length())); - + primaryFileAsyncClient.uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length()).block(); StorageSharedKeyCredential credential = StorageSharedKeyCredential.fromConnectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()); String sasToken = new ShareServiceSasSignatureValues().setExpiryTime(testResourceNamer.now().plusDays(1)) @@ -817,28 +859,24 @@ public void uploadRangeFromURLLease() { = fileBuilderHelper(shareName, "destination").endpoint(primaryFileAsyncClient.getFileUrl()) .buildFileAsyncClient(); - Mono createDestinationFileMono = client.create(1024); - Mono leaseIdMono = createDestinationFileMono.then(createLeaseClient(client).acquireLease()); - - StepVerifier.create(uploadRangeMono.then(leaseIdMono) - .flatMap(leaseId -> client.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, - primaryFileAsyncClient.getFileUrl() + "?" + sasToken, - new ShareRequestConditions().setLeaseId(leaseId)))) + client.create(1024).block(); + String leaseId = createLeaseClient(client).acquireLease().block(); + StepVerifier + .create(client.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, + primaryFileAsyncClient.getFileUrl() + "?" + sasToken, new ShareRequestConditions().setLeaseId(leaseId))) .expectNextCount(1) .verifyComplete(); } @Test public void uploadRangeFromURLLeaseFail() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String data = "The quick brown fox jumps over the lazy dog"; long sourceOffset = 5; int length = 5; long destinationOffset = 0; - Mono uploadRangeMono = createFileMono - .then(primaryFileAsyncClient.uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length())); - + primaryFileAsyncClient.uploadRange(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length()).block(); StorageSharedKeyCredential credential = StorageSharedKeyCredential.fromConnectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()); String sasToken = new ShareServiceSasSignatureValues().setExpiryTime(testResourceNamer.now().plusDays(1)) @@ -852,24 +890,25 @@ public void uploadRangeFromURLLeaseFail() { = fileBuilderHelper(shareName, "destination").endpoint(primaryFileAsyncClient.getFileUrl()) .buildFileAsyncClient(); - Mono createDestinationFileMono = client.create(1024); - Mono leaseIdMono = createDestinationFileMono.then(createLeaseClient(client).acquireLease()); - + client.create(1024).block(); + createLeaseClient(client).acquireLease().block(); StepVerifier - .create(uploadRangeMono.then(leaseIdMono) - .then(client.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, - primaryFileAsyncClient.getFileUrl() + "?" + sasToken, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(client.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, + primaryFileAsyncClient.getFileUrl().toString() + "?" + sasToken, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void startCopy() { + primaryFileAsyncClient.create(1024).block(); + // TODO: Need another test account if using SAS token for authentication. + // TODO: SasToken auth cannot be used until the logging redaction String sourceURL = primaryFileAsyncClient.getFileUrl(); - StepVerifier - .create(primaryFileAsyncClient.create(1024) - .thenMany(setPlaybackPollerFluxPollInterval( - primaryFileAsyncClient.beginCopy(sourceURL, new ShareFileCopyOptions(), null)))) + + PollerFlux poller = setPlaybackPollerFluxPollInterval( + primaryFileAsyncClient.beginCopy(sourceURL, new ShareFileCopyOptions(), null)); + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); @@ -879,20 +918,20 @@ public void startCopy() { @MethodSource("com.azure.storage.file.share.FileShareTestHelper#startCopyArgumentsSupplier") public void startCopyWithArgs(boolean setFilePermissionKey, boolean setFilePermission, boolean ignoreReadOnly, boolean setArchiveAttribute, PermissionCopyModeType permissionType) { + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); + String filePermissionKey = shareAsyncClient.createPermission(FILE_PERMISSION).block(); + // We recreate file properties for each test since we need to store the times for the test with + // testResourceNamer.now() + smbProperties.setFileCreationTime(testResourceNamer.now()).setFileLastWriteTime(testResourceNamer.now()); + if (setFilePermissionKey) { + smbProperties.setFilePermissionKey(filePermissionKey); + } - StepVerifier.create(primaryFileAsyncClient.create(1024) - .then(shareAsyncClient.createPermission(FILE_PERMISSION)) - .flatMapMany(filePermissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()); - if (setFilePermissionKey) { - smbProperties.setFilePermissionKey(filePermissionKey); - } - return setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, smbProperties, - setFilePermission ? FILE_PERMISSION : null, permissionType, ignoreReadOnly, setArchiveAttribute, - null, null, null)); - })) + PollerFlux poller = setPlaybackPollerFluxPollInterval( + primaryFileAsyncClient.beginCopy(sourceURL, smbProperties, setFilePermission ? FILE_PERMISSION : null, + permissionType, ignoreReadOnly, setArchiveAttribute, null, null, null)); + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); @@ -915,6 +954,23 @@ public void startCopyError() { .verify(Duration.ofMinutes(1)); } + /*@RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") + @Test + public void startCopySourceErrorAndStatusCode() { + primaryFileAsyncClient.create(1024); + + PollerFlux poller = setPlaybackPollerFluxPollInterval( + primaryFileAsyncClient.beginCopy("https://error.file.core.windows.net/garbage", new ShareFileCopyOptions(), null)); + + StepVerifier.create(primaryFileAsyncClient.create(1024).thenMany(poller)) + .verifyErrorSatisfies(r -> { + ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); + assertTrue(e.getStatusCode() == 400); + assertTrue(e.getServiceMessage().contains("InvalidUri")); + assertTrue(e.getServiceMessage().contains("The requested URI does not represent any resource on the server.")); + }); + }*/ + @Disabled("There is a race condition in Poller where it misses the first observed event if there is a gap " + "between the time subscribed and the time we start observing events.") @Test @@ -928,10 +984,9 @@ public void startCopyLease() { PollerFlux poller = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, null, null, null, false, false, null, null, new ShareRequestConditions().setLeaseId(leaseId))); - StepVerifier.create(poller) - .assertNext(it -> assertNotNull(it.getValue().getCopyId())) - .expectComplete() - .verify(Duration.ofMinutes(1)); + StepVerifier.create(poller).assertNext(it -> { + assertNotNull(it.getValue().getCopyId()); + }).expectComplete().verify(Duration.ofMinutes(1)); } @Disabled("There is a race condition in Poller where it misses the first observed event if there is a gap " @@ -957,23 +1012,25 @@ public void startCopyLeaseFail() { @MethodSource("com.azure.storage.file.share.FileShareTestHelper#startCopyArgumentsSupplier") public void startCopyWithOptions(boolean setFilePermissionKey, boolean setFilePermission, boolean ignoreReadOnly, boolean setArchiveAttribute, PermissionCopyModeType permissionType) { + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); + String filePermissionKey = shareAsyncClient.createPermission(FILE_PERMISSION).block(); + // We recreate file properties for each test since we need to store the times for the test with + // testResourceNamer.now() + smbProperties.setFileCreationTime(testResourceNamer.now()).setFileLastWriteTime(testResourceNamer.now()); + if (setFilePermissionKey) { + smbProperties.setFilePermissionKey(filePermissionKey); + } + ShareFileCopyOptions options = new ShareFileCopyOptions().setSmbProperties(smbProperties) + .setFilePermission(setFilePermission ? FILE_PERMISSION : null) + .setIgnoreReadOnly(ignoreReadOnly) + .setArchiveAttribute(setArchiveAttribute) + .setPermissionCopyModeType(permissionType); - StepVerifier.create(primaryFileAsyncClient.create(1024) - .then(shareAsyncClient.createPermission(FILE_PERMISSION)) - .flatMapMany(filePermissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()); - if (setFilePermissionKey) { - smbProperties.setFilePermissionKey(filePermissionKey); - } - ShareFileCopyOptions options = new ShareFileCopyOptions().setSmbProperties(smbProperties) - .setFilePermission(setFilePermission ? FILE_PERMISSION : null) - .setIgnoreReadOnly(ignoreReadOnly) - .setArchiveAttribute(setArchiveAttribute) - .setPermissionCopyModeType(permissionType); - return setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); - })) + PollerFlux poller + = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); + + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); @@ -981,14 +1038,14 @@ public void startCopyWithOptions(boolean setFilePermissionKey, boolean setFilePe @Test public void startCopyWithOptionsIgnoreReadOnlyAndSetArchive() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); ShareFileCopyOptions options = new ShareFileCopyOptions().setIgnoreReadOnly(true).setArchiveAttribute(true); PollerFlux poller = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); - StepVerifier.create(createFileMono.thenMany(poller)) + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); @@ -997,10 +1054,12 @@ public void startCopyWithOptionsIgnoreReadOnlyAndSetArchive() { @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-06-08") @Test public void startCopyWithOptionsFilePermission() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); EnumSet ntfs = EnumSet.of(NtfsFileAttributes.READ_ONLY, NtfsFileAttributes.ARCHIVE); + // We recreate file properties for each test since we need to store the times for the test with + // testResourceNamer.now() smbProperties.setFileCreationTime(testResourceNamer.now()) .setFileLastWriteTime(testResourceNamer.now()) .setNtfsFileAttributes(ntfs); @@ -1012,19 +1071,19 @@ public void startCopyWithOptionsFilePermission() { PollerFlux poller = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); - StepVerifier.create(createFileMono.thenMany(poller)) + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); - StepVerifier.create(primaryFileAsyncClient.getProperties()).assertNext(properties -> { - FileSmbProperties smbProps = properties.getSmbProperties(); - FileShareTestHelper.compareDatesWithPrecision(smbProps.getFileCreationTime(), - smbProperties.getFileCreationTime()); - FileShareTestHelper.compareDatesWithPrecision(smbProps.getFileLastWriteTime(), - smbProperties.getFileLastWriteTime()); - assertEquals(smbProps.getNtfsFileAttributes(), smbProperties.getNtfsFileAttributes()); - }).verifyComplete(); + FileSmbProperties properties + = Objects.requireNonNull(primaryFileAsyncClient.getProperties().block()).getSmbProperties(); + + FileShareTestHelper.compareDatesWithPrecision(properties.getFileCreationTime(), + smbProperties.getFileCreationTime()); + FileShareTestHelper.compareDatesWithPrecision(properties.getFileLastWriteTime(), + smbProperties.getFileLastWriteTime()); + assertEquals(properties.getNtfsFileAttributes(), smbProperties.getNtfsFileAttributes()); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2025-01-05") @@ -1041,7 +1100,7 @@ public void startCopyFilePermissionFormat(FilePermissionFormat filePermissionFor Mono response = primaryFileAsyncClient.create(1024) .then(setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)).last()) .flatMap(r -> { - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, r.getStatus()); + assertEquals(r.getStatus(), LongRunningOperationStatus.SUCCESSFULLY_COMPLETED); return primaryFileAsyncClient.getProperties(); }); @@ -1053,104 +1112,104 @@ public void startCopyFilePermissionFormat(FilePermissionFormat filePermissionFor @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-06-08") @Test public void startCopyWithOptionsChangeTime() { + ShareFileInfo client = primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); + // We recreate file properties for each test since we need to store the times for the test with + // testResourceNamer.now() smbProperties.setFileChangeTime(testResourceNamer.now()); ShareFileCopyOptions options = new ShareFileCopyOptions().setSmbProperties(smbProperties) .setFilePermission(FILE_PERMISSION) .setPermissionCopyModeType(PermissionCopyModeType.OVERRIDE); - Mono createFileMono = primaryFileAsyncClient.create(1024); - Mono> pollerMono = createFileMono - .thenReturn(setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null))); - - StepVerifier.create(pollerMono.flatMapMany(poller -> poller.take(1))) + PollerFlux poller + = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); - StepVerifier.create(primaryFileAsyncClient.getProperties()) - .assertNext(properties -> FileShareTestHelper.compareDatesWithPrecision(smbProperties.getFileChangeTime(), - properties.getSmbProperties().getFileChangeTime())) - .verifyComplete(); + FileShareTestHelper.compareDatesWithPrecision(smbProperties.getFileChangeTime(), + Objects.requireNonNull(primaryFileAsyncClient.getProperties().block()) + .getSmbProperties() + .getFileChangeTime()); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-06-08") @Test public void startCopyWithOptionsCopySmbFilePropertiesPermissionKey() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); - Mono filePermissionKeyMono = shareAsyncClient.createPermission(FILE_PERMISSION); - - Mono optionsMono = filePermissionKeyMono.map(filePermissionKey -> { - EnumSet ntfs = EnumSet.of(NtfsFileAttributes.READ_ONLY, NtfsFileAttributes.ARCHIVE); - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()) - .setNtfsFileAttributes(ntfs) - .setFilePermissionKey(filePermissionKey); - return new ShareFileCopyOptions().setSmbProperties(smbProperties) - .setPermissionCopyModeType(PermissionCopyModeType.OVERRIDE); - }); + String filePermissionKey = shareAsyncClient.createPermission(FILE_PERMISSION).block(); + EnumSet ntfs = EnumSet.of(NtfsFileAttributes.READ_ONLY, NtfsFileAttributes.ARCHIVE); + // We recreate file properties for each test since we need to store the times for the test with + // testResourceNamer.now() + smbProperties.setFileCreationTime(testResourceNamer.now()) + .setFileLastWriteTime(testResourceNamer.now()) + .setNtfsFileAttributes(ntfs) + .setFilePermissionKey(filePermissionKey); - Mono> pollerMono = optionsMono.map( - options -> setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null))); + ShareFileCopyOptions options = new ShareFileCopyOptions().setSmbProperties(smbProperties) + .setPermissionCopyModeType(PermissionCopyModeType.OVERRIDE); - StepVerifier.create(createFileMono.thenMany(pollerMono.flatMapMany(poller -> poller.take(1)))) + PollerFlux poller + = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); - StepVerifier.create(primaryFileAsyncClient.getProperties()).assertNext(properties -> { - FileSmbProperties smbProps = properties.getSmbProperties(); - FileShareTestHelper.compareDatesWithPrecision(smbProps.getFileCreationTime(), - smbProperties.getFileCreationTime()); - FileShareTestHelper.compareDatesWithPrecision(smbProps.getFileLastWriteTime(), - smbProperties.getFileLastWriteTime()); - assertEquals(smbProps.getNtfsFileAttributes(), smbProperties.getNtfsFileAttributes()); - }).verifyComplete(); + FileSmbProperties properties + = Objects.requireNonNull(primaryFileAsyncClient.getProperties().block()).getSmbProperties(); + + FileShareTestHelper.compareDatesWithPrecision(properties.getFileCreationTime(), + smbProperties.getFileCreationTime()); + FileShareTestHelper.compareDatesWithPrecision(properties.getFileLastWriteTime(), + smbProperties.getFileLastWriteTime()); + assertEquals(properties.getNtfsFileAttributes(), smbProperties.getNtfsFileAttributes()); } @Test public void startCopyWithOptionsLease() { + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); - Mono leaseIdMono - = primaryFileAsyncClient.create(1024).then(createLeaseClient(primaryFileAsyncClient).acquireLease()); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + ShareRequestConditions conditions = new ShareRequestConditions().setLeaseId(leaseId); + + ShareFileCopyOptions options = new ShareFileCopyOptions().setDestinationRequestConditions(conditions); - StepVerifier.create(leaseIdMono.flatMapMany(leaseId -> { - ShareRequestConditions conditions = new ShareRequestConditions().setLeaseId(leaseId); - ShareFileCopyOptions options = new ShareFileCopyOptions().setDestinationRequestConditions(conditions); - return setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); - })).assertNext(it -> assertNotNull(it.getValue().getCopyId())).expectComplete().verify(Duration.ofMinutes(1)); + PollerFlux poller + = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); + StepVerifier.create(poller) + .assertNext(it -> assertNotNull(it.getValue().getCopyId())) + .expectComplete() + .verify(Duration.ofMinutes(1)); } @Test public void startCopyWithOptionsInvalidLease() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); String leaseId = testResourceNamer.randomUuid(); ShareRequestConditions conditions = new ShareRequestConditions().setLeaseId(leaseId); ShareFileCopyOptions options = new ShareFileCopyOptions().setDestinationRequestConditions(conditions); - StepVerifier - .create(createFileMono.thenMany( - setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)))) - .verifyErrorSatisfies(r -> { - ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); - assertEquals("LeaseNotPresentWithFileOperation", e.getErrorCode().getValue()); - }); + // exception: LeaseNotPresentWithFileOperation + assertThrows(ShareStorageException.class, + () -> setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)) + .blockFirst()); } @Test public void startCopyWithOptionsMetadata() { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); ShareFileCopyOptions options = new ShareFileCopyOptions().setMetadata(testMetadata); PollerFlux poller = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); - - StepVerifier.create(createFileMono.thenMany(poller)) + StepVerifier.create(poller) .assertNext(it -> assertNotNull(it.getValue().getCopyId())) .expectComplete() .verify(Duration.ofMinutes(1)); @@ -1159,50 +1218,46 @@ public void startCopyWithOptionsMetadata() { @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-06-08") @Test public void startCopyWithOptionsWithOriginalSmbProperties() { - Mono createFileMono = primaryFileAsyncClient.create(1024); - Mono initialPropertiesMono = createFileMono.then(primaryFileAsyncClient.getProperties()); - - StepVerifier.create(initialPropertiesMono.flatMap(initialProperties -> { - assertNotNull(initialProperties); - OffsetDateTime creationTime = initialProperties.getSmbProperties().getFileCreationTime(); - OffsetDateTime lastWrittenTime = initialProperties.getSmbProperties().getFileLastWriteTime(); - OffsetDateTime changedTime = initialProperties.getSmbProperties().getFileChangeTime(); - EnumSet fileAttributes = initialProperties.getSmbProperties().getNtfsFileAttributes(); - - String sourceURL = primaryFileAsyncClient.getFileUrl(); - return createLeaseClient(primaryFileAsyncClient).acquireLease().flatMap(leaseId -> { - ShareRequestConditions conditions = new ShareRequestConditions().setLeaseId(leaseId); - CopyableFileSmbPropertiesList list = new CopyableFileSmbPropertiesList().setCreatedOn(true) - .setLastWrittenOn(true) - .setChangedOn(true) - .setFileAttributes(true); - - ShareFileCopyOptions options = new ShareFileCopyOptions().setDestinationRequestConditions(conditions) - .setSmbPropertiesToCopy(list); - - PollerFlux poller - = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); - - return poller.take(1).single().flatMap(response -> { - assertNotNull(response.getValue().getCopyId()); - return primaryFileAsyncClient.getProperties().map(resultProperties -> { - FileSmbProperties smbProps = resultProperties.getSmbProperties(); - FileShareTestHelper.compareDatesWithPrecision(creationTime, smbProps.getFileCreationTime()); - FileShareTestHelper.compareDatesWithPrecision(lastWrittenTime, smbProps.getFileLastWriteTime()); - FileShareTestHelper.compareDatesWithPrecision(changedTime, smbProps.getFileChangeTime()); - assertEquals(fileAttributes, smbProps.getNtfsFileAttributes()); - return resultProperties; - }); - }); - }); - })).expectNextCount(1).verifyComplete(); + primaryFileAsyncClient.create(1024).block(); + ShareFileProperties initialProperties = primaryFileAsyncClient.getProperties().block(); + assertNotNull(initialProperties); + OffsetDateTime creationTime = initialProperties.getSmbProperties().getFileCreationTime(); + OffsetDateTime lastWrittenTime = initialProperties.getSmbProperties().getFileLastWriteTime(); + OffsetDateTime changedTime = initialProperties.getSmbProperties().getFileChangeTime(); + EnumSet fileAttributes = initialProperties.getSmbProperties().getNtfsFileAttributes(); + + String sourceURL = primaryFileAsyncClient.getFileUrl(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + ShareRequestConditions conditions = new ShareRequestConditions().setLeaseId(leaseId); + CopyableFileSmbPropertiesList list = new CopyableFileSmbPropertiesList().setCreatedOn(true) + .setLastWrittenOn(true) + .setChangedOn(true) + .setFileAttributes(true); + + ShareFileCopyOptions options + = new ShareFileCopyOptions().setDestinationRequestConditions(conditions).setSmbPropertiesToCopy(list); + + PollerFlux poller + = setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null)); + StepVerifier.create(poller) + .assertNext(it -> assertNotNull(it.getValue().getCopyId())) + .expectComplete() + .verify(Duration.ofMinutes(1)); + + FileSmbProperties resultProperties + = Objects.requireNonNull(primaryFileAsyncClient.getProperties().block()).getSmbProperties(); + + FileShareTestHelper.compareDatesWithPrecision(creationTime, resultProperties.getFileCreationTime()); + FileShareTestHelper.compareDatesWithPrecision(lastWrittenTime, resultProperties.getFileLastWriteTime()); + FileShareTestHelper.compareDatesWithPrecision(changedTime, resultProperties.getFileChangeTime()); + assertEquals(fileAttributes, resultProperties.getNtfsFileAttributes()); } @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#startCopyWithCopySourceFileErrorSupplier") public void startCopyWithOptionsCopySourceFileError(boolean createdOn, boolean lastWrittenOn, boolean changedOn, boolean fileAttributes) { - Mono createFileMono = primaryFileAsyncClient.create(1024); + primaryFileAsyncClient.create(1024).block(); String sourceURL = primaryFileAsyncClient.getFileUrl(); EnumSet ntfs = EnumSet.of(NtfsFileAttributes.READ_ONLY, NtfsFileAttributes.ARCHIVE); CopyableFileSmbPropertiesList list = new CopyableFileSmbPropertiesList().setCreatedOn(createdOn) @@ -1220,10 +1275,8 @@ public void startCopyWithOptionsCopySourceFileError(boolean createdOn, boolean l .setPermissionCopyModeType(PermissionCopyModeType.OVERRIDE) .setSmbPropertiesToCopy(list); - StepVerifier - .create(createFileMono.then(Mono.fromRunnable( - () -> setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null))))) - .verifyError(IllegalArgumentException.class); + assertThrows(IllegalArgumentException.class, + () -> setPlaybackPollerFluxPollInterval(primaryFileAsyncClient.beginCopy(sourceURL, options, null))); } @Disabled("TODO: Need to find a way of mocking pending copy status") @@ -1234,7 +1287,8 @@ public void abortCopy() { @Test public void deleteFile() { - StepVerifier.create(primaryFileAsyncClient.create(1024).then(primaryFileAsyncClient.deleteWithResponse())) + primaryFileAsyncClient.create(1024).block(); + StepVerifier.create(primaryFileAsyncClient.deleteWithResponse()) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); } @@ -1248,29 +1302,29 @@ public void deleteFileError() { @Test public void deleteFileLease() { - StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient - .deleteWithResponse(new ShareRequestConditions().setLeaseId(leaseId)))) + primaryFileAsyncClient.create(1024).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + + StepVerifier.create(primaryFileAsyncClient.deleteWithResponse(new ShareRequestConditions().setLeaseId(leaseId))) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); } @Test public void deleteFileLeaseFail() { + primaryFileAsyncClient.create(1024).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient - .deleteWithResponse(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient + .deleteWithResponse(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void deleteIfExistsFile() { - StepVerifier - .create(primaryFileAsyncClient.create(1024).then(primaryFileAsyncClient.deleteIfExistsWithResponse(null))) + primaryFileAsyncClient.create(1024).block(); + StepVerifier.create(primaryFileAsyncClient.deleteIfExistsWithResponse(null)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); } @@ -1278,86 +1332,79 @@ public void deleteIfExistsFile() { @Test public void deleteFileThatDoesNotExist() { ShareFileAsyncClient client = primaryFileAsyncClient.getFileAsyncClient(generateShareName()); - StepVerifier.create(client.deleteIfExistsWithResponse(null, null)).assertNext(response -> { - assertNotNull(response); - assertFalse(response.getValue()); - assertEquals(404, response.getStatusCode()); - }).verifyComplete(); - - StepVerifier.create(client.exists()).expectNext(Boolean.FALSE).verifyComplete(); + Response response = client.deleteIfExistsWithResponse(null, null).block(); + assertNotNull(response); + assertFalse(response.getValue()); + assertEquals(response.getStatusCode(), 404); + assertNotEquals(Boolean.TRUE, client.exists().block()); } @Test public void deleteIfExistsFileThatWasAlreadyDeleted() { - StepVerifier.create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null, null) - .then(primaryFileAsyncClient.deleteIfExists()) - .flatMap(deleted -> { - assertEquals(Boolean.TRUE, deleted); - return primaryFileAsyncClient.deleteIfExists(); - })).assertNext(deleted -> assertNotEquals(Boolean.TRUE, deleted)).verifyComplete(); + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null, null).block(); + assertEquals(Boolean.TRUE, primaryFileAsyncClient.deleteIfExists().block()); + assertNotEquals(Boolean.TRUE, primaryFileAsyncClient.deleteIfExists().block()); } @Test public void deleteIfExistsFileLease() { - Mono leaseIdMono - = primaryFileAsyncClient.create(1024).then(createLeaseClient(primaryFileAsyncClient).acquireLease()); + primaryFileAsyncClient.create(1024).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); StepVerifier - .create(leaseIdMono.flatMap(leaseId -> primaryFileAsyncClient - .deleteIfExistsWithResponse(new ShareRequestConditions().setLeaseId(leaseId)))) + .create(primaryFileAsyncClient.deleteIfExistsWithResponse(new ShareRequestConditions().setLeaseId(leaseId))) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); } @Test public void deleteIfExistsFileLeaseFail() { - Mono leaseIdMono - = primaryFileAsyncClient.create(1024).then(createLeaseClient(primaryFileAsyncClient).acquireLease()); + primaryFileAsyncClient.create(1024).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); StepVerifier - .create(leaseIdMono.flatMap(leaseId -> primaryFileAsyncClient - .deleteIfExistsWithResponse(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient + .deleteIfExistsWithResponse(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void getProperties() { - StepVerifier - .create(primaryFileAsyncClient.create(1024).then(primaryFileAsyncClient.getPropertiesWithResponse())) - .assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 200); - assertNotNull(it.getValue().getETag()); - assertNotNull(it.getValue().getLastModified()); - assertNotNull(it.getValue().getSmbProperties()); - assertNotNull(it.getValue().getSmbProperties().getFilePermissionKey()); - assertNotNull(it.getValue().getSmbProperties().getNtfsFileAttributes()); - assertNotNull(it.getValue().getSmbProperties().getFileLastWriteTime()); - assertNotNull(it.getValue().getSmbProperties().getFileCreationTime()); - assertNotNull(it.getValue().getSmbProperties().getFileChangeTime()); - assertNotNull(it.getValue().getSmbProperties().getParentId()); - assertNotNull(it.getValue().getSmbProperties().getFileId()); - }) - .verifyComplete(); + primaryFileAsyncClient.create(1024).block(); + StepVerifier.create(primaryFileAsyncClient.getPropertiesWithResponse()).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 200); + assertNotNull(it.getValue().getETag()); + assertNotNull(it.getValue().getLastModified()); + assertNotNull(it.getValue().getLastModified()); + assertNotNull(it.getValue().getSmbProperties()); + assertNotNull(it.getValue().getSmbProperties().getFilePermissionKey()); + assertNotNull(it.getValue().getSmbProperties().getNtfsFileAttributes()); + assertNotNull(it.getValue().getSmbProperties().getFileLastWriteTime()); + assertNotNull(it.getValue().getSmbProperties().getFileCreationTime()); + assertNotNull(it.getValue().getSmbProperties().getFileChangeTime()); + assertNotNull(it.getValue().getSmbProperties().getParentId()); + assertNotNull(it.getValue().getSmbProperties().getFileId()); + }).verifyComplete(); } @Test public void getPropertiesLease() { + primaryFileAsyncClient.create(1024).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient - .getPropertiesWithResponse(new ShareRequestConditions().setLeaseId(leaseId)))) + .create(primaryFileAsyncClient.getPropertiesWithResponse(new ShareRequestConditions().setLeaseId(leaseId))) .expectNextCount(1) .verifyComplete(); } @Test public void getPropertiesLeaseFail() { + primaryFileAsyncClient.create(1024).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .then(primaryFileAsyncClient.getPropertiesWithResponse( - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient + .getPropertiesWithResponse(new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @@ -1369,14 +1416,14 @@ public void getPropertiesError() { @Test public void setHttpHeadersFpk() { - StepVerifier.create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(shareAsyncClient.createPermission(FILE_PERMISSION)) - .flatMap(filePermissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()) - .setFilePermissionKey(filePermissionKey); - return primaryFileAsyncClient.setPropertiesWithResponse(512, httpHeaders, smbProperties, null); - })).assertNext(it -> { + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); + String filePermissionKey = shareAsyncClient.createPermission(FILE_PERMISSION).block(); + smbProperties.setFileCreationTime(testResourceNamer.now()) + .setFileLastWriteTime(testResourceNamer.now()) + .setFilePermissionKey(filePermissionKey); + + StepVerifier.create(primaryFileAsyncClient.setPropertiesWithResponse(512, httpHeaders, smbProperties, null)) + .assertNext(it -> { FileShareTestHelper.assertResponseStatusCode(it, 200); assertNotNull(it.getValue().getSmbProperties()); assertNotNull(it.getValue().getSmbProperties().getFilePermissionKey()); @@ -1386,17 +1433,17 @@ public void setHttpHeadersFpk() { assertNotNull(it.getValue().getSmbProperties().getFileChangeTime()); assertNotNull(it.getValue().getSmbProperties().getParentId()); assertNotNull(it.getValue().getSmbProperties().getFileId()); - }).verifyComplete(); + }) + .verifyComplete(); } @Test public void setHttpHeadersFp() { + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); smbProperties.setFileCreationTime(testResourceNamer.now()).setFileLastWriteTime(testResourceNamer.now()); + StepVerifier - .create( - primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(primaryFileAsyncClient.setPropertiesWithResponse(512, httpHeaders, smbProperties, - FILE_PERMISSION))) + .create(primaryFileAsyncClient.setPropertiesWithResponse(512, httpHeaders, smbProperties, FILE_PERMISSION)) .assertNext(it -> { FileShareTestHelper.assertResponseStatusCode(it, 200); assertNotNull(it.getValue().getSmbProperties()); @@ -1433,41 +1480,38 @@ public void setFileHttpHeadersFilePermissionFormat(FilePermissionFormat filePerm @Test public void setHttpHeadersLease() { - StepVerifier.create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.setPropertiesWithResponse(512, null, null, null, - new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + + StepVerifier.create(primaryFileAsyncClient.setPropertiesWithResponse(512, null, null, null, + new ShareRequestConditions().setLeaseId(leaseId))).expectNextCount(1).verifyComplete(); } @Test public void setHttpHeadersLeaseFail() { + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier - .create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.setPropertiesWithResponse(512, null, null, null, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.setPropertiesWithResponse(512, null, null, null, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void setHttpHeadersError() { - StepVerifier - .create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(primaryFileAsyncClient.setProperties(-1, null, null, null))) + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); + StepVerifier.create(primaryFileAsyncClient.setProperties(-1, null, null, null)) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.OUT_OF_RANGE_INPUT)); } @Test public void setMetadata() { - Mono createFileMono - = primaryFileAsyncClient.createWithResponse(1024, httpHeaders, null, null, testMetadata).then(); - + primaryFileAsyncClient.createWithResponse(1024, httpHeaders, null, null, testMetadata).block(); Map updatedMetadata = Collections.singletonMap("update", "value"); - StepVerifier.create(createFileMono.then(primaryFileAsyncClient.getProperties())) + StepVerifier.create(primaryFileAsyncClient.getProperties()) .assertNext(it -> assertEquals(testMetadata, it.getMetadata())) .verifyComplete(); @@ -1482,49 +1526,49 @@ public void setMetadata() { @Test public void setMetadataError() { - StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(primaryFileAsyncClient.setMetadataWithResponse(Collections.singletonMap("", "value")))) + primaryFileAsyncClient.create(1024).block(); + Map errorMetadata = Collections.singletonMap("", "value"); + StepVerifier.create(primaryFileAsyncClient.setMetadataWithResponse(errorMetadata)) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.EMPTY_METADATA_KEY)); } @Test public void setMetadataLease() { + primaryFileAsyncClient.create(1024).block(); + Map metadata = Collections.singletonMap("key", "value"); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier - .create(primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.setMetadataWithResponse( - Collections.singletonMap("key", "value"), new ShareRequestConditions().setLeaseId(leaseId)))) + .create(primaryFileAsyncClient.setMetadataWithResponse(metadata, + new ShareRequestConditions().setLeaseId(leaseId))) .expectNextCount(1) .verifyComplete(); } @Test public void setMetadataLeaseFail() { + primaryFileAsyncClient.create(1024).block(); + Map metadata = Collections.singletonMap("key", "value"); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); + StepVerifier - .create( - primaryFileAsyncClient.create(1024) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMap(leaseId -> primaryFileAsyncClient.setMetadataWithResponse( - Collections.singletonMap("key", "value"), - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.setMetadataWithResponse(metadata, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void listRanges() throws IOException { - Mono createFileMono = primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).then(); + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); String fileName = generatePathName(); String uploadFile = FileShareTestHelper.createRandomFileWithLength(1024, testFolder, fileName); - Mono uploadFileMono = primaryFileAsyncClient.uploadFromFile(uploadFile).then(); + primaryFileAsyncClient.uploadFromFile(uploadFile).block(); - StepVerifier.create(createFileMono.then(uploadFileMono).thenMany(primaryFileAsyncClient.listRanges())) - .assertNext(it -> { - assertEquals(0, it.getStart()); - assertEquals(1023, it.getEnd()); - }) - .verifyComplete(); + StepVerifier.create(primaryFileAsyncClient.listRanges()).assertNext(it -> { + assertEquals(0, it.getStart()); + assertEquals(1023, it.getEnd()); + }).verifyComplete(); // cleanup FileShareTestHelper.deleteFileIfExists(testFolder.getPath(), fileName); @@ -1532,16 +1576,15 @@ public void listRanges() throws IOException { @Test public void listRangesWithRange() throws IOException { - Mono createFileMono = primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).then(); + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); String fileName = generatePathName(); String uploadFile = FileShareTestHelper.createRandomFileWithLength(1024, testFolder, fileName); - Mono uploadFileMono = primaryFileAsyncClient.uploadFromFile(uploadFile).then(); + primaryFileAsyncClient.uploadFromFile(uploadFile).block(); - StepVerifier.create(createFileMono.then(uploadFileMono) - .thenMany(primaryFileAsyncClient.listRanges(new ShareFileRange(0, 511L)))).assertNext(it -> { - assertEquals(0, it.getStart()); - assertEquals(511, it.getEnd()); - }).verifyComplete(); + StepVerifier.create(primaryFileAsyncClient.listRanges(new ShareFileRange(0, 511L))).assertNext(it -> { + assertEquals(0, it.getStart()); + assertEquals(511, it.getEnd()); + }).verifyComplete(); // cleanup FileShareTestHelper.deleteFileIfExists(testFolder.getPath(), fileName); @@ -1549,14 +1592,13 @@ public void listRangesWithRange() throws IOException { @Test public void listRangesLease() throws IOException { + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); String fileName = generatePathName(); String uploadFile = FileShareTestHelper.createRandomFileWithLength(1024, testFolder, fileName); + primaryFileAsyncClient.uploadFromFile(uploadFile).block(); + String leaseId = createLeaseClient(primaryFileAsyncClient).acquireLease().block(); - StepVerifier.create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(primaryFileAsyncClient.uploadFromFile(uploadFile)) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .flatMapMany( - leaseId -> primaryFileAsyncClient.listRanges(null, new ShareRequestConditions().setLeaseId(leaseId)))) + StepVerifier.create(primaryFileAsyncClient.listRanges(null, new ShareRequestConditions().setLeaseId(leaseId))) .expectNextCount(1) .verifyComplete(); @@ -1566,15 +1608,15 @@ public void listRangesLease() throws IOException { @Test public void listRangesLeaseFail() throws IOException { + primaryFileAsyncClient.createWithResponse(1024, null, null, null, null).block(); String fileName = generatePathName(); String uploadFile = FileShareTestHelper.createRandomFileWithLength(1024, testFolder, fileName); + primaryFileAsyncClient.uploadFromFile(uploadFile).block(); + createLeaseClient(primaryFileAsyncClient).acquireLease().block(); StepVerifier - .create(primaryFileAsyncClient.createWithResponse(1024, null, null, null, null) - .then(primaryFileAsyncClient.uploadFromFile(uploadFile)) - .then(createLeaseClient(primaryFileAsyncClient).acquireLease()) - .thenMany(primaryFileAsyncClient.listRanges(null, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryFileAsyncClient.listRanges(null, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); // cleanup @@ -1586,41 +1628,43 @@ public void listRangesLeaseFail() throws IOException { @MethodSource("com.azure.storage.file.share.FileShareTestHelper#listRangesDiffSupplier") public void listRangesDiff(List rangesToUpdate, List rangesToClear, List expectedRanges, List expectedClearRanges) { - Mono snapshotIdMono = primaryFileAsyncClient.create(4 * Constants.MB) - .then(primaryFileAsyncClient.upload(Flux.just(getRandomByteBuffer(4 * Constants.MB)), 4 * Constants.MB)) + String snapshotId = primaryFileAsyncClient.create(4 * Constants.MB) + .then(primaryFileAsyncClient.upload(Flux.just(FileShareTestHelper.getRandomByteBuffer(4 * Constants.MB)), + 4 * Constants.MB)) .then(primaryFileServiceAsyncClient.getShareAsyncClient(primaryFileAsyncClient.getShareName()) .createSnapshot() - .map(ShareSnapshotInfo::getSnapshot)); + .map(ShareSnapshotInfo::getSnapshot)) + .block(); - Flux updateRangesFlux = Flux.fromIterable(rangesToUpdate).flatMap(it -> { + Flux.fromIterable(rangesToUpdate).flatMap(it -> { int size = (int) (it.getEnd() - it.getStart() + 1); - return primaryFileAsyncClient.uploadWithResponse(Flux.just(getRandomByteBuffer(size)), size, it.getStart()) - .then(); - }); - - Flux clearRangesFlux = Flux.fromIterable(rangesToClear) - .flatMap(it -> primaryFileAsyncClient.clearRangeWithResponse(it.getEnd() - it.getStart() + 1, it.getStart()) - .then()); - - StepVerifier.create(snapshotIdMono.flatMapMany(snapshotId -> updateRangesFlux.thenMany(clearRangesFlux) - .thenMany(primaryFileAsyncClient.listRangesDiff(snapshotId)))).assertNext(it -> { - assertEquals(it.getRanges().size(), expectedRanges.size()); - assertEquals(it.getClearRanges().size(), expectedClearRanges.size()); - - for (int i = 0; i < expectedRanges.size(); i++) { - FileRange actualRange = it.getRanges().get(i); - FileRange expectedRange = expectedRanges.get(i); - assertEquals(expectedRange.getStart(), actualRange.getStart()); - assertEquals(expectedRange.getEnd(), actualRange.getEnd()); - } + return primaryFileAsyncClient.uploadWithResponse(Flux.just(FileShareTestHelper.getRandomByteBuffer(size)), + size, it.getStart()); + }).blockLast(); + + Flux.fromIterable(rangesToClear) + .flatMap( + it -> primaryFileAsyncClient.clearRangeWithResponse(it.getEnd() - it.getStart() + 1, it.getStart())) + .blockLast(); + + StepVerifier.create(primaryFileAsyncClient.listRangesDiff(snapshotId)).assertNext(it -> { + assertEquals(it.getRanges().size(), expectedRanges.size()); + assertEquals(it.getClearRanges().size(), expectedClearRanges.size()); + + for (int i = 0; i < expectedRanges.size(); i++) { + FileRange actualRange = it.getRanges().get(i); + FileRange expectedRange = expectedRanges.get(i); + assertEquals(expectedRange.getStart(), actualRange.getStart()); + assertEquals(expectedRange.getEnd(), actualRange.getEnd()); + } - for (int i = 0; i < expectedClearRanges.size(); i++) { - ClearRange actualRange = it.getClearRanges().get(i); - ClearRange expectedRange = expectedClearRanges.get(i); - assertEquals(expectedRange.getStart(), actualRange.getStart()); - assertEquals(expectedRange.getEnd(), actualRange.getEnd()); - } - }).verifyComplete(); + for (int i = 0; i < expectedClearRanges.size(); i++) { + ClearRange actualRange = it.getClearRanges().get(i); + ClearRange expectedRange = expectedClearRanges.get(i); + assertEquals(expectedRange.getStart(), actualRange.getStart()); + assertEquals(expectedRange.getEnd(), actualRange.getEnd()); + } + }).verifyComplete(); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-05-04") @@ -1633,7 +1677,8 @@ public void listRangesDiffWithRename(Boolean renameSupport) throws IOException { ShareSnapshotInfo previousSnapshot = primaryFileAsyncClient.create(Constants.MB) .then(primaryFileAsyncClient .uploadFromFile(FileShareTestHelper.createRandomFileWithLength(Constants.KB, testFolder, fileName))) - .then(primaryFileAsyncClient.uploadRange(Flux.just(getRandomByteBuffer(Constants.KB)), Constants.KB)) + .then(primaryFileAsyncClient.uploadRange(Flux.just(FileShareTestHelper.getRandomByteBuffer(Constants.KB)), + Constants.KB)) .then(primaryFileServiceAsyncClient.getShareAsyncClient(primaryFileAsyncClient.getShareName()) .createSnapshot()) .block(); @@ -1673,43 +1718,42 @@ private static Stream listRangesDiffWithRenameSupplier() { @Test public void listHandles() { - StepVerifier.create(primaryFileAsyncClient.create(1024).thenMany(primaryFileAsyncClient.listHandles())) - .verifyComplete(); + primaryFileAsyncClient.create(1024).block(); + StepVerifier.create(primaryFileAsyncClient.listHandles()).verifyComplete(); } @Test public void listHandlesWithMaxResult() { - StepVerifier.create(primaryFileAsyncClient.create(1024).thenMany(primaryFileAsyncClient.listHandles(2))) - .verifyComplete(); + primaryFileAsyncClient.create(1024).block(); + StepVerifier.create(primaryFileAsyncClient.listHandles(2)).verifyComplete(); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2019-07-07") @Test public void forceCloseHandleMin() { - StepVerifier.create(primaryFileAsyncClient.create(512).then(primaryFileAsyncClient.forceCloseHandle("1"))) - .assertNext(it -> { - assertEquals(0, it.getClosedHandles()); - assertEquals(0, it.getFailedHandles()); - }) - .verifyComplete(); + primaryFileAsyncClient.create(512).block(); + StepVerifier.create(primaryFileAsyncClient.forceCloseHandle("1")).assertNext(it -> { + assertEquals(it.getClosedHandles(), 0); + assertEquals(it.getFailedHandles(), 0); + }).verifyComplete(); } @Test public void forceCloseHandleInvalidHandleID() { - StepVerifier - .create(primaryFileAsyncClient.create(512).then(primaryFileAsyncClient.forceCloseHandle("invalidHandleId"))) + primaryFileAsyncClient.create(512).block(); + StepVerifier.create(primaryFileAsyncClient.forceCloseHandle("invalidHandleId")) .verifyErrorSatisfies(it -> assertInstanceOf(ShareStorageException.class, it)); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2019-07-07") @Test public void forceCloseAllHandlesMin() { - StepVerifier.create(primaryFileAsyncClient.create(512).then(primaryFileAsyncClient.forceCloseAllHandles())) - .assertNext(it -> { - assertEquals(0, it.getClosedHandles()); - assertEquals(0, it.getFailedHandles()); - }) - .verifyComplete(); + primaryFileAsyncClient.create(512).block(); + + StepVerifier.create(primaryFileAsyncClient.forceCloseAllHandles()).assertNext(it -> { + assertEquals(it.getClosedHandles(), 0); + assertEquals(it.getFailedHandles(), 0); + }).verifyComplete(); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @@ -1727,9 +1771,9 @@ public void renameFilePermissionFormat(FilePermissionFormat filePermissionFormat return r.getValue().getProperties(); }); - StepVerifier.create(response) - .assertNext(r -> assertNotNull(r.getSmbProperties().getFilePermissionKey())) - .verifyComplete(); + StepVerifier.create(response).assertNext(r -> { + assertNotNull(r.getSmbProperties().getFilePermissionKey()); + }).verifyComplete(); } @Test @@ -1754,43 +1798,42 @@ public void getFilePath() { public void defaultAudience() { String fileName = generatePathName(); ShareFileAsyncClient fileClient = fileBuilderHelper(shareName, fileName).buildFileAsyncClient(); + fileClient.create(Constants.KB).block(); ShareServiceAsyncClient oAuthServiceClient = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP) .audience(null) /* should default to "https://storage.azure.com/" */); ShareFileAsyncClient aadFileClient = oAuthServiceClient.getShareAsyncClient(shareName).getFileClient(fileName); - StepVerifier.create(fileClient.create(Constants.KB).then(aadFileClient.exists())) - .expectNext(true) - .verifyComplete(); + StepVerifier.create(aadFileClient.exists()).expectNext(true).verifyComplete(); } @Test public void storageAccountAudience() { String fileName = generatePathName(); ShareFileAsyncClient fileClient = fileBuilderHelper(shareName, fileName).buildFileAsyncClient(); + fileClient.create(Constants.KB).block(); ShareServiceAsyncClient oAuthServiceClient = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP) .audience(ShareAudience.createShareServiceAccountAudience(shareAsyncClient.getAccountName()))); ShareFileAsyncClient aadFileClient = oAuthServiceClient.getShareAsyncClient(shareName).getFileClient(fileName); - StepVerifier.create(fileClient.create(Constants.KB).then(aadFileClient.exists())) - .expectNext(true) - .verifyComplete(); + StepVerifier.create(aadFileClient.exists()).expectNext(true).verifyComplete(); } @Test public void audienceError() { String fileName = generatePathName(); ShareFileAsyncClient fileClient = fileBuilderHelper(shareName, fileName).buildFileAsyncClient(); + fileClient.create(Constants.KB).block(); ShareServiceAsyncClient oAuthServiceClient = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP) .audience(ShareAudience.createShareServiceAccountAudience("badAudience"))); ShareFileAsyncClient aadFileClient = oAuthServiceClient.getShareAsyncClient(shareName).getFileClient(fileName); - StepVerifier.create(fileClient.create(Constants.KB).then(aadFileClient.exists())).verifyErrorSatisfies(r -> { + StepVerifier.create(aadFileClient.exists()).verifyErrorSatisfies(r -> { ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); assertEquals(ShareErrorCode.INVALID_AUTHENTICATION_INFO, e.getErrorCode()); }); @@ -1803,24 +1846,23 @@ public void audienceFromString() { String fileName = generatePathName(); ShareFileAsyncClient fileClient = fileBuilderHelper(shareName, fileName).buildFileAsyncClient(); + fileClient.create(Constants.KB).block(); ShareServiceAsyncClient oAuthServiceClient = getOAuthServiceAsyncClient( new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP).audience(audience)); ShareFileAsyncClient aadFileClient = oAuthServiceClient.getShareAsyncClient(shareName).getFileClient(fileName); - StepVerifier.create(fileClient.create(Constants.KB).then(aadFileClient.exists())) - .expectNext(true) - .verifyComplete(); + StepVerifier.create(aadFileClient.exists()).expectNext(true).verifyComplete(); } @PlaybackOnly @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-02-04") @Test public void listHandlesClientName() { - StepVerifier.create(primaryFileServiceAsyncClient.getShareAsyncClient("testing") - .getDirectoryClient("dir1") - .getFileClient("test.txt") - .listHandles() - .collectList()).assertNext(list -> assertNotNull(list.get(0).getClientName())).verifyComplete(); + ShareAsyncClient client = primaryFileServiceAsyncClient.getShareAsyncClient("testing"); + ShareDirectoryAsyncClient directoryClient = client.getDirectoryClient("dir1"); + ShareFileAsyncClient fileClient = directoryClient.getFileClient("test.txt"); + List list = fileClient.listHandles().collectList().block(); + assertNotNull(list.get(0).getClientName()); } } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileSasTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileSasTests.java index e862a6994ec3f..43185f7b84844 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileSasTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileSasTests.java @@ -145,7 +145,7 @@ public void fileSASNetworkTestDownloadUpload() { String data = "test"; primaryShareClient.create(); primaryFileClient.create(Constants.KB); - primaryFileClient.uploadRange(FileShareTestHelper.getInputStream(data.getBytes()), data.length()); + primaryFileClient.uploadRange(FileShareTestHelper.getInputStream(data.getBytes()), (long) data.length()); ShareFileSasPermission permissions = new ShareFileSasPermission().setReadPermission(true) .setWritePermission(true) diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java index d7cb6080086dc..fd7d057b6dd64 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java @@ -520,7 +520,7 @@ public void perCallPolicy() { ShareServiceClient serviceClient = getServiceClientBuilder(ENVIRONMENT.getPrimaryAccount().getCredential(), primaryFileServiceClient.getFileServiceUrl(), getPerCallVersionPolicy()).buildClient(); Response response = serviceClient.getPropertiesWithResponse(null, null); - assertEquals("2017-11-09", response.getHeaders().getValue(X_MS_VERSION)); + assertEquals(response.getHeaders().getValue(X_MS_VERSION), "2017-11-09"); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java index f26abaaefcb18..bc9e041300ca3 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java @@ -54,7 +54,7 @@ public class FileServiceAsyncApiTests extends FileShareTestBase { private static final Map TEST_METADATA = Collections.singletonMap("testmetadata", "value"); private static final String REALLY_LONG_STRING = "thisisareallylongstringthatexceedsthe64characterlimitallowedoncertainproperties"; - private static final List TOO_MANY_RULES = new ArrayList<>(); + private static final List TOO_MANY_RULES = new ArrayList(); private static final List INVALID_ALLOWED_HEADER = Collections.singletonList(new ShareCorsRule().setAllowedHeaders(REALLY_LONG_STRING)); private static final List INVALID_EXPOSED_HEADER diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestBase.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestBase.java index 4b812e4d8455b..7d2d3e308d3f0 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestBase.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestBase.java @@ -11,7 +11,6 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.models.CustomMatcher; @@ -29,20 +28,14 @@ import com.azure.storage.file.share.models.ListSharesOptions; import com.azure.storage.file.share.models.ShareItem; import com.azure.storage.file.share.models.ShareSnapshotsDeleteOptionType; -import com.azure.storage.file.share.models.ShareStorageException; import com.azure.storage.file.share.options.ShareAcquireLeaseOptions; import com.azure.storage.file.share.options.ShareBreakLeaseOptions; import com.azure.storage.file.share.options.ShareDeleteOptions; import com.azure.storage.file.share.specialized.ShareLeaseAsyncClient; import com.azure.storage.file.share.specialized.ShareLeaseClient; import com.azure.storage.file.share.specialized.ShareLeaseClientBuilder; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import java.io.File; -import java.io.IOException; import java.net.URL; -import java.nio.ByteBuffer; import java.time.Duration; import java.util.Arrays; import java.util.Collections; @@ -159,18 +152,6 @@ byte[] getRandomByteArray(int size) { return StorageCommonTestUtils.getRandomByteArray(size, testResourceNamer); } - ByteBuffer getRandomByteBuffer(int size) { - return StorageCommonTestUtils.getRandomData(size, testResourceNamer); - } - - java.io.File getRandomFile(int size) throws IOException { - return StorageCommonTestUtils.getRandomFile(size, testResourceNamer); - } - - boolean compareFiles(File file1, File file2, long offset, long count) throws IOException { - return StorageCommonTestUtils.compareFiles(file1, file2, offset, count); - } - protected ShareServiceClientBuilder getServiceClientBuilder(TestAccount account) { return getServiceClientBuilder(account.getCredential(), account.getFileEndpoint(), (HttpPipelinePolicy) null); } @@ -283,18 +264,6 @@ protected ShareFileClient getFileClient(final String shareName, final String fil return builder.buildFileClient(); } - protected ShareFileAsyncClient getFileAsyncClient(final String shareName, final String fileName, - Boolean allowTrailingDot, Boolean allowSourceTrailingDot) { - ShareFileClientBuilder builder = fileBuilderHelper(shareName, fileName); - if (allowTrailingDot != null) { - builder.allowTrailingDot(allowTrailingDot); - } - if (allowSourceTrailingDot != null) { - builder.allowSourceTrailingDot(allowSourceTrailingDot); - } - return builder.buildFileAsyncClient(); - } - protected ShareFileAsyncClient getFileAsyncClient(StorageSharedKeyCredential credential, String endpoint, HttpPipelinePolicy... policies) { ShareFileClientBuilder builder = getFileClientBuilder(endpoint, policies); @@ -337,14 +306,6 @@ protected static ShareLeaseClient createLeaseClient(ShareClient shareClient, Str return new ShareLeaseClientBuilder().shareClient(shareClient).leaseId(leaseId).buildClient(); } - protected static ShareLeaseAsyncClient createLeaseClient(ShareAsyncClient shareClient, String leaseId) { - return new ShareLeaseClientBuilder().shareAsyncClient(shareClient).leaseId(leaseId).buildAsyncClient(); - } - - protected static ShareLeaseAsyncClient createLeaseClient(ShareAsyncClient shareClient) { - return createLeaseClient(shareClient, null); - } - protected ShareServiceClient getOAuthServiceClient(ShareServiceClientBuilder builder) { if (builder == null) { builder = new ShareServiceClientBuilder(); @@ -441,15 +402,6 @@ protected String setupFileLeaseCondition(ShareFileClient fc, String leaseID) { } } - protected Mono setupFileLeaseCondition(ShareFileAsyncClient fc, String leaseID) { - if (Objects.equals(leaseID, RECEIVED_LEASE_ID) || Objects.equals(leaseID, GARBAGE_LEASE_ID)) { - return createLeaseClient(fc).acquireLease() - .map(responseLeaseId -> Objects.equals(leaseID, RECEIVED_LEASE_ID) ? responseLeaseId : leaseID); - } else { - return Mono.just(leaseID); - } - } - /** * Validates the presence of headers that are present on a large number of responses. These headers are generally * random and can really only be checked as not null. @@ -477,15 +429,6 @@ protected String setupShareLeaseCondition(ShareClient sc, String leaseID) { } } - protected Mono setupShareLeaseAsyncCondition(ShareAsyncClient sc, String leaseID) { - if (Objects.equals(leaseID, RECEIVED_LEASE_ID)) { - return createLeaseClient(sc).acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(-1)) - .map(response -> response.getValue()); - } else { - return Mono.just(leaseID); - } - } - @SuppressWarnings("unchecked") public static T retry(Supplier action, Predicate retryPredicate, int times, Duration delay) throws E, InterruptedException { @@ -504,16 +447,6 @@ public static T retry(Supplier action, Predicate return null; } - public Mono> retryAsync(Supplier>> action, - Predicate retryPredicate, int times, Duration delay) { - return Flux.range(1, times).flatMap(attempt -> action.get().onErrorResume(ShareStorageException.class, e -> { - if (retryPredicate.test(e)) { - return Mono.delay(delay).then(Mono.empty()); - } - return Mono.error(e); - })).next().switchIfEmpty(Mono.error(new RuntimeException("Retries exhausted"))); - } - protected String getAuthToken() { if (ENVIRONMENT.getTestMode() == TestMode.PLAYBACK) { // we just need some string to satisfy SDK for playback mode. Recording framework handles this fine. diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java index 37caf69d45bb2..f01bd9e9ffbd8 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java @@ -4,8 +4,10 @@ package com.azure.storage.file.share; import com.azure.core.http.rest.Response; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.implementation.Constants; +import com.azure.storage.common.test.shared.StorageCommonTestUtils; import com.azure.storage.file.share.models.ClearRange; import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.FileRange; @@ -23,6 +25,7 @@ import java.io.ByteArrayInputStream; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -45,14 +48,8 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf; public class FileShareTestHelper { - private static final ClientLogger LOGGER = new ClientLogger(FileShareTestHelper.class); - - static String getRandomString(int size) { - byte[] array = new byte[size]; - ThreadLocalRandom.current().nextBytes(array); - return new String(array); - } + private static final ClientLogger LOGGER = new ClientLogger(FileShareTestHelper.class); protected static void assertExceptionStatusCodeAndMessage(Throwable throwable, int expectedStatusCode, ShareErrorCode errMessage) { @@ -104,6 +101,44 @@ protected static InputStream getInputStream(byte[] data) { return new ByteArrayInputStream(data); } + protected static byte[] getRandomBuffer(int length) { + final byte[] buff = new byte[length]; + ThreadLocalRandom.current().nextBytes(buff); + return buff; + } + + protected static File getRandomFile(int size) throws IOException { + File file = File.createTempFile(CoreUtils.randomUuid().toString(), ".txt"); + file.deleteOnExit(); + FileOutputStream fos = new FileOutputStream(file); + + if (size > Constants.MB) { + int mbWrites = size / Constants.MB; + int remainder = size % Constants.MB; + + for (int i = 0; i < mbWrites; i++) { + fos.write(getRandomBuffer(Constants.MB)); + } + + if (remainder > 0) { + fos.write(getRandomBuffer(remainder)); + } + } else { + fos.write(getRandomBuffer(size)); + } + + fos.close(); + return file; + } + + protected static boolean compareFiles(File file1, File file2, long offset, long count) throws IOException { + return StorageCommonTestUtils.compareFiles(file1, file2, offset, count); + } + + protected static ByteBuffer getRandomByteBuffer(int length) { + return ByteBuffer.wrap(FileShareTestHelper.getRandomBuffer(length)); + } + protected static boolean assertMetricsAreEqual(ShareMetrics expected, ShareMetrics actual) { if (expected == null) { return actual == null; @@ -252,14 +287,7 @@ protected static String getPermissionFromFormat(FilePermissionFormat filePermiss // } protected static boolean isAllWhitespace(String input) { - int length = input.length(); - for (int i = 0; i < length; i++) { - if (!Character.isWhitespace(input.charAt(i))) { - return false; - } - } - - return true; + return input.matches("\\s*"); } /** diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java index b29c9b05f1176..727751a635094 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java @@ -58,7 +58,8 @@ void ntfsFromAttributes() { @Test void uploadZeroLengthFails() { - assertThrows(IllegalArgumentException.class, - () -> new ShareFileUploadRangeOptions(new ByteArrayInputStream(new byte[0]), 0)); + assertThrows(IllegalArgumentException.class, () -> { + new ShareFileUploadRangeOptions(new ByteArrayInputStream(new byte[0]), 0); + }); } } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java index 0effaa5e62f5e..91e7717b30aec 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java @@ -85,7 +85,8 @@ public void setup() { primaryFileServiceClient = fileServiceBuilderHelper().buildClient(); primaryShareClient = primaryFileServiceClient.getShareClient(shareName); testMetadata = Collections.singletonMap("testmetadata", "value"); - smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); + smbProperties + = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); } @Test @@ -255,8 +256,8 @@ public void createDirectoryAndFileTrailingDot(boolean allowTrailingDot) { } } - assertEquals(1, foundDirectories.size()); - assertEquals(1, foundFiles.size()); + assertEquals(foundDirectories.size(), 1); + assertEquals(foundFiles.size(), 1); if (allowTrailingDot) { assertEquals(foundDirectories.get(0), dirNameWithDot); assertEquals(foundFiles.get(0), fileNameWithDot); @@ -305,8 +306,8 @@ public void createIfNotExistsShareThatAlreadyExists() { Response initialResponse = client.createIfNotExistsWithResponse(new ShareCreateOptions(), null, null); Response secondResponse = client.createIfNotExistsWithResponse(new ShareCreateOptions(), null, null); - assertEquals(201, initialResponse.getStatusCode()); - assertEquals(409, secondResponse.getStatusCode()); + assertEquals(initialResponse.getStatusCode(), 201); + assertEquals(secondResponse.getStatusCode(), 409); //cleanup client.delete(); @@ -520,7 +521,7 @@ public void getProperties() { FileShareTestHelper.assertResponseStatusCode(getPropertiesResponse, 200); assertEquals(testMetadata, getPropertiesResponse.getValue().getMetadata()); - assertEquals(1, getPropertiesResponse.getValue().getQuota()); + assertEquals(getPropertiesResponse.getValue().getQuota(), 1); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @@ -535,7 +536,7 @@ public void getPropertiesOAuth() { FileShareTestHelper.assertResponseStatusCode(getPropertiesResponse, 200); assertEquals(testMetadata, getPropertiesResponse.getValue().getMetadata()); - assertEquals(1, getPropertiesResponse.getValue().getQuota()); + assertEquals(getPropertiesResponse.getValue().getQuota(), 1); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") @@ -620,7 +621,7 @@ public void setAccessPolicy() { List ids = Arrays.asList(identifier); primaryShareClient.setAccessPolicy(ids); - assertEquals("0000", primaryShareClient.getAccessPolicy().iterator().next().getId()); + assertEquals(primaryShareClient.getAccessPolicy().iterator().next().getId(), "0000"); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @@ -640,7 +641,7 @@ public void setAccessPolicyOAuth() { List ids = Arrays.asList(identifier); shareClient.setAccessPolicy(ids); - assertEquals("0000", shareClient.getAccessPolicy().iterator().next().getId()); + assertEquals(shareClient.getAccessPolicy().iterator().next().getId(), "0000"); } @Test @@ -779,9 +780,9 @@ public void setPropertiesQuota() { Response setQuotaResponse = primaryShareClient.setQuotaWithResponse(2, null, null); ShareProperties getQuotaAfterResponse = primaryShareClient.getProperties(); - assertEquals(1, getQuotaBeforeResponse.getQuota()); + assertEquals(getQuotaBeforeResponse.getQuota(), 1); FileShareTestHelper.assertResponseStatusCode(setQuotaResponse, 200); - assertEquals(2, getQuotaAfterResponse.getQuota()); + assertEquals(getQuotaAfterResponse.getQuota(), 2); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2019-12-12") @@ -802,7 +803,7 @@ public void setPropertiesAccessTier() { assertTrue(getAccessTierAfterResponse.getAccessTierChangeTime().isEqual(time) || getAccessTierAfterResponse.getAccessTierChangeTime().isAfter(time.minusSeconds(1))); assertTrue(getAccessTierAfterResponse.getAccessTierChangeTime().isBefore(time.plusMinutes(1))); - assertEquals("pending-from-hot", getAccessTierAfterResponse.getAccessTierTransitionState()); + assertEquals(getAccessTierAfterResponse.getAccessTierTransitionState(), "pending-from-hot"); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2019-12-12") @@ -1250,7 +1251,7 @@ public void createAndGetPermission() { primaryShareClient.create(); String permissionKey = primaryShareClient.createPermission(FILE_PERMISSION); String permission = primaryShareClient.getPermission(permissionKey); - assertEquals(FILE_PERMISSION, permission); + assertEquals(permission, FILE_PERMISSION); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-04-10") @@ -1262,7 +1263,7 @@ public void createAndGetPermissionOAuth() { ShareClient shareClient = oAuthServiceClient.getShareClient(shareName); String permissionKey = shareClient.createPermission(FILE_PERMISSION); String permission = shareClient.getPermission(permissionKey); - assertEquals(FILE_PERMISSION, permission); + assertEquals(permission, FILE_PERMISSION); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @@ -1307,7 +1308,7 @@ public void getSnapshot() { assertEquals(snapClient.getSnapshotId(), snapshotId); assertTrue(snapClient.getShareUrl().contains("sharesnapshot=")); - assertEquals(null, primaryShareClient.getSnapshotId()); + assertEquals(primaryShareClient.getSnapshotId(), null); } @Test @@ -1333,7 +1334,7 @@ public void perCallPolicy() { = shareBuilderHelper(primaryShareClient.getShareName()).addPolicy(getPerCallVersionPolicy()).buildClient(); Response response = shareClient.getPropertiesWithResponse(null, null); - assertEquals("2017-11-09", response.getHeaders().getValue(X_MS_VERSION)); + assertEquals(response.getHeaders().getValue(X_MS_VERSION), "2017-11-09"); } @Test diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java index bd94b5834a677..5c6cda667962b 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java @@ -26,7 +26,6 @@ import com.azure.storage.file.share.options.ShareCreateOptions; import com.azure.storage.file.share.options.ShareDirectoryCreateOptions; import com.azure.storage.file.share.options.ShareSetPropertiesOptions; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -43,6 +42,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -66,7 +66,8 @@ public void setup() { primaryFileServiceAsyncClient = fileServiceBuilderHelper().buildAsyncClient(); primaryShareAsyncClient = primaryFileServiceAsyncClient.getShareAsyncClient(shareName); testMetadata = Collections.singletonMap("testmetadata", "value"); - smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); + smbProperties + = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.NORMAL)); } @Test @@ -168,18 +169,17 @@ public void createShareAccessTierPremium() { @Test public void createSnapshot() { - StepVerifier - .create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.createSnapshotWithResponse(null))) - .assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 201); - String shareSnapshotName = generatePathName(); - ShareClient shareSnapshotClient = new ShareClientBuilder().shareName(shareSnapshotName) - .connectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()) - .snapshot(it.getValue().getSnapshot()) - .buildClient(); - assertEquals(it.getValue().getSnapshot(), shareSnapshotClient.getSnapshotId()); - }) - .verifyComplete(); + primaryShareAsyncClient.create().block(); + String shareSnapshotName = generatePathName(); + StepVerifier.create(primaryShareAsyncClient.createSnapshotWithResponse(null)).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 201); + ShareClient shareSnapshotClient = new ShareClientBuilder().shareName(shareSnapshotName) + .connectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()) + .snapshot(it.getValue().getSnapshot()) + .buildClient(); + assertEquals(it.getValue().getSnapshot(), shareSnapshotClient.getSnapshotId()); + }).verifyComplete(); + } @Test @@ -191,26 +191,22 @@ public void createSnapshotError() { @Test public void createSnapshotMetadata() { + primaryShareAsyncClient.create().block(); String shareSnapshotName = generatePathName(); - StepVerifier - .create( - primaryShareAsyncClient.create().then(primaryShareAsyncClient.createSnapshotWithResponse(testMetadata))) - .assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 201); - ShareClient shareSnapshotClient = new ShareClientBuilder().shareName(shareSnapshotName) - .connectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()) - .snapshot(it.getValue().getSnapshot()) - .buildClient(); - assertEquals(it.getValue().getSnapshot(), shareSnapshotClient.getSnapshotId()); - }) - .verifyComplete(); + StepVerifier.create(primaryShareAsyncClient.createSnapshotWithResponse(testMetadata)).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 201); + ShareClient shareSnapshotClient = new ShareClientBuilder().shareName(shareSnapshotName) + .connectionString(ENVIRONMENT.getPrimaryAccount().getConnectionString()) + .snapshot(it.getValue().getSnapshot()) + .buildClient(); + assertEquals(it.getValue().getSnapshot(), shareSnapshotClient.getSnapshotId()); + }).verifyComplete(); } @Test public void createSnapshotMetadataError() { - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createSnapshotWithResponse(Collections.singletonMap("", "value")))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.createSnapshotWithResponse(Collections.singletonMap("", "value"))) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.EMPTY_METADATA_KEY)); } @@ -225,18 +221,12 @@ public void createIfNotExistsShare() { @Test public void createIfNotExistsShareThatAlreadyExists() { ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(generateShareName()); - Mono> initialResponse = client.createIfNotExistsWithResponse(new ShareCreateOptions()); - Mono> secondResponse = client.createIfNotExistsWithResponse(new ShareCreateOptions()); - - StepVerifier.create(initialResponse).assertNext(response -> { - assertNotNull(response); - FileShareTestHelper.assertResponseStatusCode(response, 201); - }).verifyComplete(); - - StepVerifier.create(secondResponse).assertNext(response -> { - assertNotNull(response); - FileShareTestHelper.assertResponseStatusCode(response, 409); - }).verifyComplete(); + Response initialResponse = client.createIfNotExistsWithResponse(new ShareCreateOptions()).block(); + Response secondResponse = client.createIfNotExistsWithResponse(new ShareCreateOptions()).block(); + assertNotNull(initialResponse); + assertNotNull(secondResponse); + FileShareTestHelper.assertResponseStatusCode(initialResponse, 201); + FileShareTestHelper.assertResponseStatusCode(secondResponse, 409); //cleanup client.delete().block(); @@ -271,9 +261,9 @@ public void createIfNotExistsShareWithInvalidArgs(Map metadata, @Test public void deleteShare() { - StepVerifier.create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.deleteWithResponse())) - .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) - .verifyComplete(); + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.deleteWithResponse()) + .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @@ -296,35 +286,30 @@ public void deleteShareError() { @Test public void deleteIfExistsShare() { - StepVerifier - .create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.deleteIfExistsWithResponse(null))) - .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) - .verifyComplete(); + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.deleteIfExistsWithResponse(null)) + .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)); } @Test public void deleteIfExistsShareThatDoesNotExist() { ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(generateShareName()); + Response response = client.deleteIfExistsWithResponse(null, null).block(); - StepVerifier.create(client.deleteIfExistsWithResponse(null, null)).assertNext(response -> { - assertNotNull(response); - assertFalse(response.getValue()); - FileShareTestHelper.assertResponseStatusCode(response, 404); - }).verifyComplete(); - - StepVerifier.create(client.exists()) - .assertNext(exists -> assertNotEquals(Boolean.TRUE, exists)) - .verifyComplete(); + assertNotNull(response); + assertFalse(response.getValue()); + FileShareTestHelper.assertResponseStatusCode(response, 404); + assertNotEquals(Boolean.TRUE, client.exists().block()); } @Test public void getProperties() { - StepVerifier.create(primaryShareAsyncClient.createWithResponse(testMetadata, 1) - .then(primaryShareAsyncClient.getPropertiesWithResponse())).assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 200); - assertEquals(testMetadata, it.getValue().getMetadata()); - assertEquals(1, it.getValue().getQuota()); - }).verifyComplete(); + primaryShareAsyncClient.createWithResponse(testMetadata, 1).block(); + StepVerifier.create(primaryShareAsyncClient.getPropertiesWithResponse()).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 200); + assertEquals(testMetadata, it.getValue().getMetadata()); + assertEquals(it.getValue().getQuota(), 1); + }).verifyComplete(); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @@ -340,7 +325,7 @@ public void getPropertiesOAuth() { .assertNext(it -> { FileShareTestHelper.assertResponseStatusCode(it, 200); assertEquals(testMetadata, it.getValue().getMetadata()); - assertEquals(1, it.getValue().getQuota()); + assertEquals(it.getValue().getQuota(), 1); }) .verifyComplete(); } @@ -358,25 +343,30 @@ public void getPropertiesError() { public void getPropertiesPremium(String protocol, ShareRootSquash rootSquash) { ShareProtocols enabledProtocol = ModelHelper.parseShareProtocols(protocol); - String shareName = generateShareName(); - Mono premiumShareMono = premiumFileServiceAsyncClient.createShareWithResponse(shareName, - new ShareCreateOptions().setMetadata(testMetadata).setProtocols(enabledProtocol).setRootSquash(rootSquash), - null).map(Response::getValue); - - StepVerifier.create(premiumShareMono.flatMap(premiumShare -> premiumShare.getPropertiesWithResponse())) - .assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 200); - assertNotNull(it.getValue()); - assertEquals(testMetadata, it.getValue().getMetadata()); - assertNotNull(it.getValue().getProvisionedIops()); - assertNotNull(it.getValue().getProvisionedBandwidthMiBps()); - assertNotNull(it.getValue().getNextAllowedQuotaDowngradeTime()); - assertEquals(enabledProtocol.toString(), it.getValue().getProtocols().toString()); - assertEquals(rootSquash, it.getValue().getRootSquash()); - }) - .verifyComplete(); + ShareAsyncClient premiumShare + = Objects + .requireNonNull( + premiumFileServiceAsyncClient + .createShareWithResponse(generateShareName(), + new ShareCreateOptions().setMetadata(testMetadata) + .setProtocols(enabledProtocol) + .setRootSquash(rootSquash), + null) + .block()) + .getValue(); + StepVerifier.create(premiumShare.getPropertiesWithResponse()).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 200); + assertNotNull(it.getValue()); + assertEquals(testMetadata, it.getValue().getMetadata()); + assertNotNull(it.getValue().getProvisionedIops()); + assertNotNull(it.getValue().getProvisionedBandwidthMiBps()); + assertNotNull(it.getValue().getNextAllowedQuotaDowngradeTime()); + assertEquals(enabledProtocol.toString(), it.getValue().getProtocols().toString()); + assertEquals(rootSquash, it.getValue().getRootSquash()); + }).verifyComplete(); - premiumFileServiceAsyncClient.getShareAsyncClient(shareName).delete().block(); + //cleanup + premiumShare.delete().block(); } @PlaybackOnly @@ -386,21 +376,17 @@ public void setPremiumProperties() { = Arrays.asList(ShareRootSquash.ALL_SQUASH, ShareRootSquash.NO_ROOT_SQUASH, ShareRootSquash.ROOT_SQUASH); for (ShareRootSquash rootSquash : rootSquashes) { - String shareName = generateShareName(); - Mono premiumShareClientMono = premiumFileServiceAsyncClient - .createShareWithResponse(shareName, + ShareAsyncClient premiumShareClient = Objects.requireNonNull(premiumFileServiceAsyncClient + .createShareWithResponse(generateShareName(), new ShareCreateOptions().setProtocols(new ShareProtocols().setNfsEnabled(true)), null) - .map(Response::getValue); - - StepVerifier - .create(premiumShareClientMono.flatMap(premiumShareClient -> premiumShareClient - .setProperties(new ShareSetPropertiesOptions().setRootSquash(rootSquash)) - .then(premiumShareClient.getProperties()))) + .block()).getValue(); + premiumShareClient.setProperties(new ShareSetPropertiesOptions().setRootSquash(rootSquash)).block(); + StepVerifier.create(premiumShareClient.getProperties()) .assertNext(it -> assertEquals(rootSquash, it.getRootSquash())) .verifyComplete(); //cleanup - premiumFileServiceAsyncClient.getShareAsyncClient(shareName).delete().block(); + premiumShareClient.delete().block(); } } @@ -436,15 +422,15 @@ public void setPropertiesAccessTierPremium() { @Test public void setQuota() { - StepVerifier - .create(primaryShareAsyncClient.createWithResponse(null, 1).then(primaryShareAsyncClient.getProperties())) - .assertNext(it -> assertEquals(1, it.getQuota())) + primaryShareAsyncClient.createWithResponse(null, 1).block(); + StepVerifier.create(primaryShareAsyncClient.getProperties()) + .assertNext(it -> assertEquals(it.getQuota(), 1)) .verifyComplete(); StepVerifier.create(primaryShareAsyncClient.setQuotaWithResponse(2)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 200)) .verifyComplete(); StepVerifier.create(primaryShareAsyncClient.getProperties()) - .assertNext(it -> assertEquals(2, it.getQuota())) + .assertNext(it -> assertEquals(it.getQuota(), 2)) .verifyComplete(); } @@ -457,20 +443,14 @@ public void setQuotaError() { @Test public void setMetadata() { - StepVerifier.create(primaryShareAsyncClient.createWithResponse(testMetadata, null)) - .assertNext(response -> FileShareTestHelper.assertResponseStatusCode(response, 201)) - .verifyComplete(); - + primaryShareAsyncClient.createWithResponse(testMetadata, null).block(); Map metadataAfterSet = Collections.singletonMap("afterset", "value"); - StepVerifier.create(primaryShareAsyncClient.getProperties()) .assertNext(it -> assertEquals(testMetadata, it.getMetadata())) .verifyComplete(); - StepVerifier.create(primaryShareAsyncClient.setMetadataWithResponse(metadataAfterSet)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 200)) .verifyComplete(); - StepVerifier.create(primaryShareAsyncClient.getProperties()) .assertNext(it -> assertEquals(metadataAfterSet, it.getMetadata())) .verifyComplete(); @@ -506,13 +486,14 @@ public void setMetadataError() { @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#getStatisticsSupplier") public void getStatistics(long size, int gigabytes) { - StepVerifier.create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile("tempFile", size)) - .then(primaryShareAsyncClient.getStatisticsWithResponse())).assertNext(it -> { - FileShareTestHelper.assertResponseStatusCode(it, 200); - assertEquals(it.getValue().getShareUsageInBytes(), size); - assertEquals(it.getValue().getShareUsageInGB(), gigabytes); - }).verifyComplete(); + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile("tempFile", size).block(); + + StepVerifier.create(primaryShareAsyncClient.getStatisticsWithResponse()).assertNext(it -> { + FileShareTestHelper.assertResponseStatusCode(it, 200); + assertEquals(it.getValue().getShareUsageInBytes(), size); + assertEquals(it.getValue().getShareUsageInGB(), gigabytes); + }).verifyComplete(); } @Test @@ -524,72 +505,72 @@ public void getStatisticsError() { @Test public void createDirectory() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", null, null, null))) + .create(primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", null, null, null)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createDirectoryInvalidName() { - StepVerifier - .create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.createDirectory("test/directory"))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.createDirectory("test/directory")) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 404, ShareErrorCode.PARENT_NOT_FOUND)); } @Test public void createDirectoryMetadata() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", null, null, - testMetadata))) + .create( + primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", null, null, testMetadata)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createDirectoryFilePermission() { + primaryShareAsyncClient.create().block(); StepVerifier .create( - primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", null, - FILE_PERMISSION, null))) + primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", null, FILE_PERMISSION, null)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createDirectoryFilePermissionKey() { - Mono permissionKeyMono - = primaryShareAsyncClient.create().then(primaryShareAsyncClient.createPermission(FILE_PERMISSION)); - - StepVerifier.create(permissionKeyMono.flatMap(permissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()) - .setFilePermissionKey(permissionKey); - return primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", smbProperties, null, - null); - })).assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)).verifyComplete(); + primaryShareAsyncClient.create().block(); + String permissionKey = primaryShareAsyncClient.createPermission(FILE_PERMISSION).block(); + smbProperties.setFileCreationTime(testResourceNamer.now()) + .setFileLastWriteTime(testResourceNamer.now()) + .setFilePermissionKey(permissionKey); + StepVerifier + .create( + primaryShareAsyncClient.createDirectoryWithResponse("testCreateDirectory", smbProperties, null, null)) + .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) + .verifyComplete(); } @Test public void createDirectoryMetadataError() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryWithResponse("testdirectory", null, null, - Collections.singletonMap("", "value")))) + .create(primaryShareAsyncClient.createDirectoryWithResponse("testdirectory", null, null, + Collections.singletonMap("", "value"))) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.EMPTY_METADATA_KEY)); + } @Test public void createIfNotExistsDirectory() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", - new ShareDirectoryCreateOptions()))) + .create(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", + new ShareDirectoryCreateOptions())) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @@ -597,157 +578,147 @@ public void createIfNotExistsDirectory() { @Test public void createIfNotExistsDirectoryThatAlreadyExists() { ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(generateShareName()); + client.create().block(); + Response initialResponse + = client.createDirectoryIfNotExistsWithResponse("testCreateDirectory", new ShareDirectoryCreateOptions()) + .block(); + Response secondResponse + = client.createDirectoryIfNotExistsWithResponse("testCreateDirectory", new ShareDirectoryCreateOptions()) + .block(); + + assertNotNull(initialResponse); + FileShareTestHelper.assertResponseStatusCode(initialResponse, 201); + assertNotNull(secondResponse); + FileShareTestHelper.assertResponseStatusCode(secondResponse, 409); - Mono> initialResponseMono = client.create() - .then(client.createDirectoryIfNotExistsWithResponse("testCreateDirectory", - new ShareDirectoryCreateOptions())); - - Mono> secondResponseMono - = client.createDirectoryIfNotExistsWithResponse("testCreateDirectory", new ShareDirectoryCreateOptions()); - - StepVerifier.create(initialResponseMono).assertNext(initialResponse -> { - assertNotNull(initialResponse); - FileShareTestHelper.assertResponseStatusCode(initialResponse, 201); - }).verifyComplete(); - - StepVerifier.create(secondResponseMono).assertNext(secondResponse -> { - assertNotNull(secondResponse); - FileShareTestHelper.assertResponseStatusCode(secondResponse, 409); - }).verifyComplete(); - - // cleanup + //cleanup client.delete().block(); } @Test public void createIfNotExistsDirectoryInvalidName() { - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryIfNotExists("test/directory"))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.createDirectoryIfNotExists("test/directory")) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 404, ShareErrorCode.PARENT_NOT_FOUND)); } @Test public void createIfNotExistsDirectoryMetadata() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", - new ShareDirectoryCreateOptions().setMetadata(testMetadata)))) + .create(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", + new ShareDirectoryCreateOptions().setMetadata(testMetadata))) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createIfNotExistsDirectoryFilePermission() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", - new ShareDirectoryCreateOptions().setFilePermission(FILE_PERMISSION)))) + .create(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", + new ShareDirectoryCreateOptions().setFilePermission(FILE_PERMISSION))) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createIfNotExistsDirectoryFilePermissionKey() { - Mono permissionKeyMono - = primaryShareAsyncClient.create().then(primaryShareAsyncClient.createPermission(FILE_PERMISSION)); - - StepVerifier.create(permissionKeyMono.flatMap(permissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()) - .setFilePermissionKey(permissionKey); - return primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", - new ShareDirectoryCreateOptions().setSmbProperties(smbProperties)); - })).assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)).verifyComplete(); + primaryShareAsyncClient.create().block(); + String permissionKey = primaryShareAsyncClient.createPermission(FILE_PERMISSION).block(); + smbProperties.setFileCreationTime(testResourceNamer.now()) + .setFileLastWriteTime(testResourceNamer.now()) + .setFilePermissionKey(permissionKey); + StepVerifier + .create(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testCreateDirectory", + new ShareDirectoryCreateOptions().setSmbProperties(smbProperties))) + .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) + .verifyComplete(); } @Test public void createIfNotExistsDirectoryMetadataError() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testdirectory", - new ShareDirectoryCreateOptions().setMetadata(Collections.singletonMap("", "value"))))) + .create(primaryShareAsyncClient.createDirectoryIfNotExistsWithResponse("testdirectory", + new ShareDirectoryCreateOptions().setMetadata(Collections.singletonMap("", "value")))) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.EMPTY_METADATA_KEY)); } @Test public void createFile() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, null, null))) + .create(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, null, null)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createFileFilePermission() { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, - FILE_PERMISSION, null))) + .create(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, FILE_PERMISSION, + null)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createFileFilePermissionKey() { - Mono permissionKeyMono - = primaryShareAsyncClient.create().then(primaryShareAsyncClient.createPermission(FILE_PERMISSION)); - - StepVerifier.create(permissionKeyMono.flatMap(permissionKey -> { - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()) - .setFilePermissionKey(permissionKey); - return primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, smbProperties, null, - null); - })).assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)).verifyComplete(); + primaryShareAsyncClient.create().block(); + String permissionKey = primaryShareAsyncClient.createPermission(FILE_PERMISSION).block(); + smbProperties.setFileCreationTime(testResourceNamer.now()) + .setFileLastWriteTime(testResourceNamer.now()) + .setFilePermissionKey(permissionKey); + StepVerifier + .create( + primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, smbProperties, null, null)) + .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) + .verifyComplete(); } @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createFileInvalidArgsSupplier") public void createFileInvalidArgs(String fileName, long maxSize, int statusCode, ShareErrorCode errMsg) { - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFileWithResponse(fileName, maxSize, null, null, null, null))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.createFileWithResponse(fileName, maxSize, null, null, null, null)) .verifyErrorSatisfies( it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, statusCode, errMsg)); + } @Test public void createFileLease() { - StepVerifier - .create( - primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.getFileClient("testCreateFile").create(512)) - .then(createLeaseClient(primaryShareAsyncClient.getFileClient("testCreateFile")).acquireLease()) - .flatMap(leaseId -> primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, - null, null, null, new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.getFileClient("testCreateFile").create(512).block(); + String leaseId + = createLeaseClient(primaryShareAsyncClient.getFileClient("testCreateFile")).acquireLease().block(); + StepVerifier.create(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, null, + null, new ShareRequestConditions().setLeaseId(leaseId))).expectNextCount(1).verifyComplete(); } @Test public void createFileLeaseFail() { + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.getFileClient("testCreateFile").create(512).block(); + createLeaseClient(primaryShareAsyncClient.getFileClient("testCreateFile")).acquireLease().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.getFileClient("testCreateFile").create(512)) - .then(createLeaseClient(primaryShareAsyncClient.getFileClient("testCreateFile")).acquireLease()) - .then(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, null, null, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, null, null, null, null, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void createFileMaxOverload() { + primaryShareAsyncClient.create().block(); + ShareFileHttpHeaders httpHeaders = new ShareFileHttpHeaders().setContentType("txt"); + smbProperties.setFileCreationTime(testResourceNamer.now()).setFileLastWriteTime(testResourceNamer.now()); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, - new ShareFileHttpHeaders().setContentType("txt"), - smbProperties.setFileCreationTime(testResourceNamer.now()) - .setFileLastWriteTime(testResourceNamer.now()), - FILE_PERMISSION, testMetadata))) + .create(primaryShareAsyncClient.createFileWithResponse("testCreateFile", 1024, httpHeaders, smbProperties, + FILE_PERMISSION, testMetadata)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @@ -756,28 +727,27 @@ public void createFileMaxOverload() { @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createFileMaxOverloadInvalidArgsSupplier") public void createFileMaxOverloadInvalidArgs(String fileName, long maxSize, ShareFileHttpHeaders httpHeaders, Map metadata, ShareErrorCode errMsg) { + primaryShareAsyncClient.create().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFileWithResponse(fileName, maxSize, httpHeaders, null, null, - metadata))) + .create( + primaryShareAsyncClient.createFileWithResponse(fileName, maxSize, httpHeaders, null, null, metadata)) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, errMsg)); } @Test public void deleteDirectory() { String directoryName = "testCreateDirectory"; - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectory(directoryName)) - .then(primaryShareAsyncClient.deleteDirectoryWithResponse(directoryName))) + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createDirectory(directoryName).block(); + StepVerifier.create(primaryShareAsyncClient.deleteDirectoryWithResponse(directoryName)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); } @Test public void deleteDirectoryError() { - StepVerifier - .create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.deleteDirectory("testdirectory"))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.deleteDirectory("testdirectory")) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 404, ShareErrorCode.RESOURCE_NOT_FOUND)); } @@ -785,10 +755,9 @@ public void deleteDirectoryError() { @Test public void deleteIfExistsDirectory() { String directoryName = "testCreateDirectory"; - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createDirectory(directoryName)) - .then(primaryShareAsyncClient.deleteDirectoryIfExistsWithResponse(directoryName))) + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createDirectory(directoryName).block(); + StepVerifier.create(primaryShareAsyncClient.deleteDirectoryIfExistsWithResponse(directoryName)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); } @@ -796,36 +765,33 @@ public void deleteIfExistsDirectory() { @Test public void deleteIfExistsDirectoryThatDoesNotExist() { String directoryName = "testCreateDirectory"; - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.deleteDirectoryIfExistsWithResponse(directoryName))) - .assertNext(response -> { - assertNotNull(response); - assertFalse(response.getValue()); - FileShareTestHelper.assertResponseStatusCode(response, 404); - }) - .verifyComplete(); + primaryShareAsyncClient.create().block(); + Response response = primaryShareAsyncClient.deleteDirectoryIfExistsWithResponse(directoryName).block(); + assertNotNull(response); + assertFalse(response.getValue()); + FileShareTestHelper.assertResponseStatusCode(response, 404); } @Test public void deleteFile() { String fileName = "testCreateFile"; - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile(fileName, 1024)) - .then(primaryShareAsyncClient.deleteFileWithResponse(fileName))) + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile(fileName, 1024).block(); + StepVerifier.create(primaryShareAsyncClient.deleteFileWithResponse(fileName)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); + } @Test public void deleteFileLease() { String fileName = "testCreateFile"; - StepVerifier.create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile(fileName, 1024)) - .then(createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease()) - .flatMap(leaseId -> primaryShareAsyncClient.deleteFileWithResponse(fileName, - new ShareRequestConditions().setLeaseId(leaseId)))) + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile(fileName, 1024).block(); + String leaseId = createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease().block(); + StepVerifier + .create(primaryShareAsyncClient.deleteFileWithResponse(fileName, + new ShareRequestConditions().setLeaseId(leaseId))) .expectNextCount(1) .verifyComplete(); } @@ -833,18 +799,19 @@ public void deleteFileLease() { @Test public void deleteFileLeaseFail() { String fileName = "testCreateFile"; + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile(fileName, 1024).block(); + createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile(fileName, 1024)) - .then(createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease()) - .then(primaryShareAsyncClient.deleteFileWithResponse(fileName, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryShareAsyncClient.deleteFileWithResponse(fileName, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void deleteFileError() { - StepVerifier.create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.deleteFile("testdirectory"))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.deleteFile("testdirectory")) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 404, ShareErrorCode.RESOURCE_NOT_FOUND)); } @@ -852,65 +819,60 @@ public void deleteFileError() { @Test public void deleteIfExistsFile() { String fileName = "testCreateFile"; - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile(fileName, 1024)) - .then(primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, null))) + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile(fileName, 1024).block(); + StepVerifier.create(primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, null)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 202)) .verifyComplete(); + } @Test public void deleteIfExistsFileLease() { String fileName = "testCreateFile"; - StepVerifier.create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile(fileName, 1024)) - .then(createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease()) - .flatMap(leaseId -> primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, - new ShareRequestConditions().setLeaseId(leaseId)))) - .expectNextCount(1) - .verifyComplete(); + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile(fileName, 1024).block(); + String leaseId = createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease().block(); + StepVerifier.create(primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, + new ShareRequestConditions().setLeaseId(leaseId))).expectNextCount(1).verifyComplete(); } @Test public void deleteIfExistsFileThatDoesNotExist() { String fileName = "testCreateFile"; - StepVerifier.create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, null))).assertNext(response -> { - assertNotNull(response); - assertFalse(response.getValue()); - FileShareTestHelper.assertResponseStatusCode(response, 404); - }).verifyComplete(); + primaryShareAsyncClient.create().block(); + Response response = primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, null).block(); + assertNotNull(response); + assertFalse(response.getValue()); + FileShareTestHelper.assertResponseStatusCode(response, 404); } @Test public void deleteIfExistsFileLeaseFail() { String fileName = "testCreateFile"; + primaryShareAsyncClient.create().block(); + primaryShareAsyncClient.createFile(fileName, 1024).block(); + createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease().block(); StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createFile(fileName, 1024)) - .then(createLeaseClient(primaryShareAsyncClient.getFileClient(fileName)).acquireLease()) - .then(primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, - new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid())))) + .create(primaryShareAsyncClient.deleteFileIfExistsWithResponse(fileName, + new ShareRequestConditions().setLeaseId(testResourceNamer.randomUuid()))) .verifyError(ShareStorageException.class); } @Test public void createPermission() { - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createPermissionWithResponse(FILE_PERMISSION))) + primaryShareAsyncClient.create().block(); + StepVerifier.create(primaryShareAsyncClient.createPermissionWithResponse(FILE_PERMISSION)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 201)) .verifyComplete(); } @Test public void createAndGetPermission() { - StepVerifier - .create(primaryShareAsyncClient.create() - .then(primaryShareAsyncClient.createPermission(FILE_PERMISSION)) - .flatMap(filePermissionKey -> primaryShareAsyncClient.getPermissionWithResponse(filePermissionKey))) + primaryShareAsyncClient.create().block(); + String filePermissionKey = primaryShareAsyncClient.createPermission(FILE_PERMISSION).block(); + StepVerifier.create(primaryShareAsyncClient.getPermissionWithResponse(filePermissionKey)) .assertNext(it -> FileShareTestHelper.assertResponseStatusCode(it, 200)) .verifyComplete(); } @@ -928,23 +890,26 @@ public void createAndGetPermissionFilePermissionFormat(FilePermissionFormat file .then(primaryShareAsyncClient.createPermission(filePermission)) .flatMap(r -> primaryShareAsyncClient.getPermission(r, filePermissionFormat)); - StepVerifier.create(response).assertNext(r -> assertEquals(r, permission)).verifyComplete(); + StepVerifier.create(response).assertNext(r -> { + assertEquals(r, permission); + }).verifyComplete(); } @Test public void createPermissionError() { - StepVerifier - .create( - primaryShareAsyncClient.create().then(primaryShareAsyncClient.createPermissionWithResponse("abcde"))) + primaryShareAsyncClient.create().block(); + // Invalid permission + StepVerifier.create(primaryShareAsyncClient.createPermissionWithResponse("abcde")) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.fromString("FileInvalidPermission"))); } @Test public void getPermissionError() { - StepVerifier - .create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.getPermissionWithResponse("abcde"))) + primaryShareAsyncClient.create().block(); + // Invalid permission key + StepVerifier.create(primaryShareAsyncClient.getPermissionWithResponse("abcde")) .verifyErrorSatisfies(it -> FileShareTestHelper.assertExceptionStatusCodeAndMessage(it, 400, ShareErrorCode.INVALID_HEADER_VALUE)); } @@ -963,6 +928,7 @@ public void getShareName() { @Test public void defaultAudience() { + primaryShareAsyncClient.create().block(); ShareAsyncClient aadShareClient = getOAuthShareClientBuilder( new ShareClientBuilder().shareName(shareName).shareTokenIntent(ShareTokenIntent.BACKUP)).audience(null) // should default to "https://storage.azure.com/" .buildAsyncClient(); @@ -971,13 +937,14 @@ public void defaultAudience() { + "1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;S-1-5-21-397955417-626881126-" + "188441444-3053964)S:NO_ACCESS_CONTROL"; - StepVerifier.create(primaryShareAsyncClient.create().then(aadShareClient.createPermission(permission))) - .assertNext(Assertions::assertNotNull) + StepVerifier.create(aadShareClient.createPermission(permission)) + .assertNext(r -> assertNotNull(r)) .verifyComplete(); } @Test public void storageAccountAudience() { + primaryShareAsyncClient.create().block(); ShareAsyncClient aadShareClient = getOAuthShareClientBuilder(new ShareClientBuilder()).shareName(shareName) .shareTokenIntent(ShareTokenIntent.BACKUP) .audience(ShareAudience.createShareServiceAccountAudience(primaryShareAsyncClient.getAccountName())) @@ -987,13 +954,14 @@ public void storageAccountAudience() { + "1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;S-1-5-21-397955417-626881126-" + "188441444-3053964)S:NO_ACCESS_CONTROL"; - StepVerifier.create(primaryShareAsyncClient.create().then(aadShareClient.createPermission(permission))) - .assertNext(Assertions::assertNotNull) + StepVerifier.create(aadShareClient.createPermission(permission)) + .assertNext(r -> assertNotNull(r)) .verifyComplete(); } @Test public void audienceError() { + primaryShareAsyncClient.create().block(); ShareAsyncClient aadShareClient = getOAuthShareClientBuilder(new ShareClientBuilder()).shareName(shareName) .shareTokenIntent(ShareTokenIntent.BACKUP) .audience(ShareAudience.createShareServiceAccountAudience("badaudience")) @@ -1003,11 +971,10 @@ public void audienceError() { + "1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;S-1-5-21-397955417-626881126-" + "188441444-3053964)S:NO_ACCESS_CONTROL"; - StepVerifier.create(primaryShareAsyncClient.create().then(aadShareClient.createPermission(permission))) - .verifyErrorSatisfies(r -> { - ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); - assertEquals(ShareErrorCode.INVALID_AUTHENTICATION_INFO, e.getErrorCode()); - }); + StepVerifier.create(aadShareClient.createPermission(permission)).verifyErrorSatisfies(r -> { + ShareStorageException e = assertInstanceOf(ShareStorageException.class, r); + assertEquals(ShareErrorCode.INVALID_AUTHENTICATION_INFO, e.getErrorCode()); + }); } @Test @@ -1015,6 +982,7 @@ public void audienceFromString() { String url = String.format("https://%s.file.core.windows.net/", primaryShareAsyncClient.getAccountName()); ShareAudience audience = ShareAudience.fromString(url); + primaryShareAsyncClient.create().block(); ShareAsyncClient aadShareClient = getOAuthShareClientBuilder(new ShareClientBuilder()).shareName(shareName) .shareTokenIntent(ShareTokenIntent.BACKUP) .audience(audience) @@ -1024,8 +992,8 @@ public void audienceFromString() { + "1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;0x1200a9;;;S-1-5-21-397955417-626881126-" + "188441444-3053964)S:NO_ACCESS_CONTROL"; - StepVerifier.create(primaryShareAsyncClient.create().then(aadShareClient.createPermission(permission))) - .assertNext(Assertions::assertNotNull) + StepVerifier.create(aadShareClient.createPermission(permission)) + .assertNext(r -> assertNotNull(r)) .verifyComplete(); } @@ -1038,16 +1006,18 @@ public void createEnableSnapshotVirtualDirectoryAccess(Boolean enableSnapshotVir options.setProtocols(protocols); options.setSnapshotVirtualDirectoryAccessEnabled(enableSnapshotVirtualDirectoryAccess); - StepVerifier.create(premiumFileServiceAsyncClient.getShareAsyncClient(shareName) - .createWithResponse(options) - .then(premiumFileServiceAsyncClient.getShareAsyncClient(shareName).getProperties())).assertNext(r -> { + premiumFileServiceAsyncClient.getShareAsyncClient(shareName).createWithResponse(options).block(); + + StepVerifier.create(premiumFileServiceAsyncClient.getShareAsyncClient(shareName).getProperties()) + .assertNext(r -> { assertEquals(protocols.toString(), r.getProtocols().toString()); if (enableSnapshotVirtualDirectoryAccess == null || enableSnapshotVirtualDirectoryAccess) { assertTrue(r.isSnapshotVirtualDirectoryAccessEnabled()); } else { assertFalse(r.isSnapshotVirtualDirectoryAccessEnabled()); } - }).verifyComplete(); + }) + .verifyComplete(); //cleanup premiumFileServiceAsyncClient.getShareAsyncClient(shareName).delete().block(); @@ -1065,17 +1035,14 @@ public void setPropertiesEnableSnapshotVirtualDirectoryAccess(Boolean enableSnap ShareProtocols protocols = ModelHelper.parseShareProtocols(Constants.HeaderConstants.NFS_PROTOCOL); options.setProtocols(protocols); - Mono createShare - = premiumFileServiceAsyncClient.getShareAsyncClient(shareName).createWithResponse(options).then(); + premiumFileServiceAsyncClient.getShareAsyncClient(shareName).createWithResponse(options).block(); ShareSetPropertiesOptions setPropertiesOptions = new ShareSetPropertiesOptions(); setPropertiesOptions.setSnapshotVirtualDirectoryAccessEnabled(enableSnapshotVirtualDirectoryAccess); - Mono setProperties = createShare - .then(premiumFileServiceAsyncClient.getShareAsyncClient(shareName).setProperties(setPropertiesOptions)); + premiumFileServiceAsyncClient.getShareAsyncClient(shareName).setProperties(setPropertiesOptions).block(); - StepVerifier - .create(setProperties.then(premiumFileServiceAsyncClient.getShareAsyncClient(shareName).getProperties())) + StepVerifier.create(premiumFileServiceAsyncClient.getShareAsyncClient(shareName).getProperties()) .assertNext(r -> { assertEquals(protocols.toString(), r.getProtocols().toString()); if (enableSnapshotVirtualDirectoryAccess == null || enableSnapshotVirtualDirectoryAccess) { diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileInputOutputStreamTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileInputOutputStreamTests.java index 793e44740a394..9945c63700753 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileInputOutputStreamTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileInputOutputStreamTests.java @@ -7,9 +7,6 @@ import com.azure.storage.common.test.shared.extensions.LiveOnly; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -17,12 +14,6 @@ import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; public class StorageFileInputOutputStreamTests extends FileShareTestBase { private ShareFileClient fileClient; @@ -42,7 +33,7 @@ public void setup() { public void uploadDownload() throws IOException { length = 30 * Constants.MB; fileClient.create(length); - byte[] randomBytes = getRandomByteArray(length); + byte[] randomBytes = FileShareTestHelper.getRandomBuffer(length); StorageFileOutputStream outStream = fileClient.getFileOutputStream(); outStream.write(randomBytes); @@ -67,7 +58,7 @@ public void uploadDownload() throws IOException { public void streamWithOffset() throws IOException { length = 7 * Constants.MB; fileClient.create(length); - byte[] randomBytes = getRandomByteArray(9 * Constants.MB); + byte[] randomBytes = FileShareTestHelper.getRandomBuffer(9 * Constants.MB); StorageFileOutputStream outStream = fileClient.getFileOutputStream(); outStream.write(randomBytes, 2 * Constants.MB, length); @@ -86,21 +77,4 @@ public void streamWithOffset() throws IOException { byte[] randomBytes2 = outputStream.toByteArray(); assertArrayEquals(randomBytes2, Arrays.copyOfRange(randomBytes, 2 * Constants.MB, 9 * Constants.MB)); } - - @Test - @SuppressWarnings("unchecked") - public void testPartialResponseHandling() { - ShareFileAsyncClient mockClient = mock(ShareFileAsyncClient.class); - StorageFileOutputStream outputStream = new StorageFileOutputStream(mockClient, 0); - - byte[] data = "test data".getBytes(); - int writeLength = data.length; - - when(mockClient.uploadWithResponse(any(Flux.class), eq((long) writeLength), eq(0L))) - .thenReturn(Mono.error(new IOException())); - - StepVerifier.create(outputStream.dispatchWrite(data, writeLength, 0)).expectError(IOException.class).verify(); - - verify(mockClient, times(1)).uploadWithResponse(any(Flux.class), eq((long) writeLength), eq(0L)); - } } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileSeekableByteChannelTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileSeekableByteChannelTests.java index 857023469e027..c2c0a017c7bdb 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileSeekableByteChannelTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageFileSeekableByteChannelTests.java @@ -59,7 +59,7 @@ public void e2EChannelWrite() throws IOException { .setChunkSizeInBytes((long) streamBufferSize)); //then: "Channel initialized to position zero" - assertEquals(0, channel.position()); + assertEquals(channel.position(), 0); //when: "write to channel" int copied = FileShareTestHelper.copy(new ByteArrayInputStream(data), channel, copyBufferSize); @@ -91,7 +91,7 @@ public void e2EChannelRead(int streamBufferSize, int copyBufferSize, int dataLen new ShareFileSeekableByteChannelReadOptions().setChunkSizeInBytes((long) streamBufferSize)); //then: "Channel initialized to position zero" - assertEquals(0, channel.position()); + assertEquals(channel.position(), 0); //when: "read from channel" ByteArrayOutputStream downloadedData = new ByteArrayOutputStream(); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java index d7438c0d4b948..93a79d0196495 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java @@ -159,8 +159,8 @@ public void readDetectsFileGrowth() throws IOException { int read = behavior.read(buffer, 0); //then: "channel state as expected" - assertEquals(length, read); - assertEquals(length, behavior.getResourceLength()); + assertEquals(read, length); + assertEquals(behavior.getResourceLength(), length); //and: "buffer correctly filled" assertEquals(buffer.position(), buffer.capacity()); @@ -171,11 +171,11 @@ public void readDetectsFileGrowth() throws IOException { read = behavior.read(buffer, length); //then: "gracefully signal end of file" - assertEquals(-1, read); - assertEquals(length, behavior.getResourceLength()); + assertEquals(read, -1); + assertEquals(behavior.getResourceLength(), length); //and: "buffer unfilled" - assertEquals(0, buffer.position()); + assertEquals(buffer.position(), 0); //when: "file augmented to full size" primaryFileClient.setProperties(2 * length, null, null, null); @@ -189,8 +189,8 @@ public void readDetectsFileGrowth() throws IOException { read = behavior.read(buffer, behavior.getResourceLength()); //then: "channel state has updated length" - assertEquals(length, read); - assertEquals(2 * length, behavior.getResourceLength()); + assertEquals(read, length); + assertEquals(behavior.getResourceLength(), 2 * length); //and: "buffer correctly filled" assertEquals(buffer.position(), buffer.capacity()); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/specialized/LeaseAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/specialized/LeaseAsyncApiTests.java deleted file mode 100644 index 8ce0d5fa85838..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/specialized/LeaseAsyncApiTests.java +++ /dev/null @@ -1,747 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.storage.file.share.specialized; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.CoreUtils; -import com.azure.storage.common.implementation.Constants; -import com.azure.storage.common.test.shared.extensions.RequiredServiceVersion; -import com.azure.storage.file.share.*; -import com.azure.storage.file.share.models.*; -import com.azure.storage.file.share.options.ShareAcquireLeaseOptions; -import com.azure.storage.file.share.options.ShareBreakLeaseOptions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; -import org.junit.jupiter.params.provider.ValueSource; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.time.Duration; -import java.util.function.Predicate; -import java.util.function.Supplier; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class LeaseAsyncApiTests extends FileShareTestBase { - private ShareFileAsyncClient primaryFileAsyncClient; - private ShareAsyncClient shareAsyncClient; - private String shareName; - - @BeforeEach - public void setup() { - shareName = generateShareName(); - String filePath = generatePathName(); - shareAsyncClient = shareBuilderHelper(shareName).buildAsyncClient(); - shareAsyncClient.create().block(); - primaryFileAsyncClient = fileBuilderHelper(shareName, filePath).buildFileAsyncClient(); - primaryFileAsyncClient.create(50).block(); - } - - @Test - public void acquireFileLease() { - ShareLeaseAsyncClient leaseClient = createLeaseClient(primaryFileAsyncClient); - StepVerifier.create(leaseClient.acquireLease()).assertNext(leaseId -> { - assertNotNull(leaseId); - assertEquals(leaseId, leaseClient.getLeaseId()); - }).verifyComplete(); - - StepVerifier.create(primaryFileAsyncClient.getPropertiesWithResponse(null)).assertNext(response -> { - ShareFileProperties properties = response.getValue(); - assertEquals(LeaseStateType.LEASED, properties.getLeaseState()); - assertEquals(LeaseDurationType.INFINITE, properties.getLeaseDuration()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2022-11-02") - @Test - public void acquireAndReleaseFileLeaseTrailingDot() { - ShareFileAsyncClient shareFileAsyncClient = getFileAsyncClient(shareName, generatePathName() + ".", true, null); - Mono createFile = shareFileAsyncClient.create(DATA.getDefaultDataSizeLong()); - - ShareLeaseAsyncClient leaseClient = new ShareLeaseClientBuilder().fileAsyncClient(shareFileAsyncClient) - .allowTrailingDot(true) - .buildAsyncClient(); - - Mono> acquireLease = leaseClient.acquireLeaseWithResponse(null, null); - Mono> releaseLease = leaseClient.releaseLeaseWithResponse(null); - - StepVerifier.create(createFile.then(acquireLease).flatMap(acquireResponse -> { - assertEquals(201, acquireResponse.getStatusCode()); - assertNotNull(acquireResponse.getValue()); - return releaseLease; - }).flatMap(releaseResponse -> { - assertEquals(200, releaseResponse.getStatusCode()); - return Mono.empty(); - })).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-04-10") - @Test - public void acquireAndReleaseFileLeaseOAuth() { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareDirectoryAsyncClient dirClient - = oAuthServiceClient.getShareAsyncClient(shareName).getDirectoryClient(generatePathName()); - Mono createDir = dirClient.create(); - ShareFileAsyncClient fileClient = dirClient.getFileClient(generatePathName()); - Mono createFile = fileClient.create(Constants.KB); - ShareLeaseAsyncClient leaseClient = new ShareLeaseClientBuilder().fileAsyncClient(fileClient) - .shareTokenIntent(ShareTokenIntent.BACKUP) - .buildAsyncClient(); - - Mono> acquireLease = leaseClient.acquireLeaseWithResponse(null, null); - Mono> releaseLease = leaseClient.releaseLeaseWithResponse(null); - - StepVerifier.create(createDir.then(createFile).then(acquireLease).flatMap(acquireResponse -> { - assertEquals(201, acquireResponse.getStatusCode()); - assertNotNull(acquireResponse.getValue()); - return releaseLease; - }).flatMap(releaseResponse -> { - assertEquals(200, releaseResponse.getStatusCode()); - return Mono.empty(); - })).verifyComplete(); - } - - @Test - public void acquireFileLeaseError() { - ShareFileAsyncClient fileClient = shareAsyncClient.getFileClient("garbage"); - StepVerifier.create(createLeaseClient(fileClient).acquireLease()) - .expectError(ShareStorageException.class) - .verify(); - } - - @Test - public void releaseLease() { - StepVerifier - .create(setupFileLeaseCondition(primaryFileAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(primaryFileAsyncClient, leaseID).releaseLeaseWithResponse(null)) - .flatMap(response -> primaryFileAsyncClient.getProperties())) - .assertNext(properties -> assertEquals(LeaseStateType.AVAILABLE, properties.getLeaseState())) - .verifyComplete(); - } - - @Test - public void releaseLeaseMin() { - StepVerifier - .create(setupFileLeaseCondition(primaryFileAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(primaryFileAsyncClient, leaseID).releaseLease())) - .verifyComplete(); - } - - @Test - public void releaseFileLeaseError() { - ShareFileAsyncClient fileClient = shareAsyncClient.getFileClient("garbage"); - StepVerifier.create(createLeaseClient(fileClient, "id").releaseLease()) - .expectError(ShareStorageException.class) - .verify(); - } - - @Test - public void breakFileLease() { - ShareLeaseAsyncClient leaseClient = createLeaseClient(primaryFileAsyncClient, testResourceNamer.randomUuid()); - StepVerifier - .create( - leaseClient.acquireLease().then(leaseClient.breakLease()).then(primaryFileAsyncClient.getProperties())) - .assertNext(properties -> assertEquals(LeaseStateType.BROKEN, properties.getLeaseState())) - .verifyComplete(); - } - - @Test - public void breakFileLeaseMin() { - StepVerifier.create(setupFileLeaseCondition(primaryFileAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(primaryFileAsyncClient, leaseID).breakLease())).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2022-11-02") - @Test - public void breakFileLeaseTrailingDot() { - ShareFileAsyncClient shareFileAsyncClient = getFileAsyncClient(shareName, generatePathName() + ".", true, null); - Mono createFile = shareFileAsyncClient.create(DATA.getDefaultDataSizeLong()); - - ShareLeaseAsyncClient leaseClient = new ShareLeaseClientBuilder().fileAsyncClient(shareFileAsyncClient) - .allowTrailingDot(true) - .buildAsyncClient(); - - Mono> acquireLease = leaseClient.acquireLeaseWithResponse(null, null); - Mono> breakLease = leaseClient.breakLeaseWithResponse(null); - - StepVerifier.create(createFile.then(acquireLease) - .flatMap(acquireResponse -> breakLease) - .flatMap(breakResponse -> shareFileAsyncClient.getProperties())).assertNext(properties -> { - assertEquals(LeaseStateType.BROKEN, properties.getLeaseState()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-04-10") - @Test - public void breakFileLeaseOAuth() { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareDirectoryAsyncClient dirClient - = oAuthServiceClient.getShareAsyncClient(shareName).getDirectoryClient(generatePathName()); - Mono createDir = dirClient.create(); - ShareFileAsyncClient fileClient = dirClient.getFileClient(generatePathName()); - Mono createFile = fileClient.create(Constants.KB); - - ShareLeaseAsyncClient leaseClient = new ShareLeaseClientBuilder().fileAsyncClient(fileClient) - .shareTokenIntent(ShareTokenIntent.BACKUP) - .buildAsyncClient(); - Mono> acquireLease = leaseClient.acquireLeaseWithResponse(null, null); - Mono> breakLease = leaseClient.breakLeaseWithResponse(null); - - StepVerifier.create(createDir.then(createFile) - .then(acquireLease) - .flatMap(acquireResponse -> breakLease) - .flatMap(breakResponse -> fileClient.getProperties())).assertNext(properties -> { - assertEquals(LeaseStateType.BROKEN, properties.getLeaseState()); - }).verifyComplete(); - } - - @Test - public void breakFileLeaseError() { - StepVerifier.create(createLeaseClient(primaryFileAsyncClient).breakLease()) - .expectError(ShareStorageException.class) - .verify(); - } - - @Test - public void changeFileLease() { - String initialLeaseId = testResourceNamer.randomUuid(); - String newLeaseId = testResourceNamer.randomUuid(); - ShareLeaseAsyncClient leaseClient = createLeaseClient(primaryFileAsyncClient, initialLeaseId); - - StepVerifier.create(leaseClient.acquireLease().flatMap(leaseId -> { - assertNotNull(leaseId); - return leaseClient.changeLeaseWithResponse(newLeaseId, null).flatMap(changeResponse -> { - assertEquals(newLeaseId, changeResponse.getValue()); - assertEquals(newLeaseId, leaseClient.getLeaseId()); - - ShareLeaseAsyncClient newLeaseClient - = createLeaseClient(primaryFileAsyncClient, changeResponse.getValue()); - return newLeaseClient.releaseLeaseWithResponse(null).flatMap(releaseResponse -> { - assertEquals(200, releaseResponse.getStatusCode()); - return Mono.empty(); - }); - }); - })).verifyComplete(); - } - - @Test - public void changeFileLeaseMin() { - StepVerifier.create(setupFileLeaseCondition(primaryFileAsyncClient, RECEIVED_LEASE_ID).flatMap( - leaseID -> createLeaseClient(primaryFileAsyncClient, leaseID).changeLease(testResourceNamer.randomUuid()))) - .expectNextCount(1) - .verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2022-11-02") - @Test - public void changeFileLeaseTrailingDot() { - ShareFileAsyncClient primaryFileAsyncClient - = getFileAsyncClient(shareName, generatePathName() + ".", true, null); - Mono createFile = primaryFileAsyncClient.create(DATA.getDefaultDataSizeLong()); - - ShareLeaseAsyncClient leaseClient = new ShareLeaseClientBuilder().fileAsyncClient(primaryFileAsyncClient) - .allowTrailingDot(true) - .buildAsyncClient(); - - Mono changeLease = leaseClient.acquireLease().flatMap(leaseID -> leaseClient.changeLease(leaseID)); - - StepVerifier.create(createFile.then(changeLease)).assertNext(changeResponse -> { - assertEquals(changeResponse, leaseClient.getLeaseId()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-04-10") - @Test - public void changeFileLeaseOAuth() { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareDirectoryAsyncClient dirClient - = oAuthServiceClient.getShareAsyncClient(shareName).getDirectoryClient(generatePathName()); - Mono createDir = dirClient.create(); - ShareFileAsyncClient fileClient = dirClient.getFileClient(generatePathName()); - Mono createFile = fileClient.create(Constants.KB); - - ShareLeaseAsyncClient leaseClient = new ShareLeaseClientBuilder().fileAsyncClient(fileClient) - .shareTokenIntent(ShareTokenIntent.BACKUP) - .buildAsyncClient(); - - Mono changeLease = leaseClient.acquireLease().flatMap(leaseID -> leaseClient.changeLease(leaseID)); - - StepVerifier.create(createDir.then(createFile).then(changeLease)).assertNext(changeResponse -> { - assertEquals(changeResponse, leaseClient.getLeaseId()); - }).verifyComplete(); - } - - @Test - public void changeFileLeaseError() { - ShareFileAsyncClient fileClient = shareAsyncClient.getFileClient("garbage"); - StepVerifier.create(createLeaseClient(fileClient, "id").changeLease("id")) - .expectError(ShareStorageException.class) - .verify(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @ParameterizedTest - @MethodSource("acquireShareLeaseSupplier") - public void acquireShareLease(String proposedID, int leaseTime, LeaseStateType leaseState, - LeaseDurationType leaseDuration) { - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareAsyncClient, proposedID); - - Mono> leaseResponseMono - = leaseClient.acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(leaseTime), null); - - StepVerifier.create(leaseResponseMono.flatMap(leaseResponse -> { - assertEquals(leaseClient.getLeaseId(), leaseResponse.getValue()); - return shareAsyncClient.getProperties(); - })).assertNext(properties -> { - assertNotNull(properties); - assertEquals(leaseState, properties.getLeaseState()); - assertEquals(leaseDuration, properties.getLeaseDuration()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") - @ParameterizedTest - @MethodSource("acquireShareLeaseSupplier") - public void acquireShareLeaseOAuth(String proposedID, int leaseTime, LeaseStateType leaseState, - LeaseDurationType leaseDuration) { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareAsyncClient shareClient = oAuthServiceClient.getShareAsyncClient(shareName); - - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareClient, proposedID); - Mono> leaseResponseMono - = leaseClient.acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(leaseTime), null); - - StepVerifier.create(leaseResponseMono.flatMap(leaseResponse -> { - assertEquals(leaseClient.getLeaseId(), leaseResponse.getValue()); - return shareClient.getProperties(); - })).assertNext(properties -> { - assertNotNull(properties); - assertEquals(leaseState, properties.getLeaseState()); - assertEquals(leaseDuration, properties.getLeaseDuration()); - }).verifyComplete(); - } - - private static Stream acquireShareLeaseSupplier() { - return Stream.of(Arguments.of(null, -1, LeaseStateType.LEASED, LeaseDurationType.INFINITE), - Arguments.of(null, 25, LeaseStateType.LEASED, LeaseDurationType.FIXED), - Arguments.of(CoreUtils.randomUuid().toString(), -1, LeaseStateType.LEASED, LeaseDurationType.INFINITE)); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void acquireShareLeaseMin() { - StepVerifier.create(createLeaseClient(shareAsyncClient).acquireLeaseWithResponse(null, null)) - .assertNext(response -> assertEquals(201, response.getStatusCode())) - .verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void acquireShareLeaseSnapshot() { - Mono> response = shareAsyncClient.createSnapshot().flatMap(snapshotInfo -> { - ShareAsyncClient sc - = shareBuilderHelper(shareAsyncClient.getShareName(), snapshotInfo.getSnapshot()).buildAsyncClient(); - ShareLeaseAsyncClient leaseClient = createLeaseClient(sc); - - Supplier>> action - = () -> leaseClient.acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(-1)); - - Predicate retryPredicate - = it -> it.getErrorCode() == ShareErrorCode.SHARE_SNAPSHOT_IN_PROGRESS; - - int times = 6; - Duration delay = Duration.ofSeconds(10); - - return retryAsync(action, retryPredicate, times, delay) - .flatMap(resp -> createLeaseClient(sc, resp.getValue()).releaseLease().thenReturn(resp)); - }); - - StepVerifier.create(response).assertNext(resp -> { - assertNotNull(resp); - assertEquals(201, resp.getStatusCode()); - }).verifyComplete(); - } - - @Test - public void acquireShareLeaseSnapshotFail() { - String shareSnapshot = "2020-08-19T19:26:08.0000000Z"; - ShareAsyncClient sc = shareBuilderHelper(shareAsyncClient.getShareName(), shareSnapshot).buildAsyncClient(); - StepVerifier - .create( - createLeaseClient(sc).acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(-1), null)) - .expectError(ShareStorageException.class) - .verify(); - } - - @ParameterizedTest - @ValueSource(ints = { -10, 10, 70 }) - public void acquireShareLeaseDurationFail(int duration) { - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareAsyncClient); - StepVerifier - .create(leaseClient.acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(duration), null)) - .expectError(ShareStorageException.class) - .verify(); - } - - @Test - public void acquireShareLeaseError() { - ShareAsyncClient shareAsyncClient = shareBuilderHelper(generateShareName()).buildAsyncClient(); - StepVerifier - .create(createLeaseClient(shareAsyncClient) - .acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(20), null)) - .expectError(ShareStorageException.class) - .verify(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void renewShareLease() { - Mono leaseIDMono = setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID); - Mono leaseClientMono - = leaseIDMono.map(leaseID -> createLeaseClient(shareAsyncClient, leaseID)); - - StepVerifier.create(leaseClientMono.flatMap(leaseClient -> { - // If running in live mode wait for the lease to expire to ensure we are actually renewing it - return Mono.delay(Duration.ofSeconds(16)) - .then(leaseClient.renewLeaseWithResponse(null)) - .flatMap(renewLeaseResponse -> { - assertEquals(leaseClient.getLeaseId(), renewLeaseResponse.getValue()); - return shareAsyncClient.getProperties(); - }) - .flatMap(properties -> { - assertEquals(LeaseStateType.LEASED, properties.getLeaseState()); - return Mono.empty(); - }); - })).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") - @Test - public void renewShareLeaseOAuth() { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareAsyncClient shareClient = oAuthServiceClient.getShareAsyncClient(shareName); - - Mono leaseIDMono = setupShareLeaseAsyncCondition(shareClient, RECEIVED_LEASE_ID); - Mono leaseClientMono - = leaseIDMono.map(leaseID -> createLeaseClient(shareClient, leaseID)); - - StepVerifier.create(leaseClientMono.flatMap(leaseClient -> { - // If running in live mode wait for the lease to expire to ensure we are actually renewing it - return Mono.delay(Duration.ofSeconds(16)) - .then(leaseClient.renewLeaseWithResponse(null)) - .flatMap(renewLeaseResponse -> { - assertEquals(leaseClient.getLeaseId(), renewLeaseResponse.getValue()); - return shareClient.getProperties(); - }) - .flatMap(properties -> { - assertEquals(LeaseStateType.LEASED, properties.getLeaseState()); - return Mono.empty(); - }); - })).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void renewShareLeaseMin() { - StepVerifier - .create(setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(shareAsyncClient, leaseID).renewLeaseWithResponse(null))) - .assertNext(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void renewShareLeaseSnapshot() { - Mono shareSnapshotMono = shareAsyncClient.createSnapshot().map(ShareSnapshotInfo::getSnapshot); - Mono scMono = shareSnapshotMono - .map(snapshot -> shareBuilderHelper(shareAsyncClient.getShareName(), snapshot).buildAsyncClient()); - - StepVerifier.create(scMono.flatMap(sc -> setupShareLeaseAsyncCondition(sc, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(sc, leaseID).renewLeaseWithResponse(null)) - .flatMap(resp -> { - assertEquals(200, resp.getStatusCode()); - return createLeaseClient(sc, resp.getValue()).releaseLeaseWithResponse(null); - }))).assertNext(releaseResp -> assertEquals(200, releaseResp.getStatusCode())).verifyComplete(); - } - - @Test - public void renewShareLeaseSnapshotFail() { - String shareSnapshot = "2020-08-19T19:26:08.0000000Z"; - ShareAsyncClient sc = shareBuilderHelper(shareAsyncClient.getShareName(), shareSnapshot).buildAsyncClient(); - StepVerifier.create(createLeaseClient(sc).renewLease()).expectError(ShareStorageException.class).verify(); - } - - @Test - public void renewShareLeaseError() { - ShareAsyncClient shareAsyncClient = shareBuilderHelper(generateShareName()).buildAsyncClient(); - StepVerifier.create(createLeaseClient(shareAsyncClient, "id").renewLease()) - .expectError(ShareStorageException.class) - .verify(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void releaseShareLease() { - StepVerifier.create(setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(shareAsyncClient, leaseID).releaseLeaseWithResponse(null)) - .flatMap(response -> { - assertEquals(200, response.getStatusCode()); - return shareAsyncClient.getProperties(); - })).assertNext(properties -> { - assertEquals(LeaseStateType.AVAILABLE, properties.getLeaseState()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") - @Test - public void releaseShareLeaseOAuth() { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareAsyncClient shareClient = oAuthServiceClient.getShareAsyncClient(shareName); - Mono leaseIDMono = setupShareLeaseAsyncCondition(shareClient, RECEIVED_LEASE_ID); - Mono> releaseLeaseResponseMono - = leaseIDMono.flatMap(leaseID -> createLeaseClient(shareClient, leaseID).releaseLeaseWithResponse(null)); - - StepVerifier.create(releaseLeaseResponseMono.flatMap(response -> { - assertEquals(200, response.getStatusCode()); - return shareClient.getProperties(); - })).assertNext(properties -> { - assertEquals(LeaseStateType.AVAILABLE, properties.getLeaseState()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void releaseShareLeaseMin() { - StepVerifier - .create(setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(shareAsyncClient, leaseID).releaseLeaseWithResponse(null))) - .assertNext(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void releaseShareLeaseSnapshot() { - Mono shareSnapshotMono = shareAsyncClient.createSnapshot().map(ShareSnapshotInfo::getSnapshot); - Mono scMono = shareSnapshotMono - .map(snapshot -> shareBuilderHelper(shareAsyncClient.getShareName(), snapshot).buildAsyncClient()); - - StepVerifier.create(scMono.flatMap(sc -> setupShareLeaseAsyncCondition(sc, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(sc, leaseID).releaseLeaseWithResponse(null)) - .flatMap(response -> { - assertEquals(200, response.getStatusCode()); - return Mono.empty(); - }))).verifyComplete(); - } - - @Test - public void releaseShareLeaseSnapshotFail() { - String shareSnapshot = "2020-08-19T19:26:08.0000000Z"; - ShareAsyncClient sc = shareBuilderHelper(shareAsyncClient.getShareName(), shareSnapshot).buildAsyncClient(); - StepVerifier.create(createLeaseClient(sc).releaseLeaseWithResponse(null)) - .expectError(ShareStorageException.class) - .verify(); - } - - @Test - public void releaseShareLeaseError() { - ShareAsyncClient shareAsyncClient = shareBuilderHelper(generateShareName()).buildAsyncClient(); - StepVerifier.create(createLeaseClient(shareAsyncClient, "id").releaseLease()) - .expectError(ShareStorageException.class) - .verify(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @ParameterizedTest - @MethodSource("breakShareLeaseSupplier") - public void breakShareLease(int leaseTime, Long breakPeriod) { - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareAsyncClient, testResourceNamer.randomUuid()); - Mono> acquireLeaseMono - = leaseClient.acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(leaseTime), null); - Mono> breakLeaseMono = acquireLeaseMono - .flatMap(acquireResponse -> leaseClient.breakLeaseWithResponse(new ShareBreakLeaseOptions() - .setBreakPeriod(breakPeriod == null ? null : Duration.ofSeconds(breakPeriod)), null)); - - StepVerifier.create(breakLeaseMono.flatMap(breakResponse -> shareAsyncClient.getProperties().map(properties -> { - LeaseStateType state = properties.getLeaseState(); - assertTrue(LeaseStateType.BROKEN == state || LeaseStateType.BREAKING == state); - validateBasicHeaders(breakResponse.getHeaders()); - if (breakPeriod != null) { - sleepIfRunningAgainstService(breakPeriod * 1000); - } - return Mono.empty(); - }).then())).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") - @ParameterizedTest - @MethodSource("breakShareLeaseSupplier") - public void breakShareLeaseOAuth(int leaseTime, Long breakPeriod) { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareAsyncClient shareClient = oAuthServiceClient.getShareAsyncClient(shareName); - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareClient, testResourceNamer.randomUuid()); - - Mono> acquireLeaseMono - = leaseClient.acquireLeaseWithResponse(new ShareAcquireLeaseOptions().setDuration(leaseTime), null); - Mono> breakLeaseMono = acquireLeaseMono - .flatMap(acquireResponse -> leaseClient.breakLeaseWithResponse(new ShareBreakLeaseOptions() - .setBreakPeriod(breakPeriod == null ? null : Duration.ofSeconds(breakPeriod)), null)); - - StepVerifier.create(breakLeaseMono.flatMap(breakResponse -> shareClient.getProperties().map(properties -> { - LeaseStateType state = properties.getLeaseState(); - assertTrue(LeaseStateType.BROKEN == state || LeaseStateType.BREAKING == state); - validateBasicHeaders(breakResponse.getHeaders()); - if (breakPeriod != null) { - sleepIfRunningAgainstService(breakPeriod * 1000); - } - return Mono.empty(); - }).then())).verifyComplete(); - } - - private static Stream breakShareLeaseSupplier() { - return Stream.of(Arguments.of(-1, null), Arguments.of(-1, 20L), Arguments.of(20, 15L)); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void breakShareLeaseMin() { - StepVerifier - .create(setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID) - .then(createLeaseClient(shareAsyncClient).breakLeaseWithResponse(new ShareBreakLeaseOptions(), null))) - .assertNext(response -> assertEquals(202, response.getStatusCode())) - .verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void breakShareLeaseSnapshot() { - Mono shareSnapshotMono = shareAsyncClient.createSnapshot().map(ShareSnapshotInfo::getSnapshot); - Mono scMono = shareSnapshotMono - .map(snapshot -> shareBuilderHelper(shareAsyncClient.getShareName(), snapshot).buildAsyncClient()); - - StepVerifier.create(scMono.flatMap(sc -> setupShareLeaseAsyncCondition(sc, RECEIVED_LEASE_ID) - .flatMap( - leaseID -> createLeaseClient(sc, leaseID).breakLeaseWithResponse(new ShareBreakLeaseOptions(), null)) - .flatMap(response -> { - assertEquals(202, response.getStatusCode()); - return Mono.empty(); - }))).verifyComplete(); - } - - @Test - public void breakShareLeaseSnapshotFail() { - String shareSnapshot = "2020-08-19T19:26:08.0000000Z"; - ShareAsyncClient sc = shareBuilderHelper(shareAsyncClient.getShareName(), shareSnapshot).buildAsyncClient(); - StepVerifier.create(createLeaseClient(sc).breakLease()).expectError(ShareStorageException.class).verify(); - } - - @Test - public void breakShareLeaseError() { - ShareAsyncClient shareAsyncClient = shareBuilderHelper(generateShareName()).buildAsyncClient(); - StepVerifier.create(createLeaseClient(shareAsyncClient).breakLease()) - .expectError(ShareStorageException.class) - .verify(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void changeShareLease() { - StepVerifier.create(setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID).flatMap(leaseID -> { - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareAsyncClient, leaseID); - String newLeaseId = testResourceNamer.randomUuid(); - return leaseClient.changeLeaseWithResponse(newLeaseId, null).flatMap(changeLeaseResponse -> { - assertEquals(newLeaseId, changeLeaseResponse.getValue()); - assertEquals(leaseClient.getLeaseId(), changeLeaseResponse.getValue()); - validateBasicHeaders(changeLeaseResponse.getHeaders()); - return createLeaseClient(shareAsyncClient, newLeaseId).releaseLeaseWithResponse(null); - }).flatMap(releaseLeaseResponse -> { - assertEquals(200, releaseLeaseResponse.getStatusCode()); - return Mono.empty(); - }); - })).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-08-04") - @Test - public void changeShareLeaseOAuth() { - ShareServiceAsyncClient oAuthServiceClient - = getOAuthServiceAsyncClient(new ShareServiceClientBuilder().shareTokenIntent(ShareTokenIntent.BACKUP)); - ShareAsyncClient shareClient = oAuthServiceClient.getShareAsyncClient(shareName); - - Mono leaseIDMono = setupShareLeaseAsyncCondition(shareClient, RECEIVED_LEASE_ID); - Mono> changeLeaseResponseMono = leaseIDMono.flatMap(leaseID -> { - ShareLeaseAsyncClient leaseClient = createLeaseClient(shareClient, leaseID); - String newLeaseId = testResourceNamer.randomUuid(); - return leaseClient.changeLeaseWithResponse(newLeaseId, null); - }); - - StepVerifier.create(changeLeaseResponseMono.flatMap(changeLeaseResponse -> { - String newLeaseId = changeLeaseResponse.getValue(); - assertEquals(newLeaseId, changeLeaseResponse.getValue()); - assertEquals(newLeaseId, createLeaseClient(shareClient, newLeaseId).getLeaseId()); - return createLeaseClient(shareClient, newLeaseId).releaseLeaseWithResponse(null); - }).flatMap(releaseLeaseResponse -> { - assertEquals(200, releaseLeaseResponse.getStatusCode()); - return Mono.empty(); - })).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void changeShareLeaseMin() { - StepVerifier - .create(setupShareLeaseAsyncCondition(shareAsyncClient, RECEIVED_LEASE_ID) - .flatMap(leaseID -> createLeaseClient(shareAsyncClient, leaseID) - .changeLeaseWithResponse(testResourceNamer.randomUuid(), null))) - .assertNext(response -> assertEquals(200, response.getStatusCode())) - .verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2020-02-10") - @Test - public void changeShareLeaseSnapshot() { - Mono shareSnapshotMono = shareAsyncClient.createSnapshot().map(ShareSnapshotInfo::getSnapshot); - Mono scMono = shareSnapshotMono - .map(snapshot -> shareBuilderHelper(shareAsyncClient.getShareName(), snapshot).buildAsyncClient()); - - StepVerifier.create(scMono.flatMap(sc -> setupShareLeaseAsyncCondition(sc, RECEIVED_LEASE_ID) - .flatMap( - leaseID -> createLeaseClient(sc, leaseID).changeLeaseWithResponse(testResourceNamer.randomUuid(), null)) - .flatMap(resp -> { - assertEquals(200, resp.getStatusCode()); - return createLeaseClient(sc, resp.getValue()).releaseLeaseWithResponse(null); - }))).expectNextCount(1).verifyComplete(); - } - - @Test - public void changeShareLeaseSnapshotFail() { - String shareSnapshot = "2020-08-19T19:26:08.0000000Z"; - ShareAsyncClient sc = shareBuilderHelper(shareAsyncClient.getShareName(), shareSnapshot).buildAsyncClient(); - StepVerifier.create(createLeaseClient(sc).changeLease(testResourceNamer.randomUuid())) - .expectError(ShareStorageException.class) - .verify(); - } - - @Test - public void changeShareLeaseError() { - ShareAsyncClient shareAsyncClient = shareBuilderHelper(generateShareName()).buildAsyncClient(); - StepVerifier.create(createLeaseClient(shareAsyncClient, "id").changeLease("id")) - .expectError(ShareStorageException.class) - .verify(); - } -} diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index fc1f72a4be8b5..04e520502d78b 100644 --- a/sdk/storage/azure-storage-file-share/swagger/README.md +++ b/sdk/storage/azure-storage-file-share/swagger/README.md @@ -15,21 +15,27 @@ autorest ### Code generation settings ``` yaml -use: '@autorest/java@4.1.42' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/refs/heads/main/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-01-05/file.json +use: '@autorest/java@4.1.39' +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-01-05/file.json java: true output-folder: ../ namespace: com.azure.storage.file.share generate-client-as-impl: true +generate-client-interfaces: false +service-interface-as-public: true license-header: MICROSOFT_MIT_SMALL enable-sync-stack: true +context-client-method-parameter: true default-http-exception-type: com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal models-subpackage: implementation.models custom-types-subpackage: models custom-types: ShareFileHttpHeaders,ShareServiceProperties,ShareCorsRule,Range,FileRange,ClearRange,ShareFileRangeList,CopyStatusType,ShareSignedIdentifier,SourceModifiedAccessConditions,ShareErrorCode,StorageServiceProperties,ShareMetrics,ShareAccessPolicy,ShareFileDownloadHeaders,LeaseDurationType,LeaseStateType,LeaseStatusType,PermissionCopyModeType,ShareAccessTier,ShareRootSquash,ShareRetentionPolicy,ShareProtocolSettings,ShareSmbSettings,SmbMultichannel,FileLastWrittenMode,ShareTokenIntent,AccessRight,FilePermissionFormat customization-class: src/main/java/ShareStorageCustomization.java +generic-response-type: true use-input-stream-for-binary: true +no-custom-headers: true disable-client-builder: true +stream-style-serialization: true ``` ### Query Parameters @@ -396,15 +402,6 @@ directive: const op = $["/{shareName}/{fileName}?comp=range&fromURL"]; op.put.responses["201"].headers["x-ms-file-last-write-time"].format = "date-time"; ``` - -### Change ShareFileRangeList XML name to Ranges -``` yaml -directive: -- from: swagger-document - where: $.definitions.ShareFileRangeList - transform: > - $.xml = {"name": "Ranges"}; -``` ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-file-share%2Fswagger%2FREADME.png) diff --git a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java index 53b477a9474b2..1bba8b5d2b173 100644 --- a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java +++ b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java @@ -8,6 +8,7 @@ import com.github.javaparser.ParseProblemException; import com.github.javaparser.StaticJavaParser; import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.body.Parameter; import com.github.javaparser.ast.stmt.BlockStmt; @@ -36,7 +37,132 @@ public void customize(LibraryCustomization customization, Logger logger) { models.getClass("AccessRight").rename("ShareFileHandleAccessRights"); + customizeShareFileRangeList(models.getClass("ShareFileRangeList")); + customizeFilesAndDirectoriesListSegment( + customization.getPackage("com.azure.storage.file.share.implementation.models") + .getClass("FilesAndDirectoriesListSegment")); + updateImplToMapInternalException(customization.getPackage("com.azure.storage.file.share.implementation")); + + addMissingHashMapImport(customization.getPackage("com.azure.storage.file.share.implementation.models")); + } + + // ShareFileRangeList has special serialization behaviors which Swagger cannot define correctly. It has a single + // outer XML element "" which can contain a list of both "" and "" elements, + // intermixed. Swagger isn't capable of defining this, so it ends up thinking there are two separate lists wrapped + // with "" and "". We need to manually correct this. + private static void customizeShareFileRangeList(ClassCustomization classCustomization) { + classCustomization.customizeAst(ast -> { + ClassOrInterfaceDeclaration clazz = ast.getClassByName(classCustomization.getClassName()).get(); + + clazz.getMethodsBySignature("toXml", "XmlWriter", "String").get(0) + .setBody(StaticJavaParser.parseBlock(String.join("\n", + "{", + "rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Ranges\" : rootElementName;", + "xmlWriter.writeStartElement(rootElementName);", + "if (this.ranges != null) {", + " for (FileRange element : this.ranges) {", + " xmlWriter.writeXml(element, \"Range\");", + " }", + "}", + "if (this.clearRanges != null) {", + " for (ClearRange element : this.clearRanges) {", + " xmlWriter.writeXml(element, \"ClearRange\");", + " }", + "}", + "return xmlWriter.writeEndElement();", + "}" + ))); + + clazz.getMethodsBySignature("fromXml", "XmlReader", "String").get(0) + .setBody(StaticJavaParser.parseBlock(String.join("\n", + "{", + "String finalRootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Ranges\" : rootElementName;", + "return xmlReader.readObject(finalRootElementName, reader -> {", + " ShareFileRangeList deserializedShareFileRangeList = new ShareFileRangeList();", + " while (reader.nextElement() != XmlToken.END_ELEMENT) {", + " QName elementName = reader.getElementName();", + "", + " if (\"Range\".equals(elementName.getLocalPart())) {", + " if (deserializedShareFileRangeList.ranges == null) {", + " deserializedShareFileRangeList.ranges = new ArrayList<>();", + " }", + " deserializedShareFileRangeList.ranges.add(FileRange.fromXml(reader, \"Range\"));", + " } else if (\"ClearRange\".equals(elementName.getLocalPart())) {", + " if (deserializedShareFileRangeList.clearRanges == null) {", + " deserializedShareFileRangeList.clearRanges = new ArrayList<>();", + " }", + " deserializedShareFileRangeList.clearRanges.add(ClearRange.fromXml(reader, \"ClearRange\"));", + " } else {", + " reader.skipElement();", + " }", + " }", + "", + " return deserializedShareFileRangeList;", + "});", + "}" + ))); + }); + } + + // FilesAndDirectoriesListSegment has special serialization behaviors which Swagger cannot define correctly. It has + // a single outer XML element "" which can contain a list of both "" and "" elements, + // intermixed. Swagger isn't capable of defining this, so it ends up thinking there are two separate lists wrapped + // with "" and "". We need to manually correct this. + private static void customizeFilesAndDirectoriesListSegment(ClassCustomization classCustomization) { + classCustomization.customizeAst(ast -> { + ClassOrInterfaceDeclaration clazz = ast.getClassByName(classCustomization.getClassName()).get(); + + clazz.getMethodsBySignature("toXml", "XmlWriter", "String").get(0) + .setBody(StaticJavaParser.parseBlock(String.join("\n", + "{", + "rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Entries\" : rootElementName;", + "xmlWriter.writeStartElement(rootElementName);", + "if (this.directoryItems != null) {", + " for (DirectoryItem element : this.directoryItems) {", + " xmlWriter.writeXml(element, \"Directory\");", + " }", + "}", + "if (this.fileItems != null) {", + " for (FileItem element : this.fileItems) {", + " xmlWriter.writeXml(element, \"File\");", + " }", + "}", + "return xmlWriter.writeEndElement();", + "}" + ))); + + clazz.getMethodsBySignature("fromXml", "XmlReader", "String").get(0) + .setBody(StaticJavaParser.parseBlock(String.join("\n", + "{", + "String finalRootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? \"Entries\" : rootElementName;", + "return xmlReader.readObject(finalRootElementName, reader -> {", + " FilesAndDirectoriesListSegment deserializedFilesAndDirectoriesListSegment", + " = new FilesAndDirectoriesListSegment();", + " while (reader.nextElement() != XmlToken.END_ELEMENT) {", + " QName elementName = reader.getElementName();", + "", + " if (\"Directory\".equals(elementName.getLocalPart())) {", + " if (deserializedFilesAndDirectoriesListSegment.directoryItems == null) {", + " deserializedFilesAndDirectoriesListSegment.directoryItems = new ArrayList<>();", + " }", + " deserializedFilesAndDirectoriesListSegment.directoryItems", + " .add(DirectoryItem.fromXml(reader, \"Directory\"));", + " } else if (\"File\".equals(elementName.getLocalPart())) {", + " if (deserializedFilesAndDirectoriesListSegment.fileItems == null) {", + " deserializedFilesAndDirectoriesListSegment.fileItems = new ArrayList<>();", + " }", + " deserializedFilesAndDirectoriesListSegment.fileItems.add(FileItem.fromXml(reader, \"File\"));", + " } else {", + " reader.skipElement();", + " }", + " }", + "", + " return deserializedFilesAndDirectoriesListSegment;", + "});", + "}" + ))); + }); } /** @@ -141,4 +267,11 @@ private static void addErrorMappingToSyncMethod(MethodDeclaration method) { // Replace the last statement with the try-catch block. method.setBody(new BlockStmt(new NodeList<>(tryCatchMap))); } + + // Temporary fix to a bug in Autorest. + private static void addMissingHashMapImport(PackageCustomization implementationModels) { + for (String className : Arrays.asList("FilesDownloadHeaders", "FilesGetPropertiesHeaders", "DirectoriesGetPropertiesHeaders", "SharesGetPropertiesHeaders")) { + implementationModels.getClass(className).addImports("java.util.HashMap"); + } + } } diff --git a/sdk/storage/azure-storage-internal-avro/CHANGELOG.md b/sdk/storage/azure-storage-internal-avro/CHANGELOG.md index 82389ac831e8e..69fe7bb6c55de 100644 --- a/sdk/storage/azure-storage-internal-avro/CHANGELOG.md +++ b/sdk/storage/azure-storage-internal-avro/CHANGELOG.md @@ -1,14 +1,14 @@ # Release History -## 12.15.0-beta.1 (Unreleased) +## 12.14.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-storage-common` from `12.28.0` to version `12.29.0-beta.1`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. -### Other Changes ## 12.14.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-internal-avro/pom.xml b/sdk/storage/azure-storage-internal-avro/pom.xml index d9b1e5bbf65fb..97270350481fc 100644 --- a/sdk/storage/azure-storage-internal-avro/pom.xml +++ b/sdk/storage/azure-storage-internal-avro/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-internal-avro - 12.15.0-beta.1 + 12.14.1 Microsoft Azure internal Avro module for Storage This module contains internal use only avro parser code based for Microsoft Azure Storage client libraries. @@ -63,7 +63,7 @@ com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 @@ -75,7 +75,7 @@ com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index 294155b317337..5c86ec76b5a61 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -25,25 +25,25 @@ com.azure azure-storage-blob - 12.30.0-beta.1 + 12.29.1 com.azure azure-storage-blob-cryptography - 12.29.0-beta.1 + 12.28.1 com.azure azure-storage-file-datalake - 12.23.0-beta.1 + 12.22.1 com.azure azure-storage-file-share - 12.26.0-beta.1 + 12.25.2 diff --git a/sdk/storage/azure-storage-queue/CHANGELOG.md b/sdk/storage/azure-storage-queue/CHANGELOG.md index 108eafd582563..7ba70fe36c030 100644 --- a/sdk/storage/azure-storage-queue/CHANGELOG.md +++ b/sdk/storage/azure-storage-queue/CHANGELOG.md @@ -1,14 +1,15 @@ # Release History -## 12.25.0-beta.1 (Unreleased) +## 12.24.1 (2025-01-16) -### Features Added +### Other Changes -### Breaking Changes +#### Dependency Updates -### Bugs Fixed +- Upgraded `azure-storage-common` from `12.28.0` to version `12.29.0-beta.1`. +- Upgraded `azure-core-http-netty` from `1.15.6` to version `1.15.7`. +- Upgraded `azure-core` from `1.54.0` to version `1.54.1`. -### Other Changes ## 12.24.0 (2024-11-13) diff --git a/sdk/storage/azure-storage-queue/README.md b/sdk/storage/azure-storage-queue/README.md index 3bd80038a7cb5..28bdfbcde47bb 100644 --- a/sdk/storage/azure-storage-queue/README.md +++ b/sdk/storage/azure-storage-queue/README.md @@ -54,7 +54,7 @@ add the direct dependency to your project as follows. com.azure azure-storage-queue - 12.24.0 + 12.24.1 ``` [//]: # ({x-version-update-end}) @@ -487,15 +487,15 @@ For details on contributing to this repository, see the [contributing guide](htt [source_code]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-queue/src [samples_readme]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-queue/src/samples/README.md -[api_documentation]: https://learn.microsoft.com/rest/api/storageservices/queue-service-rest-api -[storage_docs]: https://learn.microsoft.com/azure/storage/queues/storage-queues-introduction -[jdk]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable +[api_documentation]: https://docs.microsoft.com/rest/api/storageservices/queue-service-rest-api +[storage_docs]: https://docs.microsoft.com/azure/storage/queues/storage-queues-introduction +[jdk]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable [maven]: https://maven.apache.org/ [azure_subscription]: https://azure.microsoft.com/free/ -[storage_account]: https://learn.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal -[azure_cli]: https://learn.microsoft.com/cli/azure -[sas_token]: https://learn.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 -[storage_rest]: https://learn.microsoft.com/rest/api/storageservices/queue-service-error-codes +[storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal +[azure_cli]: https://docs.microsoft.com/cli/azure +[sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[storage_rest]: https://docs.microsoft.com/rest/api/storageservices/queue-service-error-codes [samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/storage/azure-storage-queue/src/samples [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning diff --git a/sdk/storage/azure-storage-queue/pom.xml b/sdk/storage/azure-storage-queue/pom.xml index ee420d8d72fde..8ddb45176d78b 100644 --- a/sdk/storage/azure-storage-queue/pom.xml +++ b/sdk/storage/azure-storage-queue/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-queue - 12.25.0-beta.1 + 12.24.1 Microsoft Azure client library for Queue Storage This module contains client library for Microsoft Azure Queue Storage. @@ -76,13 +76,13 @@ com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 com.azure azure-storage-common - 12.29.0-beta.1 + 12.28.1 tests test-jar test diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java index 7b61c3e002eec..617e0e00fb890 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/models/QueuesGetPropertiesHeaders.java @@ -10,7 +10,7 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.util.DateTimeRfc1123; import java.time.OffsetDateTime; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.Map; /** @@ -65,7 +65,7 @@ public QueuesGetPropertiesHeaders(HttpHeaders rawHeaders) { if (date != null) { this.date = new DateTimeRfc1123(date); } - Map xMsMetaHeaderCollection = new LinkedHashMap<>(); + Map xMsMetaHeaderCollection = new HashMap<>(); for (HttpHeader header : rawHeaders) { String headerName = header.getName(); diff --git a/sdk/storage/azure-storage-queue/src/samples/README.md b/sdk/storage/azure-storage-queue/src/samples/README.md index 38a450431f6f9..8ebd23535c8f1 100644 --- a/sdk/storage/azure-storage-queue/src/samples/README.md +++ b/sdk/storage/azure-storage-queue/src/samples/README.md @@ -50,8 +50,8 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [samples_message]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/MessageSamples.java [samples_queue_exception]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueExceptionSamples.java [samples_async]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/AsyncSamples.java -[storage_queue_rest]: https://learn.microsoft.com/rest/api/storageservices/queue-service-rest-api -[error_codes]: https://learn.microsoft.com/rest/api/storageservices/blob-service-error-codes +[storage_queue_rest]: https://docs.microsoft.com/rest/api/storageservices/queue-service-rest-api +[error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes [queue_key_concept]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-queue/README.md#key-concepts [samples]: java/samples/ diff --git a/sdk/storage/azure-storage-queue/swagger/README.md b/sdk/storage/azure-storage-queue/swagger/README.md index 4e08626e8b407..69d13912037dd 100644 --- a/sdk/storage/azure-storage-queue/swagger/README.md +++ b/sdk/storage/azure-storage-queue/swagger/README.md @@ -14,21 +14,28 @@ autorest ### Code generation settings ``` yaml -use: '@autorest/java@4.1.42' +use: '@autorest/java@4.1.39' input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.QueueStorage/preview/2018-03-28/queue.json java: true output-folder: ../ namespace: com.azure.storage.queue +enable-xml: true generate-client-as-impl: true +generate-client-interfaces: false +service-interface-as-public: true license-header: MICROSOFT_MIT_SMALL enable-sync-stack: true +context-client-method-parameter: true default-http-exception-type: com.azure.storage.queue.implementation.models.QueueStorageExceptionInternal models-subpackage: implementation.models custom-types: QueueErrorCode,QueueSignedIdentifier,SendMessageResult,QueueMessageItem,PeekedMessageItem,QueueItem,QueueServiceProperties,QueueServiceStatistics,QueueCorsRule,QueueAccessPolicy,QueueAnalyticsLogging,QueueMetrics,QueueRetentionPolicy,GeoReplicationStatus,GeoReplicationStatusType,GeoReplication custom-types-subpackage: models customization-class: src/main/java/QueueStorageCustomization.java +generic-response-type: true use-input-stream-for-binary: true +no-custom-headers: true disable-client-builder: true +stream-style-serialization: true ``` ### Rename MessageItems diff --git a/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java b/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java index 18a17ce4d23a2..8f4a60b188ebd 100644 --- a/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java +++ b/sdk/storage/azure-storage-queue/swagger/src/main/java/QueueStorageCustomization.java @@ -27,6 +27,7 @@ public class QueueStorageCustomization extends Customization { @Override public void customize(LibraryCustomization customization, Logger logger) { updateImplToMapInternalException(customization.getPackage("com.azure.storage.queue.implementation")); + addMissingHashMapImport(customization.getPackage("com.azure.storage.queue.implementation.models")); } /** @@ -131,4 +132,9 @@ private static void addErrorMappingToSyncMethod(MethodDeclaration method) { // Replace the last statement with the try-catch block. method.setBody(new BlockStmt(new NodeList<>(tryCatchMap))); } + + // Temporary fix to a bug in Autorest. + private static void addMissingHashMapImport(PackageCustomization implementationModels) { + implementationModels.getClass("QueuesGetPropertiesHeaders").addImports("java.util.HashMap"); + } }