From 5c129b1f6a9887b095213755b270553e02bc2305 Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Mon, 24 Sep 2018 16:57:00 -0700 Subject: [PATCH 1/2] Fixed up api ref samples link and CI --- README.md | 3 +- .../blob/AccountSASSignatureValues.java | 2 +- .../azure/storage/blob/AppendBlobURL.java | 8 +-- .../microsoft/azure/storage/blob/BlobURL.java | 60 +++++++++---------- .../azure/storage/blob/BlobURLParts.java | 2 +- .../azure/storage/blob/BlockBlobURL.java | 20 +++---- .../azure/storage/blob/ContainerURL.java | 54 ++++++++--------- .../azure/storage/blob/LoggingOptions.java | 2 +- .../azure/storage/blob/PageBlobURL.java | 28 ++++----- .../azure/storage/blob/PipelineOptions.java | 2 +- .../storage/blob/RequestRetryOptions.java | 2 +- .../blob/ServiceSASSignatureValues.java | 2 +- .../azure/storage/blob/ServiceURL.java | 22 +++---- .../azure/storage/blob/StorageException.java | 2 +- .../azure/storage/blob/StorageURL.java | 2 +- .../azure/storage/blob/TransferManager.java | 4 +- .../azure/storage/BlockBlobAPITest.groovy | 1 - .../azure/storage/ContainerAPITest.groovy | 25 ++++---- 18 files changed, 120 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index fa6f8625b8e81..8c6f1b860f7e0 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,11 @@ To get the source code of the SDK via git just type: git clone git://github.com/Azure/azure-storage-java.git cd ./azure-storage-java - git checkout vNext mvn compile ### Option 3: Source Zip -To download a copy of the source code, use the drop down menu on the left to select the branch vNext and click "Download ZIP" on the right side of the page or click [here](https://github.com/Azure/azure-storage-java/archive/master.zip). Unzip and navigate to the microsoft-azure-storage folder. +To download a copy of the source code, click "Download ZIP" on the right side of the page or click [here](https://github.com/Azure/azure-storage-java/archive/master.zip). Unzip and navigate to the microsoft-azure-storage folder. ## Minimum Requirements diff --git a/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java b/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java index c24c398beb544..79105d548cd7e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java +++ b/src/main/java/com/microsoft/azure/storage/blob/AccountSASSignatureValues.java @@ -35,7 +35,7 @@ * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_sas "Sample code for AccountSASSignatureValues")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class AccountSASSignatureValues { diff --git a/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java index 5156e2117248a..bad92a443aea9 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/AppendBlobURL.java @@ -101,7 +101,7 @@ public AppendBlobURL withSnapshot(String snapshot) throws MalformedURLException, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=append_blob "Sample code for AppendBlobURL.create")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single create() { return this.create(null, null, null, null); @@ -128,7 +128,7 @@ public Single create() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=append_blob "Sample code for AppendBlobURL.create")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single create(BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Context context) { @@ -159,7 +159,7 @@ public Single create(BlobHTTPHeaders headers, Metadata * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=append_blob "Sample code for AppendBlobURL.appendBlock")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single appendBlock(Flowable data, long length) { return this.appendBlock(data, length, null, null); @@ -191,7 +191,7 @@ public Single appendBlock(Flowable da * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=append_blob "Sample code for AppendBlobURL.appendBlock")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single appendBlock(Flowable data, long length, AppendBlobAccessConditions appendBlobAccessConditions, Context context) { diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java index 878a52c141f8f..50408cfa737bb 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java @@ -136,7 +136,7 @@ public PageBlobURL toPageBlobURL() { * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=start_copy "Sample code for BlobURL.startCopyFromURL")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=start_copy_helper "Helper for start_copy sample.")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single startCopyFromURL(URL sourceURL) { return this.startCopyFromURL(sourceURL, null, null, null, null); @@ -168,7 +168,7 @@ public Single startCopyFromURL(URL sourceURL) { * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=start_copy "Sample code for BlobURL.startCopyFromURL")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=start_copy_helper "Helper for start_copy sample.")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single startCopyFromURL(URL sourceURL, Metadata metadata, ModifiedAccessConditions sourceModifiedAccessConditions, BlobAccessConditions destAccessConditions, @@ -203,7 +203,7 @@ public Single startCopyFromURL(URL sourceURL, Meta * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=abort_copy "Sample code for BlobURL.abortCopyFromURL")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single abortCopyFromURL(String copyId) { return this.abortCopyFromURL(copyId, null, null); @@ -230,7 +230,7 @@ public Single abortCopyFromURL(String copyId) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=abort_copy "Sample code for BlobURL.abortCopyFromURL")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single abortCopyFromURL(String copyId, LeaseAccessConditions leaseAccessConditions, Context context) { @@ -270,7 +270,7 @@ public Single download() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlobURL.download")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single download(BlobRange range) { return this.download(range, null, false, null); @@ -300,7 +300,7 @@ public Single download(BlobRange range) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlobURL.download")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single download(BlobRange range, BlobAccessConditions accessConditions, boolean rangeGetContentMD5, Context context) { @@ -365,7 +365,7 @@ public Single delete() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_delete "Sample code for BlobURL.delete")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single delete(DeleteSnapshotsOptionType deleteBlobSnapshotOptions, BlobAccessConditions accessConditions, Context context) { @@ -385,7 +385,7 @@ public Single delete(DeleteSnapshotsOptionType deleteBlobSna * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.getProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getProperties() { return this.getProperties(null, null); @@ -407,7 +407,7 @@ public Single getProperties() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.getProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getProperties(BlobAccessConditions accessConditions, Context context) { accessConditions = accessConditions == null ? BlobAccessConditions.NONE : accessConditions; @@ -429,7 +429,7 @@ public Single getProperties(BlobAccessConditions acce * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.setHTTPHeaders")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setHTTPHeaders(BlobHTTPHeaders headers) { return this.setHTTPHeaders(headers, null, null); @@ -453,7 +453,7 @@ public Single setHTTPHeaders(BlobHTTPHeaders headers * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.setHTTPHeaders")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setHTTPHeaders(BlobHTTPHeaders headers, BlobAccessConditions accessConditions, Context context) { @@ -475,7 +475,7 @@ public Single setHTTPHeaders(BlobHTTPHeaders headers * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.setMetadata")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setMetadata(Metadata metadata) { return this.setMetadata(metadata, null, null); @@ -499,7 +499,7 @@ public Single setMetadata(Metadata metadata) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=properties_metadata "Sample code for BlobURL.setMetadata")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setMetadata(Metadata metadata, BlobAccessConditions accessConditions, Context context) { @@ -519,7 +519,7 @@ public Single setMetadata(Metadata metadata, BlobAccess * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=snapshot "Sample code for BlobURL.createSnapshot")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single createSnapshot() { return this.createSnapshot(null, null, null); @@ -543,7 +543,7 @@ public Single createSnapshot() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=snapshot "Sample code for BlobURL.createSnapshot")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single createSnapshot(Metadata metadata, BlobAccessConditions accessConditions, Context context) { @@ -570,7 +570,7 @@ public Single createSnapshot(Metadata metadata, Blob * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tier "Sample code for BlobURL.setTier")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setTier(AccessTier tier) { return this.setTier(tier, null, null); @@ -599,7 +599,7 @@ public Single setTier(AccessTier tier) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tier "Sample code for BlobURL.setTier")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setTier(AccessTier tier, LeaseAccessConditions leaseAccessConditions, Context context) { @@ -618,7 +618,7 @@ public Single setTier(AccessTier tier, LeaseAccessCondition * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=undelete "Sample code for BlobURL.undelete")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single undelete() { return this.undelete(null); @@ -639,7 +639,7 @@ public Single undelete() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=undelete "Sample code for BlobURL.undelete")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single undelete(Context context) { context = context == null ? Context.NONE : context; @@ -662,7 +662,7 @@ public Single undelete(Context context) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.acquireLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single acquireLease(String proposedId, int duration) { return this.acquireLease(proposedId, duration, null, null); @@ -692,7 +692,7 @@ public Single acquireLease(String proposedId, int dura * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.acquireLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single acquireLease(String proposedID, int duration, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -717,7 +717,7 @@ public Single acquireLease(String proposedID, int dura * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.renewLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single renewLease(String leaseID) { return this.renewLease(leaseID, null, null); @@ -743,7 +743,7 @@ public Single renewLease(String leaseID) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.renewLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single renewLease(String leaseID, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -763,7 +763,7 @@ public Single renewLease(String leaseID, ModifiedAccessC * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.releaseLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single releaseLease(String leaseID) { return this.releaseLease(leaseID, null, null); @@ -789,7 +789,7 @@ public Single releaseLease(String leaseID) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.releaseLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single releaseLease(String leaseID, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -841,7 +841,7 @@ public Single breakLease() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.breakLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single breakLease(Integer breakPeriodInSeconds, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -863,7 +863,7 @@ public Single breakLease(Integer breakPeriodInSeconds, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.changeLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single changeLease(String leaseId, String proposedID) { return this.changeLease(leaseId, proposedID, null, null); @@ -891,7 +891,7 @@ public Single changeLease(String leaseId, String propos * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blob_lease "Sample code for BlobURL.changeLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single changeLease(String leaseId, String proposedID, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -908,7 +908,7 @@ public Single changeLease(String leaseId, String propos * * @apiNote ## Sample code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_info "Sample code for BlobURL.getAccountInfo")] \n - * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccountInfo() { return this.getAccountInfo(null); @@ -928,7 +928,7 @@ public Single getAccountInfo() { * * @apiNote ## Sample code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_info "Sample code for BlobURL.getAccountInfo")] \n - * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccountInfo(Context context) { context = context == null ? Context.NONE : context; diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java b/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java index 0ee1fe2ae689b..30ecca5e6131b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlobURLParts.java @@ -29,7 +29,7 @@ * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=url_parts "Sample code for BlobURLParts")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class BlobURLParts { diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java index 0ada5476cd70b..73105ddd98522 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlockBlobURL.java @@ -120,7 +120,7 @@ public BlockBlobURL withSnapshot(String snapshot) throws MalformedURLException, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlockBlobURL.upload")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single upload(Flowable data, long length) { return this.upload(data, length, null, null, null, null); @@ -162,7 +162,7 @@ public Single upload(Flowable data, long le * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlockBlobURL.upload")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single upload(Flowable data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Context context) { @@ -197,7 +197,7 @@ public Single upload(Flowable data, long le * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.stageBlock")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single stageBlock(String base64BlockID, Flowable data, long length) { @@ -235,7 +235,7 @@ public Single stageBlock(String base64BlockID, Flow * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.stageBlock")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single stageBlock(String base64BlockID, Flowable data, long length, LeaseAccessConditions leaseAccessConditions, Context context) { @@ -264,7 +264,7 @@ public Single stageBlock(String base64BlockID, Flow * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=block_from_url "Sample code for BlockBlobURL.stageBlockFromURL")] - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange) { @@ -302,7 +302,7 @@ public Single stageBlockFromURL(String base6 * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=block_from_url "Sample code for BlockBlobURL.stageBlockFromURL")] - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange, byte[] sourceContentMD5, LeaseAccessConditions leaseAccessConditions, @@ -328,7 +328,7 @@ public Single stageBlockFromURL(String base6 * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.getBlockList")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getBlockList(BlockListType listType) { return this.getBlockList(listType, null, null); @@ -355,7 +355,7 @@ public Single getBlockList(BlockListType listType * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.getBlockList")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getBlockList(BlockListType listType, LeaseAccessConditions leaseAccessConditions, Context context) { @@ -383,7 +383,7 @@ public Single getBlockList(BlockListType listType * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.commitBlockList")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single commitBlockList(List base64BlockIDs) { return this.commitBlockList(base64BlockIDs, null, null, null, null); @@ -419,7 +419,7 @@ public Single commitBlockList(List bas * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.commitBlockList")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single commitBlockList(List base64BlockIDs, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Context context) { diff --git a/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java b/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java index cdca8550d4c8e..886953e34d95b 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ContainerURL.java @@ -172,7 +172,7 @@ public BlobURL createBlobURL(String blobName) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.create")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single create() { return this.create(null, null, null); @@ -199,7 +199,7 @@ public Single create() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.create")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single create(Metadata metadata, PublicAccessType accessType, Context context) { metadata = metadata == null ? Metadata.NONE : metadata; @@ -219,7 +219,7 @@ public Single create(Metadata metadata, PublicAccessTyp * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.delete")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single delete() { return this.delete(null, null); @@ -243,7 +243,7 @@ public Single delete() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.delete")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single delete(ContainerAccessConditions accessConditions, Context context) { accessConditions = accessConditions == null ? ContainerAccessConditions.NONE : accessConditions; @@ -268,7 +268,7 @@ public Single delete(ContainerAccessConditions accessCo * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.getProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getProperties() { return this.getProperties(null, null); @@ -292,7 +292,7 @@ public Single getProperties() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.getProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getProperties(LeaseAccessConditions leaseAccessConditions, Context context) { @@ -313,7 +313,7 @@ public Single getProperties(LeaseAccessCondition * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.setMetadata")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setMetadata(Metadata metadata) { return this.setMetadata(metadata, null, null); @@ -338,7 +338,7 @@ public Single setMetadata(Metadata metadata) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_basic "Sample code for ContainerURL.setMetadata")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setMetadata(Metadata metadata, ContainerAccessConditions accessConditions, Context context) { @@ -367,7 +367,7 @@ public Single setMetadata(Metadata metadata, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_policy "Sample code for ContainerURL.getAccessPolicy")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccessPolicy() { return this.getAccessPolicy(null, null); @@ -392,7 +392,7 @@ public Single getAccessPolicy() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_policy "Sample code for ContainerURL.getAccessPolicy")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccessPolicy(LeaseAccessConditions leaseAccessConditions, Context context) { @@ -420,7 +420,7 @@ public Single getAccessPolicy(LeaseAccessCondi * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_policy "Sample code for ContainerURL.setAccessPolicy")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setAccessPolicy(PublicAccessType accessType, List identifiers) { @@ -453,7 +453,7 @@ public Single setAccessPolicy(PublicAccessType * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_policy "Sample code for ContainerURL.setAccessPolicy")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setAccessPolicy(PublicAccessType accessType, List identifiers, ContainerAccessConditions accessConditions, Context context) { @@ -517,7 +517,7 @@ private boolean validateNoEtag(ModifiedAccessConditions modifiedAccessConditions * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.acquireLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single acquireLease(String proposedId, int duration) { return this.acquireLease(proposedId, duration, null, null); @@ -548,7 +548,7 @@ public Single acquireLease(String proposedId, int * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.acquireLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single acquireLease(String proposedID, int duration, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -575,7 +575,7 @@ public Single acquireLease(String proposedID, int * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.renewLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single renewLease(String leaseID) { return this.renewLease(leaseID, null, null); @@ -602,7 +602,7 @@ public Single renewLease(String leaseID) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.renewLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single renewLease(String leaseID, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -629,7 +629,7 @@ public Single renewLease(String leaseID, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.releaseLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single releaseLease(String leaseID) { return this.releaseLease(leaseID, null, null); @@ -656,7 +656,7 @@ public Single releaseLease(String leaseID) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.releaseLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single releaseLease(String leaseID, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -711,7 +711,7 @@ public Single breakLease() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.breakLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single breakLease(Integer breakPeriodInSeconds, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -740,7 +740,7 @@ public Single breakLease(Integer breakPeriodInSecon * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.changeLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single changeLease(String leaseID, String proposedID) { return this.changeLease(leaseID, proposedID, null, null); @@ -769,7 +769,7 @@ public Single changeLease(String leaseID, String p * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=container_lease "Sample code for ContainerURL.changeLease")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single changeLease(String leaseID, String proposedID, ModifiedAccessConditions modifiedAccessConditions, Context context) { @@ -804,7 +804,7 @@ public Single changeLease(String leaseID, String p * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_flat "Sample code for ContainerURL.listBlobsFlatSegment")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_flat_helper "helper code for ContainerURL.listBlobsFlatSegment")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single listBlobsFlatSegment(String marker, ListBlobsOptions options) { return this.listBlobsFlatSegment(marker, options, null); @@ -835,7 +835,7 @@ public Single listBlobsFlatSegment(String * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_flat "Sample code for ContainerURL.listBlobsFlatSegment")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_flat_helper "helper code for ContainerURL.listBlobsFlatSegment")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single listBlobsFlatSegment(String marker, ListBlobsOptions options, Context context) { @@ -871,7 +871,7 @@ public Single listBlobsFlatSegment(String * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_hierarchy "Sample code for ContainerURL.listBlobsHierarchySegment")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_hierarchy_helper "helper code for ContainerURL.listBlobsHierarchySegment")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single listBlobsHierarchySegment(String marker, String delimiter, ListBlobsOptions options) { @@ -907,7 +907,7 @@ public Single listBlobsHierarchySegme * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_hierarchy "Sample code for ContainerURL.listBlobsHierarchySegment")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=list_blobs_hierarchy_helper "helper code for ContainerURL.listBlobsHierarchySegment")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single listBlobsHierarchySegment(String marker, String delimiter, ListBlobsOptions options, Context context) { @@ -931,7 +931,7 @@ public Single listBlobsHierarchySegme * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_info "Sample code for ContainerURL.getAccountInfo")] \n - * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccountInfo() { return this.getAccountInfo(null); @@ -952,7 +952,7 @@ public Single getAccountInfo() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_info "Sample code for ContainerURL.getAccountInfo")] \n - * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccountInfo(Context context) { context = context == null ? Context.NONE : context; diff --git a/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java b/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java index ac57aab479971..047e18d8d0444 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/LoggingOptions.java @@ -34,7 +34,7 @@ public final class LoggingOptions { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=pipeline_options "Sample code for LoggingOptions constructor")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public LoggingOptions(long minDurationToLogSlowRequestsInMs) { this.minDurationToLogSlowRequestsInMs = minDurationToLogSlowRequestsInMs; diff --git a/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java index 9fa093bbc2ce4..9bb1729aab23e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/PageBlobURL.java @@ -121,7 +121,7 @@ public PageBlobURL withSnapshot(String snapshot) throws MalformedURLException, U * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.create")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single create(long size) { return this.create(size, null, null, null, null, null); @@ -155,7 +155,7 @@ public Single create(long size) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.create")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single create(long size, Long sequenceNumber, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Context context) { @@ -199,7 +199,7 @@ public Single create(long size, Long sequenceNumber, Blo * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.uploadPages")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single uploadPages(PageRange pageRange, Flowable body) { return this.uploadPages(pageRange, body, null, null); @@ -233,7 +233,7 @@ public Single uploadPages(PageRange pageRange, Flow * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.uploadPages")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single uploadPages(PageRange pageRange, Flowable body, PageBlobAccessConditions pageBlobAccessConditions, Context context) { @@ -269,7 +269,7 @@ public Single uploadPages(PageRange pageRange, Flow * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.clearPages")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single clearPages(PageRange pageRange) { return this.clearPages(pageRange, null, null); @@ -297,7 +297,7 @@ public Single clearPages(PageRange pageRange) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.clearPages")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single clearPages(PageRange pageRange, PageBlobAccessConditions pageBlobAccessConditions, Context context) { @@ -328,7 +328,7 @@ public Single clearPages(PageRange pageRange, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.getPageRanges")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getPageRanges(BlobRange blobRange) { return this.getPageRanges(blobRange, null, null); @@ -353,7 +353,7 @@ public Single getPageRanges(BlobRange blobRange) * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.getPageRanges")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getPageRanges(BlobRange blobRange, BlobAccessConditions accessConditions, Context context) { @@ -381,7 +381,7 @@ public Single getPageRanges(BlobRange blobRange, * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_diff "Sample code for PageBlobURL.getPageRangesDiff")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { return this.getPageRangesDiff(blobRange, prevSnapshot, null, null); @@ -410,7 +410,7 @@ public Single getPageRangesDiff(BlobRange blo * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_diff "Sample code for PageBlobURL.getPageRangesDiff")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getPageRangesDiff(BlobRange blobRange, String prevSnapshot, BlobAccessConditions accessConditions, Context context) { @@ -439,7 +439,7 @@ public Single getPageRangesDiff(BlobRange blo * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.resize")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single resize(long size) { return this.resize(size, null, null); @@ -465,7 +465,7 @@ public Single resize(long size) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.resize")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single resize(long size, BlobAccessConditions accessConditions, Context context) { if (size % PageBlobURL.PAGE_BYTES != 0) { @@ -495,7 +495,7 @@ public Single resize(long size, BlobAccessConditions acc * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.updateSequenceNumber")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single updateSequenceNumber(SequenceNumberActionType action, Long sequenceNumber) { @@ -524,7 +524,7 @@ public Single updateSequenceNumber(Sequenc * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=page_blob_basic "Sample code for PageBlobURL.updateSequenceNumber")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single updateSequenceNumber(SequenceNumberActionType action, Long sequenceNumber, BlobAccessConditions accessConditions, Context context) { diff --git a/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java b/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java index 3c1869255c60f..6d5a84f57f28e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/PipelineOptions.java @@ -49,7 +49,7 @@ public final class PipelineOptions { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=pipeline_options "Sample code for PipelineOptions constructor")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public PipelineOptions() { this.logger = new HttpPipelineLogger() { diff --git a/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java b/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java index 6eb281548ad42..5f31ffeb7f89e 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/RequestRetryOptions.java @@ -71,7 +71,7 @@ public final class RequestRetryOptions { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=pipeline_options "Sample code for RequestRetryOptions constructor")] \n - * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Integer tryTimeout, Long retryDelayInMs, Long maxRetryDelayInMs, String secondaryHost) { diff --git a/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java b/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java index aea2bf9436965..5be52477ea1bc 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ServiceSASSignatureValues.java @@ -32,7 +32,7 @@ * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_sas "Sample code for ServiceSASSignatureValues")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class ServiceSASSignatureValues { diff --git a/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java b/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java index 04ba859e50206..4646013cad4be 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/ServiceURL.java @@ -45,7 +45,7 @@ public final class ServiceURL extends StorageURL { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_url "Sample code for ServiceURL constructor")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public ServiceURL(URL url, HttpPipeline pipeline) { super(url, pipeline); @@ -95,7 +95,7 @@ public ServiceURL withPipeline(HttpPipeline pipeline) { * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_list "Sample code for ServiceURL.listContainersSegment")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_list_helper "Helper code for ServiceURL.listContainersSegment")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single listContainersSegment(String marker, ListContainersOptions options) { @@ -127,7 +127,7 @@ public Single listContainersSegment(String * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_list "Sample code for ServiceURL.listContainersSegment")] \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_list_helper "Helper code for ServiceURL.listContainersSegment")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single listContainersSegment(String marker, ListContainersOptions options, Context context) { @@ -147,7 +147,7 @@ public Single listContainersSegment(String * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_getsetprops "Sample code for ServiceURL.getProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getProperties() { return this.getProperties(null); @@ -168,7 +168,7 @@ public Single getProperties() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_getsetprops "Sample code for ServiceURL.getProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getProperties(Context context) { context = context == null ? Context.NONE : context; @@ -190,7 +190,7 @@ public Single getProperties(Context context) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_getsetprops "Sample code for ServiceURL.setProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setProperties(StorageServiceProperties properties) { return this.setProperties(properties, null); @@ -215,7 +215,7 @@ public Single setProperties(StorageServiceProperti * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_getsetprops "Sample code for ServiceURL.setProperties")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single setProperties(StorageServiceProperties properties, Context context) { context = context == null ? Context.NONE : context; @@ -235,7 +235,7 @@ public Single setProperties(StorageServiceProperti * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_stats "Sample code for ServiceURL.getStats")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getStatistics() { return this.getStatistics(null); @@ -258,7 +258,7 @@ public Single getStatistics() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_stats "Sample code for ServiceURL.getStats")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getStatistics(Context context) { context = context == null ? Context.NONE : context; @@ -275,7 +275,7 @@ public Single getStatistics(Context context) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_info "Sample code for ServiceURL.getAccountInfo")] \n - * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccountInfo() { return this.getAccountInfo(null); @@ -296,7 +296,7 @@ public Single getAccountInfo() { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=account_info "Sample code for ServiceURL.getAccountInfo")] \n - * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file] (https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public Single getAccountInfo(Context context) { context = context == null ? Context.NONE : context; diff --git a/src/main/java/com/microsoft/azure/storage/blob/StorageException.java b/src/main/java/com/microsoft/azure/storage/blob/StorageException.java index 0f0a442fae496..5dc55868ded70 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/StorageException.java +++ b/src/main/java/com/microsoft/azure/storage/blob/StorageException.java @@ -30,7 +30,7 @@ * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=exception "Sample code for StorageExceptions")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public final class StorageException extends RestException { diff --git a/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java b/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java index 384b594ac31ef..81c931606cd9c 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/StorageURL.java @@ -135,7 +135,7 @@ public static HttpPipeline createPipeline(PipelineOptions pipelineOptions) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=service_url "Sample code for StorageURL.createPipeline")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public static HttpPipeline createPipeline(ICredentials credentials, PipelineOptions pipelineOptions) { /* diff --git a/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java b/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java index dcc4921ecf9f5..45d0a8d16e9d1 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java +++ b/src/main/java/com/microsoft/azure/storage/blob/TransferManager.java @@ -66,7 +66,7 @@ public final class TransferManager { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tm_file "Sample code for TransferManager.uploadFileToBlockBlob")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public static Single uploadFileToBlockBlob( final AsynchronousFileChannel file, final BlockBlobURL blockBlobURL, final int blockLength, @@ -170,7 +170,7 @@ private static int calculateNumBlocks(long dataSize, long blockLength) { * * @apiNote ## Sample Code \n * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=tm_file "Sample code for TransferManager.downloadBlobToFile")] \n - * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/vNext/src/test/java/com/microsoft/azure/storage/Samples.java) + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) */ public static Single downloadBlobToFile(AsynchronousFileChannel file, BlobURL blobURL, BlobRange range, TransferManagerDownloadFromBlobOptions options) { diff --git a/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy b/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy index 85f1ceb8b51bf..9c151b4ef5a2a 100644 --- a/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/BlockBlobAPITest.groovy @@ -465,7 +465,6 @@ class BlockBlobAPITest extends APISpec { String blockID4 = getBlockID() bu.stageBlock(blockID3, defaultFlowable, defaultDataSize, null, null).blockingGet() bu.stageBlock(blockID4, defaultFlowable, defaultDataSize, null, null).blockingGet() - bu.commitBlockList(Arrays.asList(blockID3, blockID4), null, null, null, null).blockingGet() when: BlockBlobGetBlockListResponse response = bu.getBlockList(BlockListType.ALL, null, null) diff --git a/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy b/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy index 6661ab9a1bce5..c0c2ff2c17154 100644 --- a/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/ContainerAPITest.groovy @@ -276,7 +276,7 @@ class ContainerAPITest extends APISpec { cu.setMetadata(null, new ContainerAccessConditions().withModifiedAccessConditions(mac), null) then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: unmodified | match | noneMatch @@ -439,7 +439,7 @@ class ContainerAPITest extends APISpec { cu.setAccessPolicy(null, null, new ContainerAccessConditions().withModifiedAccessConditions(mac), null) then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch @@ -601,7 +601,7 @@ class ContainerAPITest extends APISpec { cu.delete(new ContainerAccessConditions().withModifiedAccessConditions(mac), null) then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch @@ -1059,12 +1059,13 @@ class ContainerAPITest extends APISpec { cu.listBlobsHierarchySegment(null, null, options, null) then: - thrown(IllegalArgumentException) + def e = thrown(Exception) + exceptionType.isInstance(e) where: - snapshots | maxResults - true | 5 - false | 0 + snapshots | maxResults | exceptionType + true | 5 | UnsupportedOperationException + false | 0 | IllegalArgumentException } def "List blobs hier delim"() { @@ -1202,7 +1203,7 @@ class ContainerAPITest extends APISpec { cu.acquireLease(null, -1, mac, null).blockingGet() then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch @@ -1300,7 +1301,7 @@ class ContainerAPITest extends APISpec { cu.renewLease(receivedLeaseID, mac, null).blockingGet() then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch @@ -1396,7 +1397,7 @@ class ContainerAPITest extends APISpec { cu.releaseLease(receivedLeaseID, mac, null).blockingGet() then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch @@ -1505,7 +1506,7 @@ class ContainerAPITest extends APISpec { cu.breakLease(null, mac, null).blockingGet() then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch @@ -1603,7 +1604,7 @@ class ContainerAPITest extends APISpec { cu.changeLease(receivedLeaseID, garbageLeaseID, mac, null).blockingGet() then: - thrown(IllegalArgumentException) + thrown(UnsupportedOperationException) where: match | noneMatch From 6d90a303b17a92e993bf2143080a0b7fd1e2621d Mon Sep 17 00:00:00 2001 From: rickle-msft Date: Wed, 26 Sep 2018 15:52:48 -0700 Subject: [PATCH 2/2] Added deep sync copy support --- ChangeLog.txt | 1 + .../azure/storage/GeneratedBlobs.java | 148 ++++++++++++ .../microsoft/azure/storage/blob/BlobURL.java | 66 +++++ .../blob/models/BlobCopyFromURLHeaders.java | 228 ++++++++++++++++++ .../blob/models/BlobCopyFromURLResponse.java | 41 ++++ .../blob/models/BlobGetPropertiesHeaders.java | 4 +- .../SourceModifiedAccessConditions.java | 3 +- .../blob/models/SyncCopyStatusType.java | 56 +++++ .../azure/storage/BlobAPITest.groovy | 206 ++++++++++++++-- .../com/microsoft/azure/storage/Samples.java | 12 + 10 files changed, 745 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLHeaders.java create mode 100644 src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLResponse.java create mode 100644 src/main/java/com/microsoft/azure/storage/blob/models/SyncCopyStatusType.java diff --git a/ChangeLog.txt b/ChangeLog.txt index 61607c49a7aee..37942a4ee8a36 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,7 @@ XXXX.XX.XX Version XX.X.X * Added overloads which only accept the required parameters. * TransferManager options now throw if an IProgressReceiver is passed as it is not currently supported. Support will be added in a later release. +* Added CopyFromURL, which will do a synchronous server-side copy, meaning the service will not return an HTTP response until it has completed the copy. 2018.09.11 Version 10.1.0 * Interfaces for helper types updated to be more consistent throughout the library. All types, with the exception of the options for pipeline factories, use a fluent pattern. diff --git a/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java b/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java index ce23ee9d7dfc0..e23326b3108cc 100644 --- a/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java +++ b/src/main/java/com/microsoft/azure/storage/GeneratedBlobs.java @@ -15,6 +15,7 @@ import com.microsoft.azure.storage.blob.models.BlobAcquireLeaseResponse; import com.microsoft.azure.storage.blob.models.BlobBreakLeaseResponse; import com.microsoft.azure.storage.blob.models.BlobChangeLeaseResponse; +import com.microsoft.azure.storage.blob.models.BlobCopyFromURLResponse; import com.microsoft.azure.storage.blob.models.BlobCreateSnapshotResponse; import com.microsoft.azure.storage.blob.models.BlobDeleteResponse; import com.microsoft.azure.storage.blob.models.BlobDownloadResponse; @@ -157,6 +158,11 @@ private interface BlobsService { @UnexpectedResponseExceptionType(StorageErrorException.class) Single startCopyFromURL(Context context, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId); + @PUT("{containerName}/{blob}") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(StorageErrorException.class) + Single copyFromURL(Context context, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-lease-id") String leaseId); + @PUT("{containerName}/{blob}") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(StorageErrorException.class) @@ -1538,6 +1544,148 @@ public Completable startCopyFromURLAsync(Context context, @NonNull URL copySourc .toCompletable(); } + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete. + * + * @param context The context to associate with this operation. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param sourceModifiedAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + public void copyFromURL(Context context, @NonNull URL copySource, Integer timeout, Map metadata, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions) { + copyFromURLAsync(context, copySource, timeout, metadata, requestId, sourceModifiedAccessConditions, modifiedAccessConditions, leaseAccessConditions).blockingAwait(); + } + + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete. + * + * @param context The context to associate with this operation. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param sourceModifiedAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a ServiceFuture which will be completed with the result of the network request. + */ + public ServiceFuture copyFromURLAsync(Context context, @NonNull URL copySource, Integer timeout, Map metadata, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions, ServiceCallback serviceCallback) { + return ServiceFuture.fromBody(copyFromURLAsync(context, copySource, timeout, metadata, requestId, sourceModifiedAccessConditions, modifiedAccessConditions, leaseAccessConditions), serviceCallback); + } + + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete. + * + * @param context The context to associate with this operation. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param sourceModifiedAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Single which performs the network request upon subscription. + */ + public Single copyFromURLWithRestResponseAsync(Context context, @NonNull URL copySource, Integer timeout, Map metadata, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions) { + if (this.client.url() == null) { + throw new IllegalArgumentException("Parameter this.client.url() is required and cannot be null."); + } + if (copySource == null) { + throw new IllegalArgumentException("Parameter copySource is required and cannot be null."); + } + if (this.client.version() == null) { + throw new IllegalArgumentException("Parameter this.client.version() is required and cannot be null."); + } + Validator.validate(metadata); + Validator.validate(copySource); + Validator.validate(sourceModifiedAccessConditions); + Validator.validate(modifiedAccessConditions); + Validator.validate(leaseAccessConditions); + final String xMsRequiresSync = "true"; + OffsetDateTime sourceIfModifiedSince = null; + if (sourceModifiedAccessConditions != null) { + sourceIfModifiedSince = sourceModifiedAccessConditions.sourceIfModifiedSince(); + } + OffsetDateTime sourceIfUnmodifiedSince = null; + if (sourceModifiedAccessConditions != null) { + sourceIfUnmodifiedSince = sourceModifiedAccessConditions.sourceIfUnmodifiedSince(); + } + String sourceIfMatch = null; + if (sourceModifiedAccessConditions != null) { + sourceIfMatch = sourceModifiedAccessConditions.sourceIfMatch(); + } + String sourceIfNoneMatch = null; + if (sourceModifiedAccessConditions != null) { + sourceIfNoneMatch = sourceModifiedAccessConditions.sourceIfNoneMatch(); + } + OffsetDateTime ifModifiedSince = null; + if (modifiedAccessConditions != null) { + ifModifiedSince = modifiedAccessConditions.ifModifiedSince(); + } + OffsetDateTime ifUnmodifiedSince = null; + if (modifiedAccessConditions != null) { + ifUnmodifiedSince = modifiedAccessConditions.ifUnmodifiedSince(); + } + String ifMatch = null; + if (modifiedAccessConditions != null) { + ifMatch = modifiedAccessConditions.ifMatch(); + } + String ifNoneMatch = null; + if (modifiedAccessConditions != null) { + ifNoneMatch = modifiedAccessConditions.ifNoneMatch(); + } + String leaseId = null; + if (leaseAccessConditions != null) { + leaseId = leaseAccessConditions.leaseId(); + } + DateTimeRfc1123 sourceIfModifiedSinceConverted = null; + if (sourceIfModifiedSince != null) { + sourceIfModifiedSinceConverted = new DateTimeRfc1123(sourceIfModifiedSince); + } + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; + if (sourceIfUnmodifiedSince != null) { + sourceIfUnmodifiedSinceConverted = new DateTimeRfc1123(sourceIfUnmodifiedSince); + } + DateTimeRfc1123 ifModifiedSinceConverted = null; + if (ifModifiedSince != null) { + ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince); + } + DateTimeRfc1123 ifUnmodifiedSinceConverted = null; + if (ifUnmodifiedSince != null) { + ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince); + } + return service.copyFromURL(context, this.client.url(), timeout, metadata, copySource, this.client.version(), requestId, xMsRequiresSync, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId); + } + + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete. + * + * @param context The context to associate with this operation. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + * @param sourceModifiedAccessConditions Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. + * @param leaseAccessConditions Additional parameters for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @return a Single which performs the network request upon subscription. + */ + public Completable copyFromURLAsync(Context context, @NonNull URL copySource, Integer timeout, Map metadata, String requestId, SourceModifiedAccessConditions sourceModifiedAccessConditions, ModifiedAccessConditions modifiedAccessConditions, LeaseAccessConditions leaseAccessConditions) { + return copyFromURLWithRestResponseAsync(context, copySource, timeout, metadata, requestId, sourceModifiedAccessConditions, modifiedAccessConditions, leaseAccessConditions) + .toCompletable(); + } + /** * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full metadata. * diff --git a/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java b/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java index 50408cfa737bb..95467802d76b9 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java +++ b/src/main/java/com/microsoft/azure/storage/blob/BlobURL.java @@ -240,6 +240,72 @@ public Single abortCopyFromURL(String copyId, context, copyId, null, null, leaseAccessConditions)); } + /** + * Copies the data at the source URL to a blob and waits for the copy to complete before returning a response. + * For more information, see the Azure Docs + * + * @param copySource + * The source URL to copy from. + * + * @return Emits the successful response. + * + * @apiNote ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=sync_copy "Sample code for BlobURL.syncCopyFromURL")] \n + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) + */ + public Single syncCopyFromURL(URL copySource) { + return this.syncCopyFromURL(copySource, null, null, null, null); + } + + /** + * Copies the data at the source URL to a blob and waits for the copy to complete before returning a response. + * For more information, see the Azure Docs + * + * @param copySource + * The source URL to copy from. URLs outside of Azure may only be copied to block blobs. + * @param metadata + * {@link Metadata} + * @param sourceModifiedAccessConditions + * {@link ModifiedAccessConditions} against the source. Standard HTTP Access conditions related to the + * modification of data. ETag and LastModifiedTime are used to construct conditions related to when the blob + * was changed relative to the given request. The request will fail if the specified condition is not + * satisfied. + * @param destAccessConditions + * {@link BlobAccessConditions} against the destination. + * @param context + * {@code Context} offers a means of passing arbitrary data (key/value pairs) to an + * {@link com.microsoft.rest.v2.http.HttpPipeline}'s policy objects. Most applications do not need to pass + * arbitrary data to the pipeline and can pass {@code Context.NONE} or {@code null}. Each context object is + * immutable. The {@code withContext} with data method creates a new {@code Context} object that refers to + * its parent, forming a linked list. + * + * @return Emits the successful response. + * + * @apiNote ## Sample Code \n + * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=sync_copy "Sample code for BlobURL.syncCopyFromURL")] \n + * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java) + */ + public Single syncCopyFromURL(URL copySource, Metadata metadata, + ModifiedAccessConditions sourceModifiedAccessConditions, BlobAccessConditions destAccessConditions, + Context context) { + metadata = metadata == null ? Metadata.NONE : metadata; + sourceModifiedAccessConditions = sourceModifiedAccessConditions == null ? + new ModifiedAccessConditions() : sourceModifiedAccessConditions; + destAccessConditions = destAccessConditions == null ? BlobAccessConditions.NONE : destAccessConditions; + context = context == null ? Context.NONE : context; + + // We want to hide the SourceAccessConditions type from the user for consistency's sake, so we convert here. + SourceModifiedAccessConditions sourceConditions = new SourceModifiedAccessConditions() + .withSourceIfModifiedSince(sourceModifiedAccessConditions.ifModifiedSince()) + .withSourceIfUnmodifiedSince(sourceModifiedAccessConditions.ifUnmodifiedSince()) + .withSourceIfMatch(sourceModifiedAccessConditions.ifMatch()) + .withSourceIfNoneMatch(sourceModifiedAccessConditions.ifNoneMatch()); + + return addErrorWrappingToSingle(this.storageClient.generatedBlobs().copyFromURLWithRestResponseAsync( + context, copySource, null, metadata, null, sourceConditions, + destAccessConditions.modifiedAccessConditions(), destAccessConditions.leaseAccessConditions())); + } + /** * Reads a range of bytes from a blob. The response also includes the blob's properties and metadata. For more * information, see the Azure Docs. diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLHeaders.java new file mode 100644 index 0000000000000..94c4adbcd5a92 --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLHeaders.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.microsoft.rest.v2.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * Defines headers for CopyFromURL operation. + */ +@JacksonXmlRootElement(localName = "Blob-CopyFromURL-Headers") +public final class BlobCopyFromURLHeaders { + /** + * 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. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Returns the date and time the container was last modified. Any operation + * that modifies the blob, including an update of the blob's metadata or + * properties, changes the last-modified time of the blob. + */ + @JsonProperty(value = "Last-Modified") + private DateTimeRfc1123 lastModified; + + /** + * This header uniquely identifies the request that was made and can be + * used for troubleshooting the request. + */ + @JsonProperty(value = "x-ms-request-id") + private String requestId; + + /** + * 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. + */ + @JsonProperty(value = "x-ms-version") + private String version; + + /** + * UTC date/time value generated by the service that indicates the time at + * which the response was initiated. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 date; + + /** + * String identifier for this copy operation. + */ + @JsonProperty(value = "x-ms-copy-id") + private String copyId; + + /** + * State of the copy operation identified by x-ms-copy-id. Possible values + * include: 'success'. + */ + @JsonProperty(value = "x-ms-copy-status") + private SyncCopyStatusType copyStatus; + + /** + * Get the eTag value. + * + * @return the eTag value. + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag value. + * + * @param eTag the eTag value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the lastModified value. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.dateTime(); + } + + /** + * Set the lastModified value. + * + * @param lastModified the lastModified value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withLastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the requestId value. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId value. + * + * @param requestId the requestId value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the version value. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version value. + * + * @param version the version value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the date value. + * + * @return the date value. + */ + public OffsetDateTime date() { + if (this.date == null) { + return null; + } + return this.date.dateTime(); + } + + /** + * Set the date value. + * + * @param date the date value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withDate(OffsetDateTime date) { + if (date == null) { + this.date = null; + } else { + this.date = new DateTimeRfc1123(date); + } + return this; + } + + /** + * Get the copyId value. + * + * @return the copyId value. + */ + public String copyId() { + return this.copyId; + } + + /** + * Set the copyId value. + * + * @param copyId the copyId value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withCopyId(String copyId) { + this.copyId = copyId; + return this; + } + + /** + * Get the copyStatus value. + * + * @return the copyStatus value. + */ + public SyncCopyStatusType copyStatus() { + return this.copyStatus; + } + + /** + * Set the copyStatus value. + * + * @param copyStatus the copyStatus value to set. + * @return the BlobCopyFromURLHeaders object itself. + */ + public BlobCopyFromURLHeaders withCopyStatus(SyncCopyStatusType copyStatus) { + this.copyStatus = copyStatus; + return this; + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLResponse.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLResponse.java new file mode 100644 index 0000000000000..6f9be366745ed --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobCopyFromURLResponse.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.microsoft.rest.v2.RestResponse; +import com.microsoft.rest.v2.http.HttpRequest; +import java.util.Map; + +/** + * Contains all response data for the copyFromURL operation. + */ +public final class BlobCopyFromURLResponse extends RestResponse { + /** + * Creates an instance of BlobCopyFromURLResponse. + * + * @param request the request which resulted in this {response.Name}. + * @param statusCode the status code of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param body the deserialized body of the HTTP response. + */ + public BlobCopyFromURLResponse(HttpRequest request, int statusCode, BlobCopyFromURLHeaders headers, Map rawHeaders, Void body) { + super(request, statusCode, headers, rawHeaders, body); + } + + /** + * @return the deserialized response headers. + */ + @Override + public BlobCopyFromURLHeaders headers() { + return super.headers(); + } +} diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java index 7510195de4b05..d787264eddbec 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/BlobGetPropertiesHeaders.java @@ -24,8 +24,8 @@ @JacksonXmlRootElement(localName = "Blob-GetProperties-Headers") public final class BlobGetPropertiesHeaders { /** - * Returns the date and time the container was last modified. Any operation - * that modifies the blob, including an update of the blob's metadata or + * Returns the date and time the blob was last modified. Any operation that + * modifies the blob, including an update of the blob's metadata or * properties, changes the last-modified time of the blob. */ @JsonProperty(value = "Last-Modified") diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/SourceModifiedAccessConditions.java b/src/main/java/com/microsoft/azure/storage/blob/models/SourceModifiedAccessConditions.java index efc996ab958a4..6ab1d6455ad44 100644 --- a/src/main/java/com/microsoft/azure/storage/blob/models/SourceModifiedAccessConditions.java +++ b/src/main/java/com/microsoft/azure/storage/blob/models/SourceModifiedAccessConditions.java @@ -17,7 +17,8 @@ import java.time.OffsetDateTime; /** - * Additional parameters for startCopyFromURL operation. + * Additional parameters for a set of operations, such as: + * Blob_startCopyFromURL, Blob_copyFromURL. */ @JacksonXmlRootElement(localName = "source-modified-access-conditions") public final class SourceModifiedAccessConditions { diff --git a/src/main/java/com/microsoft/azure/storage/blob/models/SyncCopyStatusType.java b/src/main/java/com/microsoft/azure/storage/blob/models/SyncCopyStatusType.java new file mode 100644 index 0000000000000..fe6fc7acd923c --- /dev/null +++ b/src/main/java/com/microsoft/azure/storage/blob/models/SyncCopyStatusType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.storage.blob.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SyncCopyStatusType. + */ +public enum SyncCopyStatusType { + /** + * Enum value success. + */ + SUCCESS("success"); + + /** + * The actual serialized value for a SyncCopyStatusType instance. + */ + private final String value; + + private SyncCopyStatusType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SyncCopyStatusType instance. + * + * @param value the serialized value to parse. + * @return the parsed SyncCopyStatusType object, or null if unable to parse. + */ + @JsonCreator + public static SyncCopyStatusType fromString(String value) { + SyncCopyStatusType[] items = SyncCopyStatusType.values(); + for (SyncCopyStatusType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy b/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy index 766cb3850e7aa..dfb19bbe86aae 100644 --- a/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy +++ b/src/test/java/com/microsoft/azure/storage/BlobAPITest.groovy @@ -1009,9 +1009,9 @@ class BlobAPITest extends APISpec { .getProperties(null, null).blockingGet().headers().metadata() == metadata where: - key1 | value1 | key2 | value2 || statusCode - null | null | null | null || 200 - "foo" | "bar" | "fizz" | "buzz" || 200 + key1 | value1 | key2 | value2 + null | null | null | null + "foo" | "bar" | "fizz" | "buzz" } @Unroll @@ -1135,9 +1135,9 @@ class BlobAPITest extends APISpec { bu2.getProperties(null, null).blockingGet().headers().metadata() == metadata where: - key1 | value1 | key2 | value2 || statusCode - null | null | null | null || 200 - "foo" | "bar" | "fizz" | "buzz" || 200 + key1 | value1 | key2 | value2 + null | null | null | null + "foo" | "bar" | "fizz" | "buzz" } @Unroll @@ -1152,12 +1152,12 @@ class BlobAPITest extends APISpec { bu2.startCopyFromURL(bu.toURL(), null, mac, null, null).blockingGet().statusCode() == 202 where: - modified | unmodified | match | noneMatch | leaseID - null | null | null | null | null - oldDate | null | null | null | null - null | newDate | null | null | null - null | null | receivedEtag | null | null - null | null | null | garbageEtag | null + modified | unmodified | match | noneMatch + null | null | null | null + oldDate | null | null | null + null | newDate | null | null + null | null | receivedEtag | null + null | null | null | garbageEtag } @Unroll @@ -1175,11 +1175,11 @@ class BlobAPITest extends APISpec { thrown(StorageException) where: - modified | unmodified | match | noneMatch | leaseID - newDate | null | null | null | null - null | oldDate | null | null | null - null | null | garbageEtag | null | null - null | null | null | receivedEtag | null + modified | unmodified | match | noneMatch + newDate | null | null | null + null | oldDate | null | null + null | null | garbageEtag | null + null | null | null | receivedEtag } @Unroll @@ -1402,6 +1402,178 @@ class BlobAPITest extends APISpec { notThrown(RuntimeException) } + def "Sync copy"() { + setup: + // Sync copy is a deep copy, which requires either sas or public access. + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + def headers = bu2.syncCopyFromURL(bu.toURL(), null, null,null, null).blockingGet().headers() + + expect: + headers.copyStatus() == SyncCopyStatusType.SUCCESS + headers.copyId() != null + validateBasicHeaders(headers) + } + + def "Sync copy min"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + + expect: + bu2.syncCopyFromURL(bu.toURL()).blockingGet().statusCode() == 202 + } + + @Unroll + def "Sync copy metadata"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + Metadata metadata = new Metadata() + if (key1 != null && value1 != null) { + metadata.put(key1, value1) + } + if (key2 != null && value2 != null) { + metadata.put(key2, value2) + } + + when: + bu2.syncCopyFromURL(bu.toURL(), metadata, null, null, null).blockingGet() + + then: + bu2.getProperties().blockingGet().headers().metadata() == metadata + + where: + key1 | value1 | key2 | value2 + null | null | null | null + "foo" | "bar" | "fizz" | "buzz" + } + + @Unroll + def "Sync copy source AC"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + match = setupBlobMatchCondition(bu, match) + def mac = new ModifiedAccessConditions().withIfModifiedSince(modified).withIfUnmodifiedSince(unmodified) + .withIfMatch(match).withIfNoneMatch(noneMatch) + + expect: + bu2.syncCopyFromURL(bu.toURL(), null, mac, null, null).blockingGet().statusCode() == 202 + + where: + modified | unmodified | match | noneMatch + null | null | null | null + oldDate | null | null | null + null | newDate | null | null + null | null | receivedEtag | null + null | null | null | garbageEtag + } + + @Unroll + def "Sync copy source AC fail"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + noneMatch = setupBlobMatchCondition(bu, noneMatch) + def mac = new ModifiedAccessConditions().withIfModifiedSince(modified).withIfUnmodifiedSince(unmodified) + .withIfMatch(match).withIfNoneMatch(noneMatch) + + when: + bu2.syncCopyFromURL(bu.toURL(), null, mac, null, null).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified | match | noneMatch + newDate | null | null | null + null | oldDate | null | null + null | null | garbageEtag | null + null | null | null | receivedEtag + } + + @Unroll + def "Sync copy dest AC"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + bu2.upload(defaultFlowable, defaultDataSize, null, null, + null, null).blockingGet() + match = setupBlobMatchCondition(bu2, match) + leaseID = setupBlobLeaseCondition(bu2, leaseID) + BlobAccessConditions bac = new BlobAccessConditions().withModifiedAccessConditions( + new ModifiedAccessConditions().withIfModifiedSince(modified).withIfUnmodifiedSince(unmodified) + .withIfMatch(match).withIfNoneMatch(noneMatch)) + .withLeaseAccessConditions(new LeaseAccessConditions().withLeaseId(leaseID)) + + expect: + bu2.syncCopyFromURL(bu.toURL(), null, null, bac, null).blockingGet().statusCode() == 202 + + where: + modified | unmodified | match | noneMatch | leaseID + null | null | null | null | null + oldDate | null | null | null | null + null | newDate | null | null | null + null | null | receivedEtag | null | null + null | null | null | garbageEtag | null + null | null | null | null | receivedLeaseID + } + + @Unroll + def "Sync copy dest AC fail"() { + setup: + cu.setAccessPolicy(PublicAccessType.CONTAINER, null).blockingGet() + BlobURL bu2 = cu.createBlockBlobURL(generateBlobName()) + bu2.upload(defaultFlowable, defaultDataSize, null, null, + null, null).blockingGet() + noneMatch = setupBlobMatchCondition(bu2, noneMatch) + setupBlobLeaseCondition(bu2, leaseID) + BlobAccessConditions bac = new BlobAccessConditions().withModifiedAccessConditions( + new ModifiedAccessConditions().withIfModifiedSince(modified).withIfUnmodifiedSince(unmodified) + .withIfMatch(match).withIfNoneMatch(noneMatch)) + .withLeaseAccessConditions(new LeaseAccessConditions().withLeaseId(leaseID)) + + when: + bu2.syncCopyFromURL(bu.toURL(), null, null, bac, null).blockingGet() + + then: + thrown(StorageException) + + where: + modified | unmodified | match | noneMatch | leaseID + newDate | null | null | null | null + null | oldDate | null | null | null + null | null | garbageEtag | null | null + null | null | null | receivedEtag | null + null | null | null | null | garbageLeaseID + } + + def "Sync copy error"() { + setup: + def bu2 = cu.createBlockBlobURL(generateBlobName()) + + when: + bu2.syncCopyFromURL(bu.toURL(), null, null, null, null).blockingGet() + + then: + thrown(StorageException) + } + + def "Sync copy context"() { + setup: + def pipeline = HttpPipeline.build(getStubFactory(getContextStubPolicy(202, BlobCopyFromURLHeaders))) + + bu = bu.withPipeline(pipeline) + + when: + // No service call is made. Just satisfy the parameters. + bu.syncCopyFromURL(new URL("http://www.example.com"), null, null, null, defaultContext).blockingGet() + + then: + notThrown(RuntimeException) + } + def "Delete"() { when: BlobDeleteResponse response = bu.delete(null, null, null).blockingGet() diff --git a/src/test/java/com/microsoft/azure/storage/Samples.java b/src/test/java/com/microsoft/azure/storage/Samples.java index df69c908aa681..a3d0cc2013294 100644 --- a/src/test/java/com/microsoft/azure/storage/Samples.java +++ b/src/test/java/com/microsoft/azure/storage/Samples.java @@ -1887,6 +1887,18 @@ For the blob, show each block (ID and size) that is a committed part of it. It i .subscribe(); // + // + // Create the container. + containerURL.create() + .flatMap(response -> + /* + Copy from the source url to the destination, which is the url pointed to by blobURL. Note that + the service will not return a response until the copy is complete, hence "sync" copy. + */ + blobURL.syncCopyFromURL(new URL("https://cdn2.auth0.com/docs/media/addons/azure_blob.svg"))) + .subscribe(); + // + // blobURL.delete(null, null, null) .subscribe();