From 43f54856dc860070005a8e3198aef44b5d4ed297 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 3 Oct 2019 13:54:11 -0700 Subject: [PATCH 1/3] API review changes. --- .../blob/BlobContainerAsyncClient.java | 28 ++--- .../storage/blob/BlobContainerClient.java | 28 ++--- .../storage/blob/BlobServiceAsyncClient.java | 10 +- .../azure/storage/blob/BlobServiceClient.java | 10 +- .../blob/specialized/BlobAsyncClientBase.java | 31 +++-- .../blob/specialized/BlobClientBase.java | 28 ++--- .../BlobServiceSasQueryParameters.java | 6 +- .../BlobServiceSasSignatureValues.java | 16 +-- .../BlobAsyncClientJavaDocCodeSnippets.java | 18 +-- .../blob/BlobClientJavaDocCodeSnippets.java | 18 +-- ...ntainerAsyncClientJavaDocCodeSnippets.java | 18 +-- ...lobContainerClientJavaDocCodeSnippets.java | 18 +-- ...ServiceAsyncClientJavaDocCodeSnippets.java | 10 +- .../BlobServiceClientJavaDocCodeSnippets.java | 10 +- ...lobAsyncClientBaseJavaDocCodeSnippets.java | 18 +-- .../BlobClientBaseJavaDocCodeSnippets.java | 18 +-- .../com/azure/storage/blob/SASTest.groovy | 36 +++--- .../blob/specialized/HelperTest.groovy | 26 ++-- .../common/AccountSASSignatureValues.java | 15 +-- .../common/AccountSasQueryParameters.java | 5 +- .../common/BaseSasQueryParameters.java | 12 +- .../common/{IPRange.java => IpRange.java} | 24 ++-- .../storage/file/DirectoryAsyncClient.java | 35 +++--- .../azure/storage/file/DirectoryClient.java | 12 +- .../azure/storage/file/FileAsyncClient.java | 57 ++++----- .../com/azure/storage/file/FileClient.java | 42 +++---- ...Permission.java => FileSasPermission.java} | 36 +++--- .../storage/file/FileServiceAsyncClient.java | 11 +- .../azure/storage/file/FileServiceClient.java | 10 +- .../file/FileServiceSasQueryParameters.java | 12 +- ...ava => FileServiceSasSignatureValues.java} | 96 +++++++-------- .../azure/storage/file/ShareAsyncClient.java | 34 ++--- .../com/azure/storage/file/ShareClient.java | 26 ++-- ...ermission.java => ShareSasPermission.java} | 116 +++++++++--------- .../{FileRef.java => FileReference.java} | 4 +- ...o.java => FileUploadRangeFromUrlInfo.java} | 4 +- .../file/FileAsyncJavaDocCodeSamples.java | 14 +-- .../storage/file/FileJavaDocCodeSamples.java | 20 +-- .../FileServiceAsyncJavaDocCodeSamples.java | 10 +- .../file/FileServiceJavaDocCodeSamples.java | 10 +- .../file/ShareAsyncJavaDocCodeSamples.java | 24 ++-- .../storage/file/ShareJavaDocCodeSamples.java | 24 ++-- .../azure/storage/file/FileAPITests.groovy | 2 +- .../storage/file/FileAsyncAPITests.groovy | 2 +- .../azure/storage/file/FileSASTests.groovy | 56 ++++----- .../azure/storage/queue/QueueAsyncClient.java | 20 +-- .../com/azure/storage/queue/QueueClient.java | 16 +-- ...ermission.java => QueueSasPermission.java} | 36 +++--- .../queue/QueueServiceAsyncClient.java | 10 +- .../storage/queue/QueueServiceClient.java | 10 +- .../queue/QueueServiceSasQueryParameters.java | 10 +- ...va => QueueServiceSasSignatureValues.java} | 66 +++++----- .../queue/QueueAsyncJavaDocCodeSamples.java | 14 +-- .../queue/QueueJavaDocCodeSamples.java | 14 +-- .../QueueServiceAsyncJavaDocCodeSamples.java | 10 +- .../queue/QueueServiceJavaDocCodeSamples.java | 10 +- .../azure/storage/queue/QueueSASTests.groovy | 20 +-- 57 files changed, 651 insertions(+), 645 deletions(-) rename sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/{IPRange.java => IpRange.java} (77%) rename sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/{FileSASPermission.java => FileSasPermission.java} (82%) rename sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/{FileServiceSASSignatureValues.java => FileServiceSasSignatureValues.java} (81%) rename sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/{ShareSASPermission.java => ShareSasPermission.java} (51%) rename sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/{FileRef.java => FileReference.java} (90%) rename sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/{FileUploadRangeFromURLInfo.java => FileUploadRangeFromUrlInfo.java} (90%) rename sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/{QueueSASPermission.java => QueueSasPermission.java} (82%) rename sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/{QueueServiceSASSignatureValues.java => QueueServiceSasSignatureValues.java} (82%) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java index ca7595466920..5ed79aae5c3a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java @@ -33,7 +33,7 @@ import com.azure.storage.blob.specialized.BlobServiceSasQueryParameters; import com.azure.storage.blob.specialized.BlobServiceSasSignatureValues; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SharedKeyCredential; @@ -817,12 +817,12 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange) { + SASProtocol sasProtocol, IpRange ipRange) { return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null /* cacheControl */, null /* contentDisposition */, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -833,7 +833,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure @@ -846,7 +846,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -855,9 +855,9 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, - BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange, String cacheControl, String contentDisposition, - String contentEncoding, String contentLanguage, String contentType) { + BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, + SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition, + String contentEncoding, String contentLanguage, String contentType) { BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, null /* identifier*/, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); @@ -905,11 +905,11 @@ public String generateSAS(String identifier) { * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null /* cacheControl */, null /* contentDisposition */, null /* contentEncoding */, null /* contentLanguage */, null /*contentType*/); @@ -920,7 +920,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs

@@ -931,7 +931,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -940,8 +940,8 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi * @return A string that represents the SAS token */ public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java index a6b650ed08b9..e8b37a78173b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java @@ -18,7 +18,7 @@ import com.azure.storage.blob.models.SignedIdentifier; import com.azure.storage.blob.models.StorageAccountInfo; import com.azure.storage.blob.models.UserDelegationKey; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import reactor.core.publisher.Mono; @@ -558,12 +558,12 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange) { + SASProtocol sasProtocol, IpRange ipRange) { return this.blobContainerAsyncClient.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } @@ -573,7 +573,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure @@ -586,7 +586,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -595,9 +595,9 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, - BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange, String cacheControl, String contentDisposition, - String contentEncoding, String contentLanguage, String contentType) { + BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, + SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition, + String contentEncoding, String contentLanguage, String contentType) { return this.blobContainerAsyncClient.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); @@ -633,11 +633,11 @@ public String generateSAS(String identifier) { * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.blobContainerAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } @@ -647,7 +647,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs

@@ -658,7 +658,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -667,8 +667,8 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi * @return A string that represents the SAS token */ public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { return this.blobContainerAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java index a845baeea1fa..63e8fac4eb20 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java @@ -30,7 +30,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.AccountSASSignatureValues; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SharedKeyCredential; @@ -475,7 +475,7 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol} + * {@codesnippet com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol} * *

For more information, see the * Azure Docs

@@ -486,14 +486,14 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token * @throws NullPointerException if {@code sharedKeyCredential} is null */ public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, - AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - IPRange ipRange, SASProtocol sasProtocol) { + AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, + String version, IpRange ipRange, SASProtocol sasProtocol) { SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline()); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java index 4409c0f88e0a..7e6d13c51843 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java @@ -20,7 +20,7 @@ import com.azure.storage.common.AccountSASPermission; import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import reactor.core.publisher.Mono; @@ -380,7 +380,7 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol} + * {@codesnippet com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol} * *

For more information, see the * Azure Docs

@@ -391,13 +391,13 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token */ public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, - AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - IPRange ipRange, SASProtocol sasProtocol) { + AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, + String version, IpRange ipRange, SASProtocol sasProtocol) { return this.blobServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index 8a650f09717a..e2bcd5812b85 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -32,7 +32,7 @@ import com.azure.storage.blob.models.StorageException; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SharedKeyCredential; @@ -113,8 +113,7 @@ public String getBlobUrl() { } else { if (azureBlobStorage.getUrl().contains("?")) { return String.format("%s&snapshot=%s", azureBlobStorage.getUrl(), snapshot); - } - else { + } else { return String.format("%s?snapshot=%s", azureBlobStorage.getUrl(), snapshot); } } @@ -1002,12 +1001,12 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange) { + SASProtocol sasProtocol, IpRange ipRange) { return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null /* cacheControl */, null /* contentDisposition */, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -1018,7 +1017,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure @@ -1031,7 +1030,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -1040,9 +1039,9 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, - BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange, String cacheControl, String contentDisposition, - String contentEncoding, String contentLanguage, String contentType) { + BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, + SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition, + String contentEncoding, String contentLanguage, String contentType) { BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, @@ -1093,12 +1092,12 @@ public String generateSAS(String identifier) { * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token * @throws NullPointerException if {@code sharedKeyCredential} is null */ public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -1109,7 +1108,7 @@ public String generateSAS(String identifier, BlobSasPermission permissions, Offs * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs

@@ -1120,7 +1119,7 @@ public String generateSAS(String identifier, BlobSasPermission permissions, Offs * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -1130,8 +1129,8 @@ public String generateSAS(String identifier, BlobSasPermission permissions, Offs * @throws NullPointerException if {@code sharedKeyCredential} is null */ public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java index 6cbea51e8576..1af4ac625d7f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java @@ -26,7 +26,7 @@ import com.azure.storage.blob.models.StorageAccountInfo; import com.azure.storage.blob.models.StorageException; import com.azure.storage.blob.models.UserDelegationKey; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import reactor.core.publisher.Mono; @@ -808,12 +808,12 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange) { + SASProtocol sasProtocol, IpRange ipRange) { return this.client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } @@ -823,7 +823,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure @@ -836,7 +836,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -845,9 +845,9 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str * @return A string that represents the SAS token */ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName, - BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - SASProtocol sasProtocol, IPRange ipRange, String cacheControl, String contentDisposition, - String contentEncoding, String contentLanguage, String contentType) { + BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, + SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition, + String contentEncoding, String contentLanguage, String contentType) { return this.client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); @@ -883,11 +883,11 @@ public String generateSAS(String identifier) { * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } @@ -897,7 +897,7 @@ public String generateSAS(String identifier, BlobSasPermission permissions, Offs * *

Code Samples

* - * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs

@@ -908,7 +908,7 @@ public String generateSAS(String identifier, BlobSasPermission permissions, Offs * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -917,8 +917,8 @@ public String generateSAS(String identifier, BlobSasPermission permissions, Offs * @return A string that represents the SAS token */ public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasQueryParameters.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasQueryParameters.java index a08f7baf11cf..7e4cdafa92cb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasQueryParameters.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasQueryParameters.java @@ -7,7 +7,7 @@ import com.azure.storage.blob.BlobClientBuilder; import com.azure.storage.common.BaseSasQueryParameters; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; @@ -95,7 +95,7 @@ public BlobServiceSasQueryParameters(Map queryParamsMap, boole * @param protocol A {@code String} representing the allowed HTTP protocol(s) or {@code null}. * @param startTime A {@code java.util.Date} representing the start time for this SAS token or {@code null}. * @param expiryTime A {@code java.util.Date} representing the expiry time for this SAS token. - * @param ipRange A {@link IPRange} representing the range of valid IP addresses for this SAS token or + * @param ipRange A {@link IpRange} representing the range of valid IP addresses for this SAS token or * {@code null}. * @param identifier A {@code String} representing the signed identifier (only for Service SAS) or {@code null}. * @param resource A {@code String} representing the storage container or blob (only for Service SAS). @@ -103,7 +103,7 @@ public BlobServiceSasQueryParameters(Map queryParamsMap, boole * @param signature A {@code String} representing the signature for the SAS token. */ BlobServiceSasQueryParameters(String version, SASProtocol protocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, IPRange ipRange, String identifier, String resource, String permissions, + OffsetDateTime expiryTime, IpRange ipRange, String identifier, String resource, String permissions, String signature, String cacheControl, String contentDisposition, String contentEncoding, String contentLanguage, String contentType, UserDelegationKey key) { super(version, protocol, startTime, expiryTime, ipRange, permissions, signature); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java index 191558485be6..2b94450513c7 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java @@ -8,7 +8,7 @@ import com.azure.storage.blob.BlobSasPermission; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SharedKeyCredential; @@ -47,7 +47,7 @@ public final class BlobServiceSasSignatureValues { private String permissions; - private IPRange ipRange; + private IpRange ipRange; private String canonicalName; @@ -94,8 +94,8 @@ public BlobServiceSasSignatureValues() { } public BlobServiceSasSignatureValues(String version, SASProtocol sasProtocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, String permission, IPRange ipRange, String identifier, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + OffsetDateTime expiryTime, String permission, IpRange ipRange, String identifier, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { if (version != null) { this.version = version; } @@ -207,19 +207,19 @@ public BlobServiceSasSignatureValues setPermissions(String permissions) { } /** - * @return the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * @return the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. */ - public IPRange getIpRange() { + public IpRange getIpRange() { return ipRange; } /** - * Sets the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * Sets the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. * * @param ipRange Allowed IP range to set * @return the updated BlobServiceSASSignatureValues object */ - public BlobServiceSasSignatureValues setIpRange(IPRange ipRange) { + public BlobServiceSasSignatureValues setIpRange(IpRange ipRange) { this.ipRange = ipRange; return this; } diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java index ad04d0df49c8..34da7ccad6d2 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java @@ -16,7 +16,7 @@ import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.blob.specialized.BlobAsyncClientBase; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import reactor.core.publisher.Flux; @@ -413,10 +413,10 @@ public void getAccountInfoWithResponseCodeSnippets() { /** * Code snippet for {@link BlobAsyncClient#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission, - * OffsetDateTime, OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateUserDelegationSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -425,7 +425,7 @@ public void generateUserDelegationSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -441,15 +441,15 @@ public void generateUserDelegationSASCodeSnippets() { String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** * Code snippet for {@link BlobAsyncClient#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime, - * String, SASProtocol, IPRange, String, String, String, String, String)} + * String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobAsyncClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobAsyncClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -458,7 +458,7 @@ public void generateSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -473,7 +473,7 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobAsyncClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobAsyncClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java index cff0b909f69e..2f2b9b403ef0 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java @@ -18,7 +18,7 @@ import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.blob.specialized.BlobClientBase; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.io.ByteArrayOutputStream; @@ -390,10 +390,10 @@ public void getAccountInfoWithResponseCodeSnippets() { /** * Code snippet for {@link BlobClient#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission, - * OffsetDateTime, OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateUserDelegationSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -402,7 +402,7 @@ public void generateUserDelegationSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -418,15 +418,15 @@ public void generateUserDelegationSASCodeSnippets() { String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** * Code snippet for {@link BlobClient#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime, String, - * SASProtocol, IPRange, String, String, String, String, String)} + * SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -435,7 +435,7 @@ public void generateSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -450,7 +450,7 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java index ffa9e4cb9644..79b7b0aa6773 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java @@ -14,7 +14,7 @@ import com.azure.storage.blob.models.SignedIdentifier; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.time.Duration; @@ -38,11 +38,11 @@ public class BlobContainerAsyncClientJavaDocCodeSnippets { /** * Code snippet for {@link BlobContainerAsyncClient#generateUserDelegationSAS(UserDelegationKey, String, - * BlobContainerSasPermission, OffsetDateTime, OffsetDateTime, String, SASProtocol, IPRange, String, String, String, + * BlobContainerSasPermission, OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, * String, String)} */ public void generateUserDelegationSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobContainerSasPermission permissions = new BlobContainerSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -52,7 +52,7 @@ public void generateUserDelegationSASCodeSnippets() { .setListPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -68,15 +68,15 @@ public void generateUserDelegationSASCodeSnippets() { String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** * Code snippet for {@link BlobContainerAsyncClient#generateSAS(String, BlobContainerSasPermission, OffsetDateTime, - * OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobContainerSasPermission permissions = new BlobContainerSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -86,7 +86,7 @@ public void generateSASCodeSnippets() { .setListPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -101,7 +101,7 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java index 418ad1076a5b..a26cdc9c76cc 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java @@ -18,7 +18,7 @@ import com.azure.storage.blob.models.StorageException; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.time.Duration; @@ -40,11 +40,11 @@ public class BlobContainerClientJavaDocCodeSnippets { /** * Code snippet for {@link BlobContainerClient#generateUserDelegationSAS(UserDelegationKey, String, - * BlobContainerSasPermission, OffsetDateTime, OffsetDateTime, String, SASProtocol, IPRange, String, String, String, + * BlobContainerSasPermission, OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, * String, String)} */ public void generateUserDelegationSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobContainerSasPermission permissions = new BlobContainerSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -54,7 +54,7 @@ public void generateUserDelegationSASCodeSnippets() { .setListPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -70,15 +70,15 @@ public void generateUserDelegationSASCodeSnippets() { String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** * Code snippet for {@link BlobContainerClient#generateSAS(String, BlobContainerSasPermission, OffsetDateTime, - * OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobContainerSasPermission permissions = new BlobContainerSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -88,7 +88,7 @@ public void generateSASCodeSnippets() { .setListPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -103,7 +103,7 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java index b69a8f78b78c..1473724a4806 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java @@ -15,7 +15,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.time.OffsetDateTime; import java.util.Collections; @@ -31,10 +31,10 @@ public class BlobServiceAsyncClientJavaDocCodeSnippets { /** * Generates a code sample for using {@link BlobServiceAsyncClient#generateAccountSAS(AccountSASService, - * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IPRange, SASProtocol)} + * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)} */ public void generateAccountSAS() { - // BEGIN: com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // BEGIN: com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol AccountSASService service = new AccountSASService() .setBlob(true) .setFile(true) @@ -55,7 +55,7 @@ public void generateAccountSAS() { .setUpdatePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -63,7 +63,7 @@ public void generateAccountSAS() { String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version, ipRange, sasProtocol); - // END: com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // END: com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java index 3ff6426b52dc..8ee24a5b5b23 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java @@ -16,7 +16,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.time.Duration; import java.time.OffsetDateTime; @@ -33,10 +33,10 @@ public class BlobServiceClientJavaDocCodeSnippets { /** * Generates a code sample for using {@link BlobServiceClient#generateAccountSAS(AccountSASService, - * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IPRange, SASProtocol)} + * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)} */ public void generateAccountSAS() { - // BEGIN: com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // BEGIN: com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol AccountSASService service = new AccountSASService() .setBlob(true) .setFile(true) @@ -57,7 +57,7 @@ public void generateAccountSAS() { .setUpdatePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -65,7 +65,7 @@ public void generateAccountSAS() { String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version, ipRange, sasProtocol); - // END: com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // END: com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol } /** diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java index 9e72080226dd..d8c17072416a 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java @@ -16,7 +16,7 @@ import com.azure.storage.blob.models.ReliableDownloadOptions; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.io.ByteArrayOutputStream; @@ -410,10 +410,10 @@ public void getAccountInfoWithResponseCodeSnippets() { /** * Code snippet for {@link BlobAsyncClientBase#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission, - * OffsetDateTime, OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateUserDelegationSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setAddPermission(true) .setWritePermission(true) @@ -422,7 +422,7 @@ public void generateUserDelegationSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -438,15 +438,15 @@ public void generateUserDelegationSASCodeSnippets() { String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** * Code snippet for {@link BlobAsyncClientBase#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime, - * String, SASProtocol, IPRange, String, String, String, String, String)} + * String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -455,7 +455,7 @@ public void generateSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -470,6 +470,6 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } } diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java index 03b383ca7f5f..87fd7533d2a6 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java @@ -19,7 +19,7 @@ import com.azure.storage.blob.models.StorageAccountInfo; import com.azure.storage.blob.models.UserDelegationKey; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.io.ByteArrayOutputStream; @@ -396,10 +396,10 @@ public void getAccountInfoWithResponseCodeSnippets() { /** * Code snippet for {@link BlobClientBase#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission, - * OffsetDateTime, OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateUserDelegationSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -408,7 +408,7 @@ public void generateUserDelegationSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -424,15 +424,15 @@ public void generateUserDelegationSASCodeSnippets() { String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** * Code snippet for {@link BlobClientBase#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime, String, - * SASProtocol, IPRange, String, String, String, String, String)} + * SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String BlobSasPermission permissions = new BlobSasPermission() .setReadPermission(true) .setWritePermission(true) @@ -441,7 +441,7 @@ public void generateSASCodeSnippets() { .setAddPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -456,6 +456,6 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } } diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy index 354e352b0a06..cf1f8af8d974 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy @@ -15,7 +15,7 @@ import com.azure.storage.common.AccountSASResourceType import com.azure.storage.common.AccountSASService import com.azure.storage.common.AccountSASSignatureValues import com.azure.storage.common.Constants -import com.azure.storage.common.IPRange +import com.azure.storage.common.IpRange import com.azure.storage.common.SASProtocol import com.azure.storage.common.Utility import com.azure.storage.common.credentials.SASTokenCredential @@ -109,7 +109,7 @@ class SASTest extends APISpec { .setAddPermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -156,7 +156,7 @@ class SASTest extends APISpec { .setAddPermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -239,7 +239,7 @@ class SASTest extends APISpec { def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") @@ -292,7 +292,7 @@ class SASTest extends APISpec { .setAddPermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -354,7 +354,7 @@ class SASTest extends APISpec { def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") @@ -545,7 +545,7 @@ class SASTest extends APISpec { v.setCanonicalName("containerName/blobName") .setSnapshotId(snapId) if (ipRange != null) { - def ipR = new IPRange() + def ipR = new IpRange() ipR.setIpMin("ip") v.setIpRange(ipR) } @@ -571,9 +571,9 @@ class SASTest extends APISpec { where: startTime | identifier | ipRange | protocol | snapId | cacheControl | disposition | encoding | language | type || expectedStringToSign OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC) | null | null | null | null | null | null | null | null | null || "r\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" - null | "id" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\nid\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" - null | null | new IPRange() | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" - null | null | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" + null | "id" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\nid\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" + null | null | new IpRange() | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" + null | null | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" null | null | null | null | "snapId" | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\nsnapId\n\n\n\n\n" null | null | null | null | null | "control" | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\ncontrol\n\n\n\n" null | null | null | null | null | null | "disposition" | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\ndisposition\n\n\n" @@ -598,7 +598,7 @@ class SASTest extends APISpec { v.setCanonicalName("containerName/blobName") .setSnapshotId(snapId) if (ipRange != null) { - def ipR = new IPRange() + def ipR = new IpRange() ipR.setIpMin("ip") v.setIpRange(ipR) } @@ -633,9 +633,9 @@ class SASTest extends APISpec { null | null | null | OffsetDateTime.of(LocalDateTime.of(2018, 1, 1, 0, 0), ZoneOffset.UTC) | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n2018-01-01T00:00:00Z\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" null | null | null | null | OffsetDateTime.of(LocalDateTime.of(2018, 1, 1, 0, 0), ZoneOffset.UTC) | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n2018-01-01T00:00:00Z\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" null | null | null | null | null | "b" | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\nb\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" - null | null | null | null | null | null | "2018-06-17" | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n2018-06-17\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" - null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | new IPRange() | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" - null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" + null | null | null | null | null | null | "2018-06-17" | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n2018-06-17\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" + null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | new IpRange() | null | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" + null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\n\n\n\n" null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | "snapId" | null | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\nsnapId\n\n\n\n\n" null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | "control" | null | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\ncontrol\n\n\n\n" null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | "disposition" | null | null | null || "r\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\ncontainerName/blobName\n\n\n\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\n\n\ndisposition\n\n\n" @@ -779,7 +779,7 @@ class SASTest extends APISpec { @Unroll def "IPRange toString"() { setup: - def ip = new IPRange() + def ip = new IpRange() .setIpMin(min) .setIpMax(max) @@ -796,7 +796,7 @@ class SASTest extends APISpec { @Unroll def "IPRange parse"() { when: - def ip = IPRange.parse(rangeStr) + def ip = IpRange.parse(rangeStr) then: ip.getIpMin() == min @@ -871,7 +871,7 @@ class SASTest extends APISpec { .setStartTime(startTime) .setExpiryTime(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) if (ipRange != null) { - def ipR = new IPRange() + def ipR = new IpRange() ipR.setIpMin("ip") v.setIpRange(ipR) } @@ -885,7 +885,7 @@ class SASTest extends APISpec { where: startTime | ipRange | protocol || expectedStringToSign OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC) | null | null || "%s" + "\nr\nb\no\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" - null | new IPRange() | null || "%s" + "\nr\nb\no\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" + null | new IpRange() | null || "%s" + "\nr\nb\no\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" null | null | SASProtocol.HTTPS_ONLY || "%s" + "\nr\nb\no\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" } diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy index 940f42e86bb4..7fa416b9809d 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy @@ -14,7 +14,7 @@ import com.azure.storage.common.AccountSASPermission import com.azure.storage.common.AccountSASResourceType import com.azure.storage.common.AccountSASSignatureValues import com.azure.storage.common.Constants -import com.azure.storage.common.IPRange +import com.azure.storage.common.IpRange import com.azure.storage.common.SASProtocol import com.azure.storage.common.Utility import com.azure.storage.common.credentials.SharedKeyCredential @@ -110,7 +110,7 @@ class HelperTest extends APISpec { } if (ipRange != null) { - v.setIpRange(new IPRange().setIpMin("ip")) + v.setIpRange(new IpRange().setIpMin("ip")) } v.setIdentifier(identifier) @@ -148,9 +148,9 @@ class HelperTest extends APISpec { new BlobSasPermission() | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | null | null | null | null | null | null | null || "r\n\n%s\n" + "/blob/%s/containerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" null | OffsetDateTime.now(ZoneOffset.UTC).minusDays(1) | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | null | null | null | null | null | null | null || "\n%s\n%s\n/blob/%s/containerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" - null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | "id" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\nid\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" - null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | new IPRange() | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" - null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" + null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | "id" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\nid\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" + null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | new IpRange() | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" + null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | null | "snapId" | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\nsnapId\n\n\n\n\n" null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | null | null | "control" | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\ncontrol\n\n\n\n" null | null | OffsetDateTime.now(ZoneOffset.UTC).plusDays(1) | null | null | null | null | null | "disposition" | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\ndisposition\n\n\n" @@ -186,7 +186,7 @@ class HelperTest extends APISpec { } if (ipRange != null) { - v.setIpRange(new IPRange().setIpMin("ip")) + v.setIpRange(new IpRange().setIpMin("ip")) } v.setProtocol(protocol) @@ -225,9 +225,9 @@ class HelperTest extends APISpec { null | null | null | null | null | OffsetDateTime.of(LocalDateTime.of(2018, 1, 1, 0, 0), ZoneOffset.UTC) | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n2018-01-01T00:00:00Z\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" null | null | null | null | null | null | OffsetDateTime.of(LocalDateTime.of(2018, 1, 1, 0, 0), ZoneOffset.UTC) | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n2018-01-01T00:00:00Z\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" null | null | null | null | null | null | null | "b" | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\nb\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" - null | null | null | null | null | null | null | null | "2018-06-17" | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n2018-06-17\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" - null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | new IPRange() | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" - null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" + null | null | null | null | null | null | null | null | "2018-06-17" | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n2018-06-17\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" + null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | new IpRange() | null | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" + null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | SASProtocol.HTTPS_ONLY | null | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\n\n\n\n" null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | "snapId" | null | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nbs\nsnapId\n\n\n\n\n" null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | "control" | null | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\ncontrol\n\n\n\n" null | null | null | null | null | null | null | null | null | "3hd4LRwrARVGbeMRQRfTLIsGMkCPuZJnvxZDU7Gak8c=" | null | null | null | null | "disposition" | null | null | null || "\n\n%s\n/blob/%s/containerName/blobName\n\n\n\n\n\n\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\nb\n\n\ndisposition\n\n\n" @@ -409,7 +409,7 @@ class HelperTest extends APISpec { @Unroll def "IPRange toString"() { setup: - def ip = new IPRange() + def ip = new IpRange() .setIpMin(min) .setIpMax(max) @@ -426,7 +426,7 @@ class HelperTest extends APISpec { @Unroll def "IPRange parse"() { when: - IPRange ip = IPRange.parse(rangeStr) + IpRange ip = IpRange.parse(rangeStr) then: ip.getIpMin() == min @@ -468,7 +468,7 @@ class HelperTest extends APISpec { .setProtocol(protocol) if (ipRange != null) { - v.setIpRange(new IPRange().setIpMin("ip")) + v.setIpRange(new IpRange().setIpMin("ip")) } def token = v.generateSASQueryParameters(primaryCredential) @@ -481,7 +481,7 @@ class HelperTest extends APISpec { where: startTime | ipRange | protocol || expectedStringToSign OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC) | null | null || "%s\nr\nb\no\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" - null | new IPRange() | null || "%s\nr\nb\no\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" + null | new IpRange() | null || "%s\nr\nb\no\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\nip\n\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" null | null | SASProtocol.HTTPS_ONLY || "%s\nr\nb\no\n\n" + Utility.ISO_8601_UTC_DATE_FORMATTER.format(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)) + "\n\n" + SASProtocol.HTTPS_ONLY + "\n" + Constants.HeaderConstants.TARGET_STORAGE_VERSION + "\n" } diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSASSignatureValues.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSASSignatureValues.java index 669eb32cdec3..c8b6fa5fad49 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSASSignatureValues.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSASSignatureValues.java @@ -39,7 +39,7 @@ public final class AccountSASSignatureValues { private String permissions; - private IPRange ipRange; + private IpRange ipRange; private String services; @@ -62,7 +62,7 @@ public AccountSASSignatureValues() { * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token * @throws NullPointerException If any of {@code sharedKeyCredentials}, {@code services}, {@code resourceTypes}, @@ -70,7 +70,8 @@ public AccountSASSignatureValues() { */ public static String generateAccountSAS(SharedKeyCredential sharedKeyCredential, AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, AccountSASPermission accountSASPermission, - OffsetDateTime expiryTime, OffsetDateTime startTime, String version, IPRange ipRange, SASProtocol sasProtocol) { + OffsetDateTime expiryTime, OffsetDateTime startTime, String version, + IpRange ipRange, SASProtocol sasProtocol) { AccountSASSignatureValues values = new AccountSASSignatureValues(); @@ -187,19 +188,19 @@ public AccountSASSignatureValues setPermissions(String permissions) { } /** - * @return the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * @return the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. */ - public IPRange getIpRange() { + public IpRange getIpRange() { return ipRange; } /** - * Sets the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * Sets the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. * * @param ipRange Allowed IP range to set * @return the updated AccountSASSignatureValues object. */ - public AccountSASSignatureValues setIpRange(IPRange ipRange) { + public AccountSASSignatureValues setIpRange(IpRange ipRange) { this.ipRange = ipRange; return this; } diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSasQueryParameters.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSasQueryParameters.java index 07f21db9667f..11f727c7ae3b 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSasQueryParameters.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/AccountSasQueryParameters.java @@ -46,13 +46,14 @@ public AccountSasQueryParameters(Map queryParamsMap, boolean r * @param protocol A {@code String} representing the allowed HTTP protocol(s) or {@code null}. * @param startTime A {@code java.util.Date} representing the start time for this SAS token or {@code null}. * @param expiryTime A {@code java.util.Date} representing the expiry time for this SAS token. - * @param ipRange A {@link IPRange} representing the range of valid IP addresses for this SAS token or + * @param ipRange A {@link IpRange} representing the range of valid IP addresses for this SAS token or * {@code null}. * @param permissions A {@code String} representing the storage permissions or {@code null}. * @param signature A {@code String} representing the signature for the SAS token. */ AccountSasQueryParameters(String version, String services, String resourceTypes, SASProtocol protocol, - OffsetDateTime startTime, OffsetDateTime expiryTime, IPRange ipRange, String permissions, String signature) { + OffsetDateTime startTime, OffsetDateTime expiryTime, IpRange ipRange, + String permissions, String signature) { super(version, protocol, startTime, expiryTime, ipRange, permissions, signature); this.services = services; this.resourceTypes = resourceTypes; diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/BaseSasQueryParameters.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/BaseSasQueryParameters.java index 11b44c393ceb..bd0b280f1c5d 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/BaseSasQueryParameters.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/BaseSasQueryParameters.java @@ -24,7 +24,7 @@ public abstract class BaseSasQueryParameters { protected OffsetDateTime expiryTime; - protected IPRange ipRange; + protected IpRange ipRange; protected String permissions; @@ -47,7 +47,7 @@ public BaseSasQueryParameters(Map queryParamsMap, boolean remo this.expiryTime = getQueryParameter(queryParamsMap, Constants.UrlConstants.SAS_EXPIRY_TIME, removeSASParametersFromMap, Utility::parseDate); this.ipRange = getQueryParameter(queryParamsMap, Constants.UrlConstants.SAS_IP_RANGE, - removeSASParametersFromMap, IPRange::parse); + removeSASParametersFromMap, IpRange::parse); this.permissions = getQueryParameter(queryParamsMap, Constants.UrlConstants.SAS_SIGNED_PERMISSIONS, removeSASParametersFromMap); this.signature = getQueryParameter(queryParamsMap, Constants.UrlConstants.SAS_SIGNATURE, @@ -98,13 +98,13 @@ protected T getQueryParameter(Map parameters, String name, * @param protocol A {@code String} representing the allowed HTTP protocol(s) or {@code null}. * @param startTime A {@code java.util.Date} representing the start time for this SAS token or {@code null}. * @param expiryTime A {@code java.util.Date} representing the expiry time for this SAS token. - * @param ipRange A {@link IPRange} representing the range of valid IP addresses for this SAS token or + * @param ipRange A {@link IpRange} representing the range of valid IP addresses for this SAS token or * {@code null}. * @param permissions A {@code String} representing the storage permissions or {@code null}. * @param signature A {@code String} representing the signature for the SAS token. */ public BaseSasQueryParameters(String version, SASProtocol protocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, IPRange ipRange, String permissions, String signature) { + OffsetDateTime expiryTime, IpRange ipRange, String permissions, String signature) { this.version = version; this.protocol = protocol; this.startTime = startTime; @@ -143,9 +143,9 @@ public OffsetDateTime getExpiryTime() { } /** - * @return {@link IPRange} + * @return {@link IpRange} */ - public IPRange getIpRange() { + public IpRange getIpRange() { return ipRange; } diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/IPRange.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/IpRange.java similarity index 77% rename from sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/IPRange.java rename to sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/IpRange.java index 5e79fb3eb9b2..e747edc6e427 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/IPRange.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/IpRange.java @@ -7,26 +7,26 @@ * This type specifies a continuous range of IP addresses. It is used to limit permissions on SAS tokens. Null may be * set if it is not desired to confine the sas permissions to an IP range. */ -public final class IPRange { +public final class IpRange { private String ipMin; private String ipMax; /** - * Constructs an IPRange object. + * Constructs an IpRange object. */ - public IPRange() { + public IpRange() { } /** - * Creates a {@code IPRange} from the specified string. + * Creates a {@code IpRange} from the specified string. * - * @param rangeStr The {@code String} representation of the {@code IPRange}. - * @return The {@code IPRange} generated from the {@code String}. + * @param rangeStr The {@code String} representation of the {@code IpRange}. + * @return The {@code IpRange} generated from the {@code String}. */ - public static IPRange parse(String rangeStr) { + public static IpRange parse(String rangeStr) { String[] addrs = rangeStr.split("-"); - IPRange range = new IPRange().setIpMin(addrs[0]); + IpRange range = new IpRange().setIpMin(addrs[0]); if (addrs.length > 1) { range.setIpMax(addrs[1]); } @@ -45,9 +45,9 @@ public String getIpMin() { * Sets the minimum IP address of the range. * * @param ipMin IP address to set as the minimum - * @return the updated IPRange object + * @return the updated IpRange object */ - public IPRange setIpMin(String ipMin) { + public IpRange setIpMin(String ipMin) { this.ipMin = ipMin; return this; } @@ -63,9 +63,9 @@ public String getIpMax() { * Sets the maximum IP address of the range. * * @param ipMax IP address to set as the maximum - * @return the updated IPRange object + * @return the updated IpRange object */ - public IPRange setIpMax(String ipMax) { + public IpRange setIpMax(String ipMax) { this.ipMax = ipMax; return this; } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java index 4d7291eda3f3..a85088aaaf38 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java @@ -26,7 +26,7 @@ import com.azure.storage.file.models.DirectoryProperties; import com.azure.storage.file.models.DirectorySetMetadataInfo; import com.azure.storage.file.models.FileHTTPHeaders; -import com.azure.storage.file.models.FileRef; +import com.azure.storage.file.models.FileReference; import com.azure.storage.file.models.HandleItem; import com.azure.storage.file.models.StorageException; import reactor.core.publisher.Mono; @@ -423,9 +423,9 @@ Mono> setMetadataWithResponse(MapAzure * Docs.

* - * @return {@link FileRef File info} in the storage directory + * @return {@link FileReference File info} in the storage directory */ - public PagedFlux listFilesAndDirectories() { + public PagedFlux listFilesAndDirectories() { return listFilesAndDirectories(null, null); } @@ -446,15 +446,15 @@ public PagedFlux listFilesAndDirectories() { * with. * @param maxResults Optional maximum number of files and/or directories to return per page. If the request does not * specify maxresults or specifies a value greater than 5,000, the server will return up to 5,000 items. - * @return {@link FileRef File info} in this directory with prefix and max number of return results. + * @return {@link FileReference File info} in this directory with prefix and max number of return results. */ - public PagedFlux listFilesAndDirectories(String prefix, Integer maxResults) { + public PagedFlux listFilesAndDirectories(String prefix, Integer maxResults) { return listFilesAndDirectoriesWithOptionalTimeout(prefix, maxResults, null, Context.NONE); } - PagedFlux listFilesAndDirectoriesWithOptionalTimeout(String prefix, Integer maxResults, Duration timeout, - Context context) { - Function>> retriever = + PagedFlux listFilesAndDirectoriesWithOptionalTimeout(String prefix, Integer maxResults, + Duration timeout, Context context) { + Function>> retriever = marker -> postProcessResponse(Utility.applyOptionalTimeout(this.azureFileStorageClient.directorys() .listFilesAndDirectoriesSegmentWithRestResponseAsync(shareName, directoryPath, prefix, snapshot, marker, maxResults, null, context), timeout) @@ -563,7 +563,8 @@ PagedFlux forceCloseHandlesWithOptionalTimeout(String handleId, boolean * directory is an invalid resource name. */ public Mono createSubDirectory(String subDirectoryName) { - return createSubDirectoryWithResponse(subDirectoryName, null, null, null).flatMap(FluxUtil::toMono); + return createSubDirectoryWithResponse(subDirectoryName, null, null, null) + .flatMap(FluxUtil::toMono); } /** @@ -667,7 +668,8 @@ Mono> deleteSubDirectoryWithResponse(String subDirectoryName, Con * invalid resource name. */ public Mono createFile(String fileName, long maxSize) { - return createFileWithResponse(fileName, maxSize, null, null, null, null).flatMap(FluxUtil::toMono); + return createFileWithResponse(fileName, maxSize, null, null, null, null) + .flatMap(FluxUtil::toMono); } /** @@ -830,15 +832,18 @@ private Response setMetadataResponse(final DirectorysS return new SimpleResponse<>(response, directorySetMetadataInfo); } - private List convertResponseAndGetNumOfResults(DirectorysListFilesAndDirectoriesSegmentResponse response) { - Set fileRefs = new TreeSet<>(Comparator.comparing(FileRef::getName)); + private List convertResponseAndGetNumOfResults( + DirectorysListFilesAndDirectoriesSegmentResponse response) { + Set fileReferences = new TreeSet<>(Comparator.comparing(FileReference::getName)); if (response.getValue().getSegment() != null) { response.getValue().getSegment().getDirectoryItems() - .forEach(directoryItem -> fileRefs.add(new FileRef(directoryItem.getName(), true, null))); + .forEach(directoryItem -> fileReferences.add(new FileReference(directoryItem.getName(), + true, null))); response.getValue().getSegment().getFileItems() - .forEach(fileItem -> fileRefs.add(new FileRef(fileItem.getName(), false, fileItem.getProperties()))); + .forEach(fileItem -> fileReferences.add(new FileReference(fileItem.getName(), false, + fileItem.getProperties()))); } - return new ArrayList<>(fileRefs); + return new ArrayList<>(fileReferences); } } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryClient.java index c053d517d3e4..5bcd44864e08 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryClient.java @@ -16,7 +16,7 @@ import com.azure.storage.file.models.DirectorySetMetadataInfo; import com.azure.storage.file.models.FileHTTPHeaders; import com.azure.storage.file.models.FileInfo; -import com.azure.storage.file.models.FileRef; +import com.azure.storage.file.models.FileReference; import com.azure.storage.file.models.HandleItem; import com.azure.storage.file.models.StorageException; import reactor.core.publisher.Mono; @@ -343,9 +343,9 @@ public Response setMetadataWithResponse(MapAzure * Docs.

* - * @return {@link FileRef File info} in the storage directory + * @return {@link FileReference File info} in the storage directory */ - public PagedIterable listFilesAndDirectories() { + public PagedIterable listFilesAndDirectories() { return listFilesAndDirectories(null, null, null, Context.NONE); } @@ -370,11 +370,11 @@ public PagedIterable listFilesAndDirectories() { * @param timeout An optional timeout applied to the operation. If a response is not returned before the timeout * concludes a {@link RuntimeException} will be thrown. * @param context Additional context that is passed through the Http pipeline during the service call. - * @return {@link FileRef File info} in this directory with prefix and max number of return results. + * @return {@link FileReference File info} in this directory with prefix and max number of return results. * @throws RuntimeException if the operation doesn't complete before the timeout concludes. */ - public PagedIterable listFilesAndDirectories(String prefix, Integer maxResults, Duration timeout, - Context context) { + public PagedIterable listFilesAndDirectories(String prefix, Integer maxResults, Duration timeout, + Context context) { return new PagedIterable<>(directoryAsyncClient .listFilesAndDirectoriesWithOptionalTimeout(prefix, maxResults, timeout, context)); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java index f7a9b9493ebb..9f1432ee8bb1 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java @@ -14,7 +14,7 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -41,7 +41,7 @@ import com.azure.storage.file.models.FileProperties; import com.azure.storage.file.models.FileRange; import com.azure.storage.file.models.FileUploadInfo; -import com.azure.storage.file.models.FileUploadRangeFromURLInfo; +import com.azure.storage.file.models.FileUploadRangeFromUrlInfo; import com.azure.storage.file.models.HandleItem; import com.azure.storage.file.models.StorageException; import reactor.core.Exceptions; @@ -805,11 +805,11 @@ Mono> uploadWithResponse(Flux data, long le * @param destinationOffset Starting point of the upload range on the destination. * @param sourceOffset Starting point of the upload range on the source. * @param sourceURI Specifies the URL of the source file. - * @return The {@link FileUploadRangeFromURLInfo file upload range from url info} + * @return The {@link FileUploadRangeFromUrlInfo file upload range from url info} */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public Mono uploadRangeFromURL(long length, long destinationOffset, long sourceOffset, - URI sourceURI) { + public Mono uploadRangeFromURL(long length, long destinationOffset, long sourceOffset, + URI sourceURI) { return uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI) .flatMap(FluxUtil::toMono); } @@ -830,17 +830,17 @@ public Mono uploadRangeFromURL(long length, long des * @param destinationOffset Starting point of the upload range on the destination. * @param sourceOffset Starting point of the upload range on the source. * @param sourceURI Specifies the URL of the source file. - * @return A response containing the {@link FileUploadRangeFromURLInfo file upload range from url info} with headers + * @return A response containing the {@link FileUploadRangeFromUrlInfo file upload range from url info} with headers * and response status code. */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public Mono> uploadRangeFromURLWithResponse(long length, - long destinationOffset, long sourceOffset, URI sourceURI) { + public Mono> uploadRangeFromURLWithResponse(long length, + long destinationOffset, long sourceOffset, URI sourceURI) { return withContext(context -> uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI, context)); } - Mono> uploadRangeFromURLWithResponse(long length, long destinationOffset, + Mono> uploadRangeFromURLWithResponse(long length, long destinationOffset, long sourceOffset, URI sourceURI, Context context) { FileRange destinationRange = new FileRange(destinationOffset, destinationOffset + length - 1); FileRange sourceRange = new FileRange(sourceOffset, sourceOffset + length - 1); @@ -1102,12 +1102,12 @@ public String getShareSnapshotId() { /** * Generates a SAS token with the specified parameters * - * @param permissions The {@code FileSASPermission} permission for the SAS + * @param permissions The {@code FileSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ - public String generateSAS(FileSASPermission permissions, OffsetDateTime expiryTime) { + public String generateSAS(FileSasPermission permissions, OffsetDateTime expiryTime) { return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -1130,17 +1130,17 @@ public String generateSAS(String identifier) { * Generates a SAS token with the specified parameters * * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code FileSASPermission} permission for the SAS + * @param permissions The {@code FileSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ - public String generateSAS(String identifier, FileSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -1151,18 +1151,18 @@ public String generateSAS(String identifier, FileSASPermission permissions, Offs * *

Code Samples

* - * {@codesnippet com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs.

* * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code FileSASPermission} permission for the SAS + * @param permissions The {@code FileSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -1171,11 +1171,12 @@ public String generateSAS(String identifier, FileSASPermission permissions, Offs * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ - public String generateSAS(String identifier, FileSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, + String cacheControl, String contentDisposition, String contentEncoding, + String contentLanguage, String contentType) { - FileServiceSASSignatureValues fileServiceSASSignatureValues = new FileServiceSASSignatureValues(version, + FileServiceSasSignatureValues fileServiceSASSignatureValues = new FileServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); @@ -1184,7 +1185,7 @@ public String generateSAS(String identifier, FileSASPermission permissions, Offs Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential); - FileServiceSASSignatureValues values = configureServiceSASSignatureValues(fileServiceSASSignatureValues, + FileServiceSasSignatureValues values = configureServiceSASSignatureValues(fileServiceSASSignatureValues, sharedKeyCredential.getAccountName()); FileServiceSasQueryParameters fileServiceSasQueryParameters = @@ -1196,8 +1197,8 @@ public String generateSAS(String identifier, FileSASPermission permissions, Offs /** * Sets fileServiceSASSignatureValues parameters dependent on the current file type */ - FileServiceSASSignatureValues configureServiceSASSignatureValues( - FileServiceSASSignatureValues fileServiceSASSignatureValues, String accountName) { + FileServiceSasSignatureValues configureServiceSASSignatureValues( + FileServiceSasSignatureValues fileServiceSASSignatureValues, String accountName) { // Set canonical name fileServiceSASSignatureValues.setCanonicalName(this.shareName, this.filePath, accountName); @@ -1321,14 +1322,14 @@ private Response uploadResponse(final FilesUploadRangeResponse r return new SimpleResponse<>(response, fileUploadInfo); } - private Response uploadRangeFromURLResponse( + private Response uploadRangeFromURLResponse( final FilesUploadRangeFromURLResponse response) { FileUploadRangeFromURLHeaders headers = response.getDeserializedHeaders(); String eTag = headers.getETag(); OffsetDateTime lastModified = headers.getLastModified(); Boolean isServerEncrypted = headers.isServerEncrypted(); - FileUploadRangeFromURLInfo fileUploadRangeFromURLInfo = - new FileUploadRangeFromURLInfo(eTag, lastModified, isServerEncrypted); + FileUploadRangeFromUrlInfo fileUploadRangeFromURLInfo = + new FileUploadRangeFromUrlInfo(eTag, lastModified, isServerEncrypted); return new SimpleResponse<>(response, fileUploadRangeFromURLInfo); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java index c71955995208..87a4fe3fee19 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java @@ -7,7 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -20,7 +20,7 @@ import com.azure.storage.file.models.FileProperties; import com.azure.storage.file.models.FileRange; import com.azure.storage.file.models.FileUploadInfo; -import com.azure.storage.file.models.FileUploadRangeFromURLInfo; +import com.azure.storage.file.models.FileUploadRangeFromUrlInfo; import com.azure.storage.file.models.HandleItem; import com.azure.storage.file.models.StorageException; import reactor.core.publisher.Flux; @@ -627,11 +627,11 @@ public Response uploadWithResponse(ByteBuffer data, long length, * @param destinationOffset Starting point of the upload range on the destination. * @param sourceOffset Starting point of the upload range on the source. * @param sourceURI Specifies the URL of the source file. - * @return The {@link FileUploadRangeFromURLInfo file upload range from url info} + * @return The {@link FileUploadRangeFromUrlInfo file upload range from url info} */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public FileUploadRangeFromURLInfo uploadRangeFromURL(long length, long destinationOffset, long sourceOffset, - URI sourceURI) { + public FileUploadRangeFromUrlInfo uploadRangeFromURL(long length, long destinationOffset, long sourceOffset, + URI sourceURI) { return uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI, null, Context.NONE) .getValue(); } @@ -655,14 +655,14 @@ public FileUploadRangeFromURLInfo uploadRangeFromURL(long length, long destinati * @param timeout An optional timeout applied to the operation. If a response is not returned before the timeout * concludes a {@link RuntimeException} will be thrown. * @param context Additional context that is passed through the Http pipeline during the service call. - * @return A response containing the {@link FileUploadRangeFromURLInfo file upload range from url info} with headers + * @return A response containing the {@link FileUploadRangeFromUrlInfo file upload range from url info} with headers * and response status code. * @throws RuntimeException if the operation doesn't complete before the timeout concludes. */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public Response uploadRangeFromURLWithResponse(long length, long destinationOffset, - long sourceOffset, URI sourceURI, Duration timeout, Context context) { - Mono> response = fileAsyncClient.uploadRangeFromURLWithResponse(length, + public Response uploadRangeFromURLWithResponse(long length, long destinationOffset, + long sourceOffset, URI sourceURI, Duration timeout, Context context) { + Mono> response = fileAsyncClient.uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI, context); return Utility.blockWithOptionalTimeout(response, timeout); } @@ -862,10 +862,10 @@ public String getShareSnapshotId() { * Generates a SAS token with the specified parameters * * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS - * @param permissions The {@code FileSASPermission} permission for the SAS + * @param permissions The {@code FileSasPermission} permission for the SAS * @return A string that represents the SAS token */ - public String generateSAS(OffsetDateTime expiryTime, FileSASPermission permissions) { + public String generateSAS(OffsetDateTime expiryTime, FileSasPermission permissions) { return this.fileAsyncClient.generateSAS(permissions, expiryTime); } @@ -883,16 +883,16 @@ public String generateSAS(String identifier) { * Generates a SAS token with the specified parameters * * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code FileSASPermission} permission for the SAS + * @param permissions The {@code FileSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ - public String generateSAS(String identifier, FileSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.fileAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } @@ -902,18 +902,18 @@ public String generateSAS(String identifier, FileSASPermission permissions, Offs * *

Code Samples

* - * {@codesnippet com.azure.storage.file.FileClient.generateSAS#String-FileSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.file.FileClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs.

* * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code FileSASPermission} permission for the SAS + * @param permissions The {@code FileSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -921,9 +921,9 @@ public String generateSAS(String identifier, FileSASPermission permissions, Offs * @param contentType An optional {@code String} content-type header for the SAS. * @return A string that represents the SAS token */ - public String generateSAS(String identifier, FileSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { return this.fileAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileSASPermission.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileSasPermission.java similarity index 82% rename from sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileSASPermission.java rename to sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileSasPermission.java index 9a2fce512594..536671ab50e3 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileSASPermission.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileSasPermission.java @@ -11,10 +11,10 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a file. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a {@link - * FileServiceSASSignatureValues} object. It is possible to construct the permissions string without this class, but the + * FileServiceSasSignatureValues} object. It is possible to construct the permissions string without this class, but the * order of the permissions is particular and this class guarantees correctness. */ -public final class FileSASPermission { +public final class FileSasPermission { private boolean readPermission; private boolean createPermission; @@ -24,21 +24,21 @@ public final class FileSASPermission { private boolean deletePermission; /** - * Initializes an {@code FileSASPermission} object with all fields set to false. + * Initializes an {@code FileSasPermission} object with all fields set to false. */ - public FileSASPermission() { + public FileSasPermission() { } /** - * Creates an {@code FileSASPermission} from the specified permissions string. This method will throw an + * Creates an {@code FileSasPermission} from the specified permissions string. This method will throw an * {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission. * - * @param permString A {@code String} which represents the {@code FileSASPermission}. - * @return A {@code FileSASPermission} generated from the given {@code String}. + * @param permString A {@code String} which represents the {@code FileSasPermission}. + * @return A {@code FileSasPermission} generated from the given {@code String}. * @throws IllegalArgumentException If {@code permString} contains a character other than r, c, w, or d. */ - public static FileSASPermission parse(String permString) { - FileSASPermission permissions = new FileSASPermission(); + public static FileSasPermission parse(String permString) { + FileSasPermission permissions = new FileSasPermission(); for (int i = 0; i < permString.length(); i++) { char c = permString.charAt(i); @@ -75,9 +75,9 @@ public boolean getReadPermission() { * Sets the read permission status. * * @param hasReadPermission Permission status to set - * @return the updated FileSASPermission object + * @return the updated FileSasPermission object */ - public FileSASPermission setReadPermission(boolean hasReadPermission) { + public FileSasPermission setReadPermission(boolean hasReadPermission) { this.readPermission = hasReadPermission; return this; } @@ -93,9 +93,9 @@ public boolean getCreatePermission() { * Sets the create permission status. * * @param hasCreatePermission Permission status to set - * @return the updated FileSASPermission object + * @return the updated FileSasPermission object */ - public FileSASPermission setCreatePermission(boolean hasCreatePermission) { + public FileSasPermission setCreatePermission(boolean hasCreatePermission) { this.createPermission = hasCreatePermission; return this; } @@ -111,9 +111,9 @@ public boolean getWritePermission() { * Sets the write permission status. * * @param hasWritePermission Permission status to set - * @return the updated FileSASPermission object + * @return the updated FileSasPermission object */ - public FileSASPermission setWritePermission(boolean hasWritePermission) { + public FileSasPermission setWritePermission(boolean hasWritePermission) { this.writePermission = hasWritePermission; return this; } @@ -129,9 +129,9 @@ public boolean getDeletePermission() { * Sets the delete permission status. * * @param hasDeletePermission Permission status to set - * @return the updated FileSASPermission object + * @return the updated FileSasPermission object */ - public FileSASPermission setDeletePermission(boolean hasDeletePermission) { + public FileSasPermission setDeletePermission(boolean hasDeletePermission) { this.deletePermission = hasDeletePermission; return this; } @@ -140,7 +140,7 @@ public FileSASPermission setDeletePermission(boolean hasDeletePermission) { * Converts the given permissions to a {@code String}. Using this method will guarantee the permissions are in an * order accepted by the service. * - * @return A {@code String} which represents the {@code FileSASPermission}. + * @return A {@code String} which represents the {@code FileSasPermission}. */ @Override public String toString() { diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java index b21a2c79b30d..8be99aac38c2 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java @@ -17,7 +17,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.AccountSASSignatureValues; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -461,7 +461,7 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * *

Code Samples

* - * {@codesnippet com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol} + * {@codesnippet com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol} * *

For more information, see the * Azure Docs.

@@ -472,14 +472,14 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, - AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - IPRange ipRange, SASProtocol sasProtocol) { + AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, + String version, IpRange ipRange, SASProtocol sasProtocol) { SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.azureFileStorageClient .getHttpPipeline()); @@ -487,6 +487,5 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS return AccountSASSignatureValues.generateAccountSAS(sharedKeyCredential, accountSASService, accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol); - } } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java index b257079af5b8..2428d2a9fd43 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java @@ -11,7 +11,7 @@ import com.azure.storage.common.AccountSASPermission; import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -387,7 +387,7 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * *

Code Samples

* - * {@codesnippet com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol} + * {@codesnippet com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol} * *

For more information, see the * Azure Docs.

@@ -398,13 +398,13 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token */ public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, - AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - IPRange ipRange, SASProtocol sasProtocol) { + AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, + String version, IpRange ipRange, SASProtocol sasProtocol) { return this.fileServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasQueryParameters.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasQueryParameters.java index 35384c32bf1d..4d2be37d8f71 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasQueryParameters.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasQueryParameters.java @@ -5,7 +5,7 @@ import com.azure.storage.common.BaseSasQueryParameters; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.time.OffsetDateTime; @@ -13,7 +13,7 @@ /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link FileServiceSASSignatureValues} type. Once generated, it can be set on + * by the user; it is only generated by the {@link FileServiceSasSignatureValues} type. Once generated, it can be set on * a {@link FileClientBuilder} object to be constructed as part of a URL or it can be encoded into a {@code String} and * appended to a URL directly (though caution should be taken here in case there are existing query parameters, which * might affect the appropriate means of appending these query parameters). NOTE: Instances of this class are immutable @@ -68,7 +68,7 @@ public FileServiceSasQueryParameters(Map queryParamsMap, boole * @param protocol A {@code String} representing the allowed HTTP protocol(s) or {@code null}. * @param startTime A {@code java.util.Date} representing the start time for this SAS token or {@code null}. * @param expiryTime A {@code java.util.Date} representing the expiry time for this SAS token. - * @param ipRange A {@link IPRange} representing the range of valid IP addresses for this SAS token or + * @param ipRange A {@link IpRange} representing the range of valid IP addresses for this SAS token or * {@code null}. * @param identifier A {@code String} representing the signed identifier (only for Service SAS) or {@code null}. * @param resource A {@code String} representing the storage share or file (only for Service SAS). @@ -76,7 +76,7 @@ public FileServiceSasQueryParameters(Map queryParamsMap, boole * @param signature A {@code String} representing the signature for the SAS token. */ FileServiceSasQueryParameters(String version, SASProtocol protocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, IPRange ipRange, String identifier, String resource, String permissions, + OffsetDateTime expiryTime, IpRange ipRange, String identifier, String resource, String permissions, String signature, String cacheControl, String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { super(version, protocol, startTime, expiryTime, ipRange, permissions, signature); @@ -91,7 +91,7 @@ public FileServiceSasQueryParameters(Map queryParamsMap, boole } /** - * @return The signed identifier (only for {@link FileServiceSASSignatureValues}) or {@code null}. Please see + * @return The signed identifier (only for {@link FileServiceSasSignatureValues}) or {@code null}. Please see * here * for more information. */ @@ -100,7 +100,7 @@ public String getIdentifier() { } /** - * @return The storage share or file (only for {@link FileServiceSASSignatureValues}). + * @return The storage share or file (only for {@link FileServiceSasSignatureValues}). */ public String getResource() { return resource; diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSASSignatureValues.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java similarity index 81% rename from sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSASSignatureValues.java rename to sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java index e9e5c14bff3d..e3aa5bee1f36 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSASSignatureValues.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java @@ -4,7 +4,7 @@ package com.azure.storage.file; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SharedKeyCredential; @@ -12,7 +12,7 @@ import java.time.OffsetDateTime; /** - * FileServiceSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage service. Once + * FileServiceSasSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage service. Once * all the values here are set appropriately, call generateSASQueryParameters to obtain a representation of the SAS * which can actually be applied to file urls. Note: that both this class and {@link FileServiceSasQueryParameters} * exist because the former is mutable and a logical representation while the latter is immutable and used to generate @@ -28,7 +28,7 @@ * here * for additional samples.

*/ -final class FileServiceSASSignatureValues { +final class FileServiceSasSignatureValues { private String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; @@ -40,7 +40,7 @@ final class FileServiceSASSignatureValues { private String permissions; - private IPRange ipRange; + private IpRange ipRange; private String canonicalName; @@ -61,7 +61,7 @@ final class FileServiceSASSignatureValues { /** * Creates an object with empty values for all fields. */ - FileServiceSASSignatureValues() { + FileServiceSasSignatureValues() { } /** @@ -70,7 +70,7 @@ final class FileServiceSASSignatureValues { * @param expiryTime Time the SAS becomes valid * @param permissions Permissions granted by the SAS */ - FileServiceSASSignatureValues(OffsetDateTime expiryTime, String permissions) { + FileServiceSasSignatureValues(OffsetDateTime expiryTime, String permissions) { this.expiryTime = expiryTime; this.permissions = permissions; } @@ -80,12 +80,12 @@ final class FileServiceSASSignatureValues { * * @param identifier Identifier for the SAS */ - FileServiceSASSignatureValues(String identifier) { + FileServiceSasSignatureValues(String identifier) { this.identifier = identifier; } - FileServiceSASSignatureValues(String version, SASProtocol sasProtocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, String permission, IPRange ipRange, String identifier, String cacheControl, + FileServiceSasSignatureValues(String version, SASProtocol sasProtocol, OffsetDateTime startTime, + OffsetDateTime expiryTime, String permission, IpRange ipRange, String identifier, String cacheControl, String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { if (version != null) { this.version = version; @@ -116,9 +116,9 @@ public String getVersion() { * by the library. * * @param version Version to target - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setVersion(String version) { + public FileServiceSasSignatureValues setVersion(String version) { this.version = version; return this; } @@ -134,9 +134,9 @@ public SASProtocol getProtocol() { * Sets the {@link SASProtocol} which determines the protocols allowed by the SAS. * * @param protocol Protocol for the SAS - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setProtocol(SASProtocol protocol) { + public FileServiceSasSignatureValues setProtocol(SASProtocol protocol) { this.protocol = protocol; return this; } @@ -152,9 +152,9 @@ public OffsetDateTime getStartTime() { * Sets when the SAS will take effect. * * @param startTime When the SAS takes effect - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setStartTime(OffsetDateTime startTime) { + public FileServiceSasSignatureValues setStartTime(OffsetDateTime startTime) { this.startTime = startTime; return this; } @@ -170,47 +170,47 @@ public OffsetDateTime getExpiryTime() { * Sets the time after which the SAS will no longer work. * * @param expiryTime When the SAS will no longer work - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setExpiryTime(OffsetDateTime expiryTime) { + public FileServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime) { this.expiryTime = expiryTime; return this; } /** - * @return the permissions string allowed by the SAS. Please refer to either {@link ShareSASPermission} or {@link - * FileSASPermission} depending on the resource being accessed for help determining the permissions allowed. + * @return the permissions string allowed by the SAS. Please refer to either {@link ShareSasPermission} or {@link + * FileSasPermission} depending on the resource being accessed for help determining the permissions allowed. */ public String getPermissions() { return permissions; } /** - * Sets the permissions string allowed by the SAS. Please refer to either {@link ShareSASPermission} or {@link - * FileSASPermission} depending on the resource being accessed for help constructing the permissions string. + * Sets the permissions string allowed by the SAS. Please refer to either {@link ShareSasPermission} or {@link + * FileSasPermission} depending on the resource being accessed for help constructing the permissions string. * * @param permissions Permissions string for the SAS - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setPermissions(String permissions) { + public FileServiceSasSignatureValues setPermissions(String permissions) { this.permissions = permissions; return this; } /** - * @return the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * @return the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. */ - public IPRange getIpRange() { + public IpRange getIpRange() { return ipRange; } /** - * Sets the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * Sets the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. * * @param ipRange Allowed IP range to set - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setIpRange(IPRange ipRange) { + public FileServiceSasSignatureValues setIpRange(IpRange ipRange) { this.ipRange = ipRange; return this; } @@ -226,9 +226,9 @@ public String getResource() { * Sets the resource the SAS user may access. * * @param resource Allowed resources string to set - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setResource(String resource) { + public FileServiceSasSignatureValues setResource(String resource) { this.resource = resource; return this; } @@ -244,9 +244,9 @@ public String getCanonicalName() { * Sets the canonical name of the object the SAS user may access. * * @param canonicalName Canonical name of the object the SAS grants access - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setCanonicalName(String canonicalName) { + public FileServiceSasSignatureValues setCanonicalName(String canonicalName) { this.canonicalName = canonicalName; return this; } @@ -258,9 +258,9 @@ public FileServiceSASSignatureValues setCanonicalName(String canonicalName) { * @param shareName Name of the share * @param filePath Name of the file * @param accountName Name of the account that contains the object - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setCanonicalName(String shareName, String filePath, String accountName) { + public FileServiceSasSignatureValues setCanonicalName(String shareName, String filePath, String accountName) { this.canonicalName = String.format("/file/%s/%s/%s", accountName, shareName, filePath); return this; } @@ -271,9 +271,9 @@ public FileServiceSASSignatureValues setCanonicalName(String shareName, String f * * @param shareName Name of the share * @param accountName Name of the account that contains the object - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setCanonicalName(String shareName, String accountName) { + public FileServiceSasSignatureValues setCanonicalName(String shareName, String accountName) { this.canonicalName = String.format("/file/%s/%s", accountName, shareName); return this; } @@ -293,9 +293,9 @@ public String getIdentifier() { * for more information. * * @param identifier Name of the access policy - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setIdentifier(String identifier) { + public FileServiceSasSignatureValues setIdentifier(String identifier) { this.identifier = identifier; return this; } @@ -311,9 +311,9 @@ public String getCacheControl() { * Sets the cache-control header for the SAS. * * @param cacheControl Cache-Control header value - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setCacheControl(String cacheControl) { + public FileServiceSasSignatureValues setCacheControl(String cacheControl) { this.cacheControl = cacheControl; return this; } @@ -329,9 +329,9 @@ public String getContentDisposition() { * Sets the content-disposition header for the SAS. * * @param contentDisposition Content-Disposition header value - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setContentDisposition(String contentDisposition) { + public FileServiceSasSignatureValues setContentDisposition(String contentDisposition) { this.contentDisposition = contentDisposition; return this; } @@ -347,9 +347,9 @@ public String getContentEncoding() { * Sets the content-encoding header for the SAS. * * @param contentEncoding Content-Encoding header value - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setContentEncoding(String contentEncoding) { + public FileServiceSasSignatureValues setContentEncoding(String contentEncoding) { this.contentEncoding = contentEncoding; return this; } @@ -365,9 +365,9 @@ public String getContentLanguage() { * Sets the content-language header for the SAS. * * @param contentLanguage Content-Language header value - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setContentLanguage(String contentLanguage) { + public FileServiceSasSignatureValues setContentLanguage(String contentLanguage) { this.contentLanguage = contentLanguage; return this; } @@ -383,9 +383,9 @@ public String getContentType() { * Sets the content-type header for the SAS. * * @param contentType Content-Type header value - * @return the updated FileServiceSASSignatureValues object + * @return the updated FileServiceSasSignatureValues object */ - public FileServiceSASSignatureValues setContentType(String contentType) { + public FileServiceSasSignatureValues setContentType(String contentType) { this.contentType = contentType; return this; } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java index 009e6a752294..ad6417f433af 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java @@ -15,7 +15,7 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -885,12 +885,12 @@ public String getSnapshotId() { /** * Generates a SAS token with the specified parameters * - * @param permissions The {@code ShareSASPermission} permission for the SAS + * @param permissions The {@code ShareSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ - public String generateSAS(ShareSASPermission permissions, OffsetDateTime expiryTime) { + public String generateSAS(ShareSasPermission permissions, OffsetDateTime expiryTime) { return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -913,17 +913,17 @@ public String generateSAS(String identifier) { * Generates a SAS token with the specified parameters * * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code ShareSASPermission} permission for the SAS + * @param permissions The {@code ShareSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ - public String generateSAS(String identifier, ShareSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */); @@ -934,18 +934,18 @@ public String generateSAS(String identifier, ShareSASPermission permissions, Off * *

Code Samples

* - * {@codesnippet com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs.

* * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code ShareSASPermission} permission for the SAS + * @param permissions The {@code ShareSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -954,11 +954,11 @@ public String generateSAS(String identifier, ShareSASPermission permissions, Off * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredentials} is null */ - public String generateSAS(String identifier, ShareSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { - FileServiceSASSignatureValues fileServiceSASSignatureValues = new FileServiceSASSignatureValues(version, + FileServiceSasSignatureValues fileServiceSASSignatureValues = new FileServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); @@ -967,7 +967,7 @@ public String generateSAS(String identifier, ShareSASPermission permissions, Off Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential); - FileServiceSASSignatureValues values = configureServiceSASSignatureValues(fileServiceSASSignatureValues, + FileServiceSasSignatureValues values = configureServiceSASSignatureValues(fileServiceSASSignatureValues, sharedKeyCredential.getAccountName()); FileServiceSasQueryParameters fileServiceSasQueryParameters = @@ -992,8 +992,8 @@ public String getShareName() { /** * Sets fileServiceSASSignatureValues parameters dependent on the current file type */ - FileServiceSASSignatureValues configureServiceSASSignatureValues( - FileServiceSASSignatureValues fileServiceSASSignatureValues, String accountName) { + FileServiceSasSignatureValues configureServiceSASSignatureValues( + FileServiceSasSignatureValues fileServiceSASSignatureValues, String accountName) { // Set canonical name fileServiceSASSignatureValues.setCanonicalName(this.shareName, accountName); diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java index e1be66d50c61..356f2336d398 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -789,10 +789,10 @@ public String getSnapshotId() { * Generates a SAS token with the specified parameters * * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS - * @param permissions The {@code ShareSASPermission} permission for the SAS + * @param permissions The {@code ShareSasPermission} permission for the SAS * @return A string that represents the SAS token */ - public String generateSAS(OffsetDateTime expiryTime, ShareSASPermission permissions) { + public String generateSAS(OffsetDateTime expiryTime, ShareSasPermission permissions) { return this.client.generateSAS(permissions, expiryTime); } @@ -810,16 +810,16 @@ public String generateSAS(String identifier) { * Generates a SAS token with the specified parameters * * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code ShareSASPermission} permission for the SAS + * @param permissions The {@code ShareSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ - public String generateSAS(String identifier, ShareSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } @@ -828,18 +828,18 @@ public String generateSAS(String identifier, ShareSASPermission permissions, Off * *

Code Samples

* - * {@codesnippet com.azure.storage.file.ShareClient.generateSAS#String-ShareSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String} + * {@codesnippet com.azure.storage.file.ShareClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String} * *

For more information, see the * Azure Docs.

* * @param identifier The {@code String} name of the access policy on the share this SAS references if any - * @param permissions The {@code ShareSASPermission} permission for the SAS + * @param permissions The {@code ShareSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param cacheControl An optional {@code String} cache-control header for the SAS. * @param contentDisposition An optional {@code String} content-disposition header for the SAS. * @param contentEncoding An optional {@code String} content-encoding header for the SAS. @@ -847,9 +847,9 @@ public String generateSAS(String identifier, ShareSASPermission permissions, Off * @param contentType An optional {@code String} content-type header for the SAS. * @return A string that represents the SAS token */ - public String generateSAS(String identifier, ShareSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange, String cacheControl, - String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { + public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl, + String contentDisposition, String contentEncoding, String contentLanguage, String contentType) { return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareSASPermission.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareSasPermission.java similarity index 51% rename from sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareSASPermission.java rename to sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareSasPermission.java index 670f1698aa44..f923c38de8bd 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareSASPermission.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareSasPermission.java @@ -12,59 +12,59 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a share. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a {@link - * FileServiceSASSignatureValues} object. It is possible to construct the permissions string without this class, but the + * FileServiceSasSignatureValues} object. It is possible to construct the permissions string without this class, but the * order of the permissions is particular and this class guarantees correctness. */ -public final class ShareSASPermission { - private boolean read; +public final class ShareSasPermission { + private boolean readPermission; - private boolean create; + private boolean createPermission; - private boolean write; + private boolean writePermission; - private boolean delete; + private boolean deletePermission; - private boolean list; + private boolean listPermission; /** - * Initializes an {@code ShareSASPermission} object with all fields set to false. + * Initializes an {@code ShareSasPermission} object with all fields set to false. */ - public ShareSASPermission() { + public ShareSasPermission() { } /** - * Creates an {@code ShareSASPermission} from the specified permissions string. This method will throw an + * Creates an {@code ShareSasPermission} from the specified permissions string. This method will throw an * {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission. * - * @param permString A {@code String} which represents the {@code ShareSASPermission}. - * @return A {@code ShareSASPermission} generated from the given {@code String}. + * @param permissionString A {@code String} which represents the {@code ShareSasPermission}. + * @return A {@code ShareSasPermission} generated from the given {@code String}. * @throws IllegalArgumentException If {@code permString} contains a character other than r, c, w, d, or l. */ - public static ShareSASPermission parse(String permString) { - ShareSASPermission permissions = new ShareSASPermission(); + public static ShareSasPermission parse(String permissionString) { + ShareSasPermission permissions = new ShareSasPermission(); - for (int i = 0; i < permString.length(); i++) { - char c = permString.charAt(i); + for (int i = 0; i < permissionString.length(); i++) { + char c = permissionString.charAt(i); switch (c) { case 'r': - permissions.read = true; + permissions.readPermission = true; break; case 'c': - permissions.create = true; + permissions.createPermission = true; break; case 'w': - permissions.write = true; + permissions.writePermission = true; break; case 'd': - permissions.delete = true; + permissions.deletePermission = true; break; case 'l': - permissions.list = true; + permissions.listPermission = true; break; default: throw new IllegalArgumentException( String.format(Locale.ROOT, SR.ENUM_COULD_NOT_BE_PARSED_INVALID_VALUE, - "Permissions", permString, c)); + "Permissions", permissionString, c)); } } return permissions; @@ -73,90 +73,90 @@ public static ShareSASPermission parse(String permString) { /** * @return the read permission status */ - public boolean getRead() { - return read; + public boolean getReadPermission() { + return readPermission; } /** * Sets the read permission status. * - * @param read Permission status to set - * @return the updated ShareSASPermission object + * @param hasReadPermission Permission status to set + * @return the updated ShareSasPermission object */ - public ShareSASPermission setRead(boolean read) { - this.read = read; + public ShareSasPermission setReadPermission(boolean hasReadPermission) { + this.readPermission = hasReadPermission; return this; } /** * @return the create permission status */ - public boolean getCreate() { - return create; + public boolean getCreatePermission() { + return createPermission; } /** * Sets the create permission status. * - * @param create Permission status to set - * @return the updated ShareSASPermission object + * @param hasCreatePermission Permission status to set + * @return the updated ShareSasPermission object */ - public ShareSASPermission setCreate(boolean create) { - this.create = create; + public ShareSasPermission setCreatePermission(boolean hasCreatePermission) { + this.createPermission = hasCreatePermission; return this; } /** * @return the write permission status */ - public boolean getWrite() { - return write; + public boolean getWritePermission() { + return writePermission; } /** * Sets the write permission status. * - * @param write Permission status to set - * @return the updated ShareSASPermission object + * @param hasWritePermission Permission status to set + * @return the updated ShareSasPermission object */ - public ShareSASPermission setWrite(boolean write) { - this.write = write; + public ShareSasPermission setWritePermission(boolean hasWritePermission) { + this.writePermission = hasWritePermission; return this; } /** * @return the delete permission status */ - public boolean getDelete() { - return delete; + public boolean getDeletePermission() { + return deletePermission; } /** * Sets the delete permission status. * - * @param delete Permission status to set - * @return the updated ShareSASPermission object + * @param hasDeletePermission Permission status to set + * @return the updated ShareSasPermission object */ - public ShareSASPermission setDelete(boolean delete) { - this.delete = delete; + public ShareSasPermission setDeletePermission(boolean hasDeletePermission) { + this.deletePermission = hasDeletePermission; return this; } /** * @return the list permission status */ - public boolean getList() { - return list; + public boolean getListPermission() { + return listPermission; } /** * Sets the list permission status. * - * @param list Permission status to set - * @return the updated ShareSASPermission object + * @param hasListPermission Permission status to set + * @return the updated ShareSasPermission object */ - public ShareSASPermission setList(boolean list) { - this.list = list; + public ShareSasPermission setListPermission(boolean hasListPermission) { + this.listPermission = hasListPermission; return this; } @@ -164,7 +164,7 @@ public ShareSASPermission setList(boolean list) { * Converts the given permissions to a {@code String}. Using this method will guarantee the permissions are in an * order accepted by the service. * - * @return A {@code String} which represents the {@code ShareSASPermission}. + * @return A {@code String} which represents the {@code ShareSasPermission}. */ @Override public String toString() { @@ -172,23 +172,23 @@ public String toString() { // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas final StringBuilder builder = new StringBuilder(); - if (this.read) { + if (this.readPermission) { builder.append('r'); } - if (this.create) { + if (this.createPermission) { builder.append('c'); } - if (this.write) { + if (this.writePermission) { builder.append('w'); } - if (this.delete) { + if (this.deletePermission) { builder.append('d'); } - if (this.list) { + if (this.listPermission) { builder.append('l'); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileRef.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileReference.java similarity index 90% rename from sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileRef.java rename to sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileReference.java index d9b21e3fc210..3ed75e9d5008 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileRef.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileReference.java @@ -9,7 +9,7 @@ * Contains file or directory reference information in the storage File service. */ @Immutable -public final class FileRef { +public final class FileReference { private final String name; private final boolean isDirectory; private final FileProperty fileProperty; @@ -21,7 +21,7 @@ public final class FileRef { * @param isDirectory A boolean set to true if the reference is a directory, false if the reference is a file. * @param fileProperty Property of a file. Pass {@code null} if the reference is a directory. */ - public FileRef(final String name, final boolean isDirectory, final FileProperty fileProperty) { + public FileReference(final String name, final boolean isDirectory, final FileProperty fileProperty) { this.name = name; this.isDirectory = isDirectory; this.fileProperty = fileProperty; diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileUploadRangeFromURLInfo.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileUploadRangeFromUrlInfo.java similarity index 90% rename from sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileUploadRangeFromURLInfo.java rename to sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileUploadRangeFromUrlInfo.java index 4b1f3dc127e5..e3009c9b32fb 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileUploadRangeFromURLInfo.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/FileUploadRangeFromUrlInfo.java @@ -5,12 +5,12 @@ import java.time.OffsetDateTime; -public final class FileUploadRangeFromURLInfo { +public final class FileUploadRangeFromUrlInfo { private final String eTag; private final OffsetDateTime lastModified; private final Boolean isServerEncrypted; - public FileUploadRangeFromURLInfo(final String eTag, final OffsetDateTime lastModified, final Boolean isServerEncrypted) { + public FileUploadRangeFromUrlInfo(final String eTag, final OffsetDateTime lastModified, final Boolean isServerEncrypted) { this.eTag = eTag; this.lastModified = lastModified; this.isServerEncrypted = isServerEncrypted; diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java index f37a7c8b848f..602321d9d30d 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java @@ -3,7 +3,7 @@ package com.azure.storage.file; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -644,21 +644,21 @@ public void forceCloseHandlesAsync() { } /** - * Generates a code sample for using {@link FileAsyncClient#generateSAS(String, FileSASPermission, OffsetDateTime, - * OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * Generates a code sample for using {@link FileAsyncClient#generateSAS(String, FileSasPermission, OffsetDateTime, + * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASAsync() { FileAsyncClient fileAsyncClient = createAsyncClientWithSASToken(); - // BEGIN: com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String String identifier = "identifier"; - FileSASPermission permissions = new FileSASPermission() + FileSasPermission permissions = new FileSasPermission() .setReadPermission(true) .setCreatePermission(true) .setDeletePermission(true) .setWritePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -670,7 +670,7 @@ public void generateSASAsync() { String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; String sas = fileAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java index 159cb494c44f..e8c5d8e78f5c 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java @@ -5,7 +5,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -18,7 +18,7 @@ import com.azure.storage.file.models.FileProperties; import com.azure.storage.file.models.FileRange; import com.azure.storage.file.models.FileUploadInfo; -import com.azure.storage.file.models.FileUploadRangeFromURLInfo; +import com.azure.storage.file.models.FileUploadRangeFromUrlInfo; import com.azure.storage.file.models.NtfsFileAttributes; import java.net.URI; @@ -348,7 +348,7 @@ public void downloadFileMaxOverload() { public void uploadFileFromURLAsync() throws URISyntaxException { FileClient fileClient = createClientWithSASToken(); // BEGIN: com.azure.storage.file.fileClient.uploadRangeFromURL#long-long-long-uri - FileUploadRangeFromURLInfo response = fileClient.uploadRangeFromURL(6, 8, 0, new URI("filewithSAStoken")); + FileUploadRangeFromUrlInfo response = fileClient.uploadRangeFromURL(6, 8, 0, new URI("filewithSAStoken")); System.out.println("Completed upload range from url!"); // END: com.azure.storage.file.fileClient.uploadRangeFromURL#long-long-long-uri } @@ -360,7 +360,7 @@ public void uploadFileFromURLAsync() throws URISyntaxException { public void uploadFileFromURLWithResponseAsync() throws URISyntaxException { FileClient fileClient = createClientWithSASToken(); // BEGIN: com.azure.storage.file.fileClient.uploadRangeFromURLWithResponse#long-long-long-uri-duration-context - Response response = fileClient.uploadRangeFromURLWithResponse(6, + Response response = fileClient.uploadRangeFromURLWithResponse(6, 8, 0, new URI("filewithSAStoken"), Duration.ofSeconds(1), Context.NONE); System.out.println("Completed upload range from url!"); // END: com.azure.storage.file.fileClient.uploadRangeFromURLWithResponse#long-long-long-uri-duration-context @@ -598,21 +598,21 @@ public void forceCloseHandles() { } /** - * Generates a code sample for using {@link FileClient#generateSAS(String, FileSASPermission, OffsetDateTime, - * OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * Generates a code sample for using {@link FileClient#generateSAS(String, FileSasPermission, OffsetDateTime, + * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSAS() { FileClient fileClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.FileClient.generateSAS#String-FileSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.file.FileClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String String identifier = "identifier"; - FileSASPermission permissions = new FileSASPermission() + FileSasPermission permissions = new FileSasPermission() .setReadPermission(true) .setCreatePermission(true) .setDeletePermission(true) .setWritePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -624,7 +624,7 @@ public void generateSAS() { String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; String sas = fileClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.file.FileClient.generateSAS#String-FileSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.file.FileClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java index 59a9ad6a0001..3765b79feffb 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java @@ -6,7 +6,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -271,11 +271,11 @@ public void clearPropertiesAsync() { /** * Generates a code sample for using {@link FileServiceAsyncClient#generateAccountSAS(AccountSASService, - * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IPRange, SASProtocol)} + * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)} */ public void generateAccountSASAsync() { FileServiceAsyncClient fileServiceAsyncClient = createAsyncClientWithSASToken(); - // BEGIN: com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // BEGIN: com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol AccountSASService service = new AccountSASService() .setBlob(true) .setFile(true) @@ -296,7 +296,7 @@ public void generateAccountSASAsync() { .setUpdatePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -304,6 +304,6 @@ public void generateAccountSASAsync() { String sas = fileServiceAsyncClient.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version, ipRange, sasProtocol); - // END: com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // END: com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol } } diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java index 001a33c49b72..33d78accdad9 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java @@ -8,7 +8,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -262,11 +262,11 @@ public void clearProperties() { /** * Generates a code sample for using {@link FileServiceClient#generateAccountSAS(AccountSASService, - * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IPRange, SASProtocol)} + * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)} */ public void generateAccountSAS() { FileServiceClient fileServiceClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // BEGIN: com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol AccountSASService service = new AccountSASService() .setBlob(true) .setFile(true) @@ -287,7 +287,7 @@ public void generateAccountSAS() { .setUpdatePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -295,7 +295,7 @@ public void generateAccountSAS() { String sas = fileServiceClient.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version, ipRange, sasProtocol); - // END: com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // END: com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol } diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java index 208359a44917..0b9334b4c576 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java @@ -3,7 +3,7 @@ package com.azure.storage.file; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -523,22 +523,22 @@ public void getSnapshotIdAsync() { } /** - * Generates a code sample for using {@link ShareAsyncClient#generateSAS(String, ShareSASPermission, OffsetDateTime, - * OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * Generates a code sample for using {@link ShareAsyncClient#generateSAS(String, ShareSasPermission, OffsetDateTime, + * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSASAsync() { ShareAsyncClient shareAsyncClient = createAsyncClientWithSASToken(); - // BEGIN: com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String String identifier = "identifier"; - ShareSASPermission permissions = new ShareSASPermission() - .setRead(true) - .setCreate(true) - .setDelete(true) - .setWrite(true) - .setList(true); + ShareSasPermission permissions = new ShareSasPermission() + .setReadPermission(true) + .setCreatePermission(true) + .setDeletePermission(true) + .setWritePermission(true) + .setListPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -550,7 +550,7 @@ public void generateSASAsync() { String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; String sas = shareAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java index 624a311b76e7..bc4632f03058 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java @@ -5,7 +5,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -513,22 +513,22 @@ public void getSnapshotId() { } /** - * Generates a code sample for using {@link ShareClient#generateSAS(String, ShareSASPermission, OffsetDateTime, - * OffsetDateTime, String, SASProtocol, IPRange, String, String, String, String, String)} + * Generates a code sample for using {@link ShareClient#generateSAS(String, ShareSasPermission, OffsetDateTime, + * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)} */ public void generateSAS() { ShareClient shareClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.ShareClient.generateSAS#String-ShareSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // BEGIN: com.azure.storage.file.ShareClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String String identifier = "identifier"; - ShareSASPermission permissions = new ShareSASPermission() - .setRead(true) - .setCreate(true) - .setDelete(true) - .setWrite(true) - .setList(true); + ShareSasPermission permissions = new ShareSasPermission() + .setReadPermission(true) + .setCreatePermission(true) + .setDeletePermission(true) + .setWritePermission(true) + .setListPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -540,7 +540,7 @@ public void generateSAS() { String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; String sas = shareClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType); - // END: com.azure.storage.file.ShareClient.generateSAS#String-ShareSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange-String-String-String-String-String + // END: com.azure.storage.file.ShareClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String } /** diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy index 7aa871a07eeb..d4001af5d343 100644 --- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy +++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy @@ -393,7 +393,7 @@ class FileAPITests extends APISpec { def destinationOffset = 0 primaryFileClient.upload(ByteBuffer.wrap(data.getBytes()), data.length()) - def sasToken = primaryFileClient.generateSAS(getUTCNow().plusDays(1), new FileSASPermission().setReadPermission(true)) + def sasToken = primaryFileClient.generateSAS(getUTCNow().plusDays(1), new FileSasPermission().setReadPermission(true)) when: FileClient client = fileBuilderHelper(interceptorManager, shareName, "destination") diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy index 6ddbade51c98..08ce4e36e74e 100644 --- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy +++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy @@ -385,7 +385,7 @@ class FileAsyncAPITests extends APISpec { def destinationOffset = 0 primaryFileAsyncClient.upload(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length()).block() - def sasToken = primaryFileAsyncClient.generateSAS(new FileSASPermission().setReadPermission(true), getUTCNow().plusDays(1)) + def sasToken = primaryFileAsyncClient.generateSAS(new FileSasPermission().setReadPermission(true), getUTCNow().plusDays(1)) when: FileAsyncClient client = fileBuilderHelper(interceptorManager, shareName, "destination") diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy index 3cef7154160d..3f4d4aac8cce 100644 --- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy +++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy @@ -4,7 +4,7 @@ import com.azure.storage.common.AccountSASPermission import com.azure.storage.common.AccountSASResourceType import com.azure.storage.common.AccountSASService import com.azure.storage.common.Constants -import com.azure.storage.common.IPRange +import com.azure.storage.common.IpRange import com.azure.storage.common.SASProtocol import com.azure.storage.common.credentials.SASTokenCredential import com.azure.storage.file.models.AccessPolicy @@ -33,7 +33,7 @@ class FileSASTests extends APISpec { @Unroll def "FileSASPermissions toString"() { setup: - def perms = new FileSASPermission() + def perms = new FileSasPermission() .setReadPermission(read) .setWritePermission(write) .setDeletePermission(delete) @@ -54,7 +54,7 @@ class FileSASTests extends APISpec { @Unroll def "FileSASPermissions parse"() { when: - def perms = FileSASPermission.parse(permString) + def perms = FileSasPermission.parse(permString) then: perms.getReadPermission() == read @@ -74,7 +74,7 @@ class FileSASTests extends APISpec { def "FileSASPermissions parse IA"() { when: - FileSASPermission.parse("rwaq") + FileSasPermission.parse("rwaq") then: thrown(IllegalArgumentException) @@ -83,12 +83,12 @@ class FileSASTests extends APISpec { @Unroll def "ShareSASPermissions toString"() { setup: - def perms = new ShareSASPermission() - .setRead(read) - .setWrite(write) - .setDelete(delete) - .setCreate(create) - .setList(list) + def perms = new ShareSasPermission() + .setReadPermission(read) + .setWritePermission(write) + .setDeletePermission(delete) + .setCreatePermission(create) + .setListPermission(list) expect: perms.toString() == expectedString @@ -106,14 +106,14 @@ class FileSASTests extends APISpec { @Unroll def "ShareSASPermissions parse"() { when: - def perms = ShareSASPermission.parse(permString) + def perms = ShareSasPermission.parse(permString) then: - perms.getRead() == read - perms.getWrite() == write - perms.getDelete() == delete - perms.getCreate() == create - perms.getList() == list + perms.getReadPermission() == read + perms.getWritePermission() == write + perms.getDeletePermission() == delete + perms.getCreatePermission() == create + perms.getListPermission() == list where: permString || read | write | delete | create | list @@ -128,7 +128,7 @@ class FileSASTests extends APISpec { def "ShareSASPermissions parse IA"() { when: - ShareSASPermission.parse("rwaq") + ShareSasPermission.parse("rwaq") then: thrown(IllegalArgumentException) @@ -141,7 +141,7 @@ class FileSASTests extends APISpec { def accountName = "account" when: - def serviceSASSignatureValues = primaryFileClient.fileAsyncClient.configureServiceSASSignatureValues(new FileServiceSASSignatureValues(), accountName) + def serviceSASSignatureValues = primaryFileClient.fileAsyncClient.configureServiceSASSignatureValues(new FileServiceSasSignatureValues(), accountName) then: serviceSASSignatureValues.getCanonicalName() == "/file/" + accountName + "/" + shareName + "/" + fileName @@ -153,14 +153,14 @@ class FileSASTests extends APISpec { primaryFileClient.create(Constants.KB) primaryFileClient.upload(ByteBuffer.wrap(data.getBytes()), (long) data.length()) - def permissions = new FileSASPermission() + def permissions = new FileSasPermission() .setReadPermission(true) .setWritePermission(true) .setCreatePermission(true) .setDeletePermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -200,14 +200,14 @@ class FileSASTests extends APISpec { String data = "test" primaryFileClient.create(Constants.KB) - def permissions = new FileSASPermission() + def permissions = new FileSasPermission() .setReadPermission(true) .setWritePermission(false) .setCreatePermission(true) .setDeletePermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -247,12 +247,12 @@ class FileSASTests extends APISpec { primaryShareClient.setAccessPolicy(Arrays.asList(identifier)) // Check containerSASPermissions - ShareSASPermission permissions = new ShareSASPermission() - .setRead(true) - .setWrite(true) - .setCreate(true) - .setDelete(true) - .setList(true) + ShareSasPermission permissions = new ShareSasPermission() + .setReadPermission(true) + .setWritePermission(true) + .setCreatePermission(true) + .setDeletePermission(true) + .setListPermission(true) OffsetDateTime expiryTime = getUTCNow().plusDays(1) diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java index 3b1deaf786bd..570073cd4b09 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java @@ -12,7 +12,7 @@ import com.azure.core.implementation.util.FluxUtil; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -751,12 +751,12 @@ Mono> deleteMessageWithResponse(String messageId, String popRecei /** * Generates a SAS token with the specified parameters * - * @param permissions The {@code QueueSASPermission} permission for the SAS + * @param permissions The {@code QueueSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredential} is null */ - public String generateSAS(QueueSASPermission permissions, OffsetDateTime expiryTime) { + public String generateSAS(QueueSasPermission permissions, OffsetDateTime expiryTime) { return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /* version */, null /* sasProtocol */, null /* ipRange */); } @@ -778,25 +778,25 @@ public String generateSAS(String identifier) { * *

Code Samples

* - * {@codesnippet com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange} + * {@codesnippet com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange} * *

For more information, see the * Azure Docs.

* * @param identifier The {@code String} name of the access policy on the queue this SAS references if any - * @param permissions The {@code QueueSASPermission} permission for the SAS + * @param permissions The {@code QueueSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredential} is null */ - public String generateSAS(String identifier, QueueSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + public String generateSAS(String identifier, QueueSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { - QueueServiceSASSignatureValues queueServiceSASSignatureValues = new QueueServiceSASSignatureValues(version, + QueueServiceSasSignatureValues queueServiceSASSignatureValues = new QueueServiceSasSignatureValues(version, sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange, identifier); @@ -806,7 +806,7 @@ public String generateSAS(String identifier, QueueSASPermission permissions, Off Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential); // Set canonical name - QueueServiceSASSignatureValues values = queueServiceSASSignatureValues + QueueServiceSasSignatureValues values = queueServiceSASSignatureValues .setCanonicalName(this.queueName, sharedKeyCredential.getAccountName()); QueueServiceSasQueryParameters queueServiceSasQueryParameters = values diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java index 690a1a8fc552..dcff77c48649 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java @@ -6,7 +6,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -661,10 +661,10 @@ public Response deleteMessageWithResponse(String messageId, String popRece * Generates a SAS token with the specified parameters * * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS - * @param permissions The {@code QueueSASPermission} permission for the SAS + * @param permissions The {@code QueueSasPermission} permission for the SAS * @return A string that represents the SAS token */ - public String generateSAS(OffsetDateTime expiryTime, QueueSASPermission permissions) { + public String generateSAS(OffsetDateTime expiryTime, QueueSasPermission permissions) { return this.client.generateSAS(permissions, expiryTime); } @@ -683,22 +683,22 @@ public String generateSAS(String identifier) { * *

Code Samples

* - * {@codesnippet com.azure.storage.queue.queueClient.generateSAS#String-QueueSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange} + * {@codesnippet com.azure.storage.queue.queueClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange} * *

For more information, see the * Azure Docs.

* * @param identifier The {@code String} name of the access policy on the queue this SAS references if any - * @param permissions The {@code QueueSASPermission} permission for the SAS + * @param permissions The {@code QueueSasPermission} permission for the SAS * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS * @param startTime An optional {@code OffsetDateTime} start time for the SAS * @param version An optional {@code String} version for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @return A string that represents the SAS token */ - public String generateSAS(String identifier, QueueSASPermission permissions, OffsetDateTime expiryTime, - OffsetDateTime startTime, String version, SASProtocol sasProtocol, IPRange ipRange) { + public String generateSAS(String identifier, QueueSasPermission permissions, OffsetDateTime expiryTime, + OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) { return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueSASPermission.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueSasPermission.java similarity index 82% rename from sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueSASPermission.java rename to sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueSasPermission.java index 14294722e26c..0b6de02664f5 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueSASPermission.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueSasPermission.java @@ -11,10 +11,10 @@ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a queue. Setting * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all * the values are set, this should be serialized with toString and set as the permissions field on a {@link - * QueueServiceSASSignatureValues} object. It is possible to construct the permissions string without this class, but + * QueueServiceSasSignatureValues} object. It is possible to construct the permissions string without this class, but * the order of the permissions is particular and this class guarantees correctness. */ -public final class QueueSASPermission { +public final class QueueSasPermission { private boolean readPermission; @@ -25,21 +25,21 @@ public final class QueueSASPermission { private boolean processPermission; /** - * Initializes a {@code QueueSASPermission} object with all fields set to false. + * Initializes a {@code QueueSasPermission} object with all fields set to false. */ - public QueueSASPermission() { + public QueueSasPermission() { } /** - * Creates a {@code QueueSASPermission} from the specified permissions string. This method will throw an + * Creates a {@code QueueSasPermission} from the specified permissions string. This method will throw an * {@code IllegalArgumentException} if it encounters a character that does not correspond to a valid permission. * - * @param permString A {@code String} which represents the {@code QueueSASPermission}. - * @return A {@code QueueSASPermission} generated from the given {@code String}. + * @param permString A {@code String} which represents the {@code QueueSasPermission}. + * @return A {@code QueueSasPermission} generated from the given {@code String}. * @throws IllegalArgumentException If {@code permString} contains a character other than r, a, u, or p. */ - public static QueueSASPermission parse(String permString) { - QueueSASPermission permissions = new QueueSASPermission(); + public static QueueSasPermission parse(String permString) { + QueueSasPermission permissions = new QueueSasPermission(); for (int i = 0; i < permString.length(); i++) { char c = permString.charAt(i); @@ -76,9 +76,9 @@ public boolean getReadPermission() { * Sets the read permission status. * * @param hadReadPermission Permission status to set - * @return the updated QueueSASPermission object. + * @return the updated QueueSasPermission object. */ - public QueueSASPermission setReadPermission(boolean hadReadPermission) { + public QueueSasPermission setReadPermission(boolean hadReadPermission) { this.readPermission = hadReadPermission; return this; } @@ -94,9 +94,9 @@ public boolean getAddPermission() { * Sets the add permission status. * * @param hasAddPermission Permission status to set - * @return the updated QueueSASPermission object. + * @return the updated QueueSasPermission object. */ - public QueueSASPermission setAddPermission(boolean hasAddPermission) { + public QueueSasPermission setAddPermission(boolean hasAddPermission) { this.addPermission = hasAddPermission; return this; } @@ -112,9 +112,9 @@ public boolean getUpdatePermission() { * Sets the update permission status. * * @param hasUpdatePermission Permission status to set - * @return the updated QueueSASPermission object. + * @return the updated QueueSasPermission object. */ - public QueueSASPermission setUpdatePermission(boolean hasUpdatePermission) { + public QueueSasPermission setUpdatePermission(boolean hasUpdatePermission) { this.updatePermission = hasUpdatePermission; return this; } @@ -130,9 +130,9 @@ public boolean getProcessPermission() { * Sets the process permission status. * * @param hasProcessPermission Permission status to set - * @return the updated QueueSASPermission object. + * @return the updated QueueSasPermission object. */ - public QueueSASPermission setProcessPermission(boolean hasProcessPermission) { + public QueueSasPermission setProcessPermission(boolean hasProcessPermission) { this.processPermission = hasProcessPermission; return this; } @@ -141,7 +141,7 @@ public QueueSASPermission setProcessPermission(boolean hasProcessPermission) { * Converts the given permissions to a {@code String}. Using this method will guarantee the permissions are in an * order accepted by the service. * - * @return A {@code String} which represents the {@code QueueSASPermission}. + * @return A {@code String} which represents the {@code QueueSasPermission}. */ @Override public String toString() { diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java index 927a5a5e19af..0e8c7ff71615 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java @@ -15,7 +15,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.AccountSASSignatureValues; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -447,7 +447,7 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * *

Code Samples

* - * {@codesnippet com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol} + * {@codesnippet com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol} * *

For more information, see the * Azure Docs.

@@ -458,14 +458,14 @@ public String generateAccountSAS(AccountSASService accountSASService, AccountSAS * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token * @throws NullPointerException If {@code sharedKeyCredential} is null */ public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, - AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - IPRange ipRange, SASProtocol sasProtocol) { + AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, + String version, IpRange ipRange, SASProtocol sasProtocol) { SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.client.getHttpPipeline()); Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential); diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java index 10f3d13a8681..81767a397131 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java @@ -10,7 +10,7 @@ import com.azure.storage.common.AccountSASPermission; import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -413,7 +413,7 @@ public String generateAccountSAS(AccountSASService accountSASService, * *

Code Samples

* - * {@codesnippet com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol} + * {@codesnippet com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol} * *

For more information, see the * Azure Docs.

@@ -424,13 +424,13 @@ public String generateAccountSAS(AccountSASService accountSASService, * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS * @param startTime The {@code OffsetDateTime} start time for the account SAS * @param version The {@code String} version for the account SAS - * @param ipRange An optional {@code IPRange} ip address range for the SAS + * @param ipRange An optional {@code IpRange} ip address range for the SAS * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS * @return A string that represents the SAS token */ public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType, - AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, String version, - IPRange ipRange, SASProtocol sasProtocol) { + AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime, + String version, IpRange ipRange, SASProtocol sasProtocol) { return this.client.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol); } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasQueryParameters.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasQueryParameters.java index 84a2d3f61c03..ce3d5de71237 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasQueryParameters.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasQueryParameters.java @@ -5,7 +5,7 @@ import com.azure.storage.common.BaseSasQueryParameters; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import java.time.OffsetDateTime; @@ -13,7 +13,7 @@ /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly - * by the user; it is only generated by the {@link QueueServiceSASSignatureValues} type. Once generated, it can be set + * by the user; it is only generated by the {@link QueueServiceSasSignatureValues} type. Once generated, it can be set * on a {@link QueueClientBuilder} object to be constructed as part of a URL or it can be encoded into a {@code String} * and appended to a URL directly (though caution should be taken here in case there are existing query parameters, * which might affect the appropriate means of appending these query parameters). NOTE: Instances of this class are @@ -46,21 +46,21 @@ public QueueServiceSasQueryParameters(Map queryParamsMap, bool * @param protocol A {@code String} representing the allowed HTTP protocol(s) or {@code null}. * @param startTime A {@code java.util.Date} representing the start time for this SAS token or {@code null}. * @param expiryTime A {@code java.util.Date} representing the expiry time for this SAS token. - * @param ipRange A {@link IPRange} representing the range of valid IP addresses for this SAS token or + * @param ipRange A {@link IpRange} representing the range of valid IP addresses for this SAS token or * {@code null}. * @param identifier A {@code String} representing the signed identifier (only for Service SAS) or {@code null}. * @param permissions A {@code String} representing the storage permissions or {@code null}. * @param signature A {@code String} representing the signature for the SAS token. */ QueueServiceSasQueryParameters(String version, SASProtocol protocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, IPRange ipRange, String identifier, String permissions, String signature) { + OffsetDateTime expiryTime, IpRange ipRange, String identifier, String permissions, String signature) { super(version, protocol, startTime, expiryTime, ipRange, permissions, signature); this.identifier = identifier; } /** - * @return The signed identifier (only for {@link QueueServiceSASSignatureValues}) or {@code null}. Please see + * @return The signed identifier (only for {@link QueueServiceSasSignatureValues}) or {@code null}. Please see * here * for more information. */ diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSASSignatureValues.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java similarity index 82% rename from sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSASSignatureValues.java rename to sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java index 046729de6075..b4e93307c9b2 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSASSignatureValues.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java @@ -4,7 +4,7 @@ package com.azure.storage.queue; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SharedKeyCredential; @@ -12,7 +12,7 @@ import java.time.OffsetDateTime; /** - * QueueServiceSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage service. Once + * QueueServiceSasSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage service. Once * all the values here are set appropriately, call generateSASQueryParameters to obtain a representation of the SAS * which can actually be applied to queue urls. Note: that both this class and {@link QueueServiceSasQueryParameters} * exist because the former is mutable and a logical representation while the latter is immutable and used to generate @@ -28,7 +28,7 @@ * here * for additional samples.

*/ -final class QueueServiceSASSignatureValues { +final class QueueServiceSasSignatureValues { private String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; @@ -40,7 +40,7 @@ final class QueueServiceSASSignatureValues { private String permissions; - private IPRange ipRange; + private IpRange ipRange; private String canonicalName; @@ -49,7 +49,7 @@ final class QueueServiceSASSignatureValues { /** * Creates an object with empty values for all fields. */ - QueueServiceSASSignatureValues() { + QueueServiceSasSignatureValues() { } /** @@ -58,7 +58,7 @@ final class QueueServiceSASSignatureValues { * @param expiryTime Time the SAS becomes valid * @param permissions Permissions granted by the SAS */ - QueueServiceSASSignatureValues(OffsetDateTime expiryTime, String permissions) { + QueueServiceSasSignatureValues(OffsetDateTime expiryTime, String permissions) { this.expiryTime = expiryTime; this.permissions = permissions; } @@ -68,12 +68,12 @@ final class QueueServiceSASSignatureValues { * * @param identifier Identifier for the SAS */ - QueueServiceSASSignatureValues(String identifier) { + QueueServiceSasSignatureValues(String identifier) { this.identifier = identifier; } - QueueServiceSASSignatureValues(String version, SASProtocol sasProtocol, OffsetDateTime startTime, - OffsetDateTime expiryTime, String permission, IPRange ipRange, String identifier) { + QueueServiceSasSignatureValues(String version, SASProtocol sasProtocol, OffsetDateTime startTime, + OffsetDateTime expiryTime, String permission, IpRange ipRange, String identifier) { if (version != null) { this.version = version; } @@ -98,9 +98,9 @@ public String getVersion() { * by the library. * * @param version Version to target - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setVersion(String version) { + public QueueServiceSasSignatureValues setVersion(String version) { this.version = version; return this; } @@ -116,9 +116,9 @@ public SASProtocol getProtocol() { * Sets the {@link SASProtocol} which determines the protocols allowed by the SAS. * * @param protocol Protocol for the SAS - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setProtocol(SASProtocol protocol) { + public QueueServiceSasSignatureValues setProtocol(SASProtocol protocol) { this.protocol = protocol; return this; } @@ -134,9 +134,9 @@ public OffsetDateTime getStartTime() { * Sets when the SAS will take effect. * * @param startTime When the SAS takes effect - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setStartTime(OffsetDateTime startTime) { + public QueueServiceSasSignatureValues setStartTime(OffsetDateTime startTime) { this.startTime = startTime; return this; } @@ -152,15 +152,15 @@ public OffsetDateTime getExpiryTime() { * Sets the time after which the SAS will no longer work. * * @param expiryTime When the SAS will no longer work - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setExpiryTime(OffsetDateTime expiryTime) { + public QueueServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime) { this.expiryTime = expiryTime; return this; } /** - * @return the permissions string allowed by the SAS. Please refer to {@link QueueSASPermission} for help + * @return the permissions string allowed by the SAS. Please refer to {@link QueueSasPermission} for help * determining the permissions allowed. */ public String getPermissions() { @@ -168,31 +168,31 @@ public String getPermissions() { } /** - * Sets the permissions string allowed by the SAS. Please refer to {@link QueueSASPermission} for help constructing + * Sets the permissions string allowed by the SAS. Please refer to {@link QueueSasPermission} for help constructing * the permissions string. * * @param permissions Permissions string for the SAS - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setPermissions(String permissions) { + public QueueServiceSasSignatureValues setPermissions(String permissions) { this.permissions = permissions; return this; } /** - * @return the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * @return the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. */ - public IPRange getIpRange() { + public IpRange getIpRange() { return ipRange; } /** - * Sets the {@link IPRange} which determines the IP ranges that are allowed to use the SAS. + * Sets the {@link IpRange} which determines the IP ranges that are allowed to use the SAS. * * @param ipRange Allowed IP range to set - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setIpRange(IPRange ipRange) { + public QueueServiceSasSignatureValues setIpRange(IpRange ipRange) { this.ipRange = ipRange; return this; } @@ -208,9 +208,9 @@ public String getCanonicalName() { * Sets the canonical name of the object the SAS user may access. * * @param canonicalName Canonical name of the object the SAS grants access - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setCanonicalName(String canonicalName) { + public QueueServiceSasSignatureValues setCanonicalName(String canonicalName) { this.canonicalName = canonicalName; return this; } @@ -221,9 +221,9 @@ public QueueServiceSASSignatureValues setCanonicalName(String canonicalName) { * * @param queueName Name of the queue object * @param accountName Name of the account that contains the object - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setCanonicalName(String queueName, String accountName) { + public QueueServiceSasSignatureValues setCanonicalName(String queueName, String accountName) { this.canonicalName = String.format("/queue/%s/%s", accountName, queueName); return this; } @@ -233,7 +233,7 @@ public QueueServiceSASSignatureValues setCanonicalName(String queueName, String * here * for more information. */ - public String getIdentifier() { + public String getId() { return identifier; } @@ -243,9 +243,9 @@ public String getIdentifier() { * for more information. * * @param identifier Name of the access policy - * @return the updated QueueServiceSASSignatureValues object + * @return the updated QueueServiceSasSignatureValues object */ - public QueueServiceSASSignatureValues setIdentifier(String identifier) { + public QueueServiceSasSignatureValues setIdentifier(String identifier) { this.identifier = identifier; return this; } diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java index 7809e1b3a466..7e8e8780fe5a 100644 --- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java @@ -3,7 +3,7 @@ package com.azure.storage.queue; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -486,19 +486,19 @@ public void clearMessagesAsync() { } /** - * Code snippet for {@link QueueAsyncClient#generateSAS(String, QueueSASPermission, OffsetDateTime, OffsetDateTime, - * String, SASProtocol, IPRange)} + * Code snippet for {@link QueueAsyncClient#generateSAS(String, QueueSasPermission, OffsetDateTime, OffsetDateTime, + * String, SASProtocol, IpRange)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange - QueueSASPermission permissions = new QueueSASPermission() + // BEGIN: com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange + QueueSasPermission permissions = new QueueSasPermission() .setReadPermission(true) .setAddPermission(true) .setUpdatePermission(true) .setProcessPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -507,7 +507,7 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); - // END: com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange + // END: com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange } /** diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java index f6f764033932..fb4771af3332 100644 --- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java @@ -4,7 +4,7 @@ import com.azure.core.http.rest.Response; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.core.util.Context; import com.azure.storage.common.Utility; @@ -444,19 +444,19 @@ public void clearMessagesWithResponse() { } /** - * Code snippet for {@link QueueClient#generateSAS(String, QueueSASPermission, OffsetDateTime, OffsetDateTime, - * String, SASProtocol, IPRange)} + * Code snippet for {@link QueueClient#generateSAS(String, QueueSasPermission, OffsetDateTime, OffsetDateTime, + * String, SASProtocol, IpRange)} */ public void generateSASCodeSnippets() { - // BEGIN: com.azure.storage.queue.queueClient.generateSAS#String-QueueSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange - QueueSASPermission permissions = new QueueSASPermission() + // BEGIN: com.azure.storage.queue.queueClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange + QueueSasPermission permissions = new QueueSasPermission() .setReadPermission(true) .setAddPermission(true) .setUpdatePermission(true) .setProcessPermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -465,7 +465,7 @@ public void generateSASCodeSnippets() { // Note either "identifier", or "expiryTime and permissions" are required to be set String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange); - // END: com.azure.storage.queue.queueClient.generateSAS#String-QueueSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IPRange + // END: com.azure.storage.queue.queueClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange } /** diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java index 2d99194a3280..c021209d7703 100644 --- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java @@ -6,7 +6,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.storage.common.credentials.SASTokenCredential; @@ -272,10 +272,10 @@ public void getStatisticsWithResponse() { /** * Generates a code sample for using {@link QueueServiceAsyncClient#generateAccountSAS(AccountSASService, - * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IPRange, SASProtocol)} + * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)} */ public void generateAccountSAS() { - // BEGIN: com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // BEGIN: com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol AccountSASService service = new AccountSASService() .setBlob(true) .setFile(true) @@ -296,7 +296,7 @@ public void generateAccountSAS() { .setUpdatePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -304,6 +304,6 @@ public void generateAccountSAS() { String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version, ipRange, sasProtocol); - // END: com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // END: com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol } } diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java index 4001740dd29c..bc818ee23cc6 100644 --- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java @@ -7,7 +7,7 @@ import com.azure.storage.common.AccountSASResourceType; import com.azure.storage.common.AccountSASService; import com.azure.storage.common.Constants; -import com.azure.storage.common.IPRange; +import com.azure.storage.common.IpRange; import com.azure.storage.common.SASProtocol; import com.azure.storage.common.Utility; import com.azure.core.util.Context; @@ -262,10 +262,10 @@ public void getStatisticsWithResponse() { /** * Generates a code sample for using {@link QueueServiceClient#generateAccountSAS(AccountSASService, - * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IPRange, SASProtocol)} + * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)} */ public void generateAccountSAS() { - // BEGIN: com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // BEGIN: com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol AccountSASService service = new AccountSASService() .setBlob(true) .setFile(true) @@ -286,7 +286,7 @@ public void generateAccountSAS() { .setUpdatePermission(true); OffsetDateTime startTime = OffsetDateTime.now().minusDays(1); OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); - IPRange ipRange = new IPRange() + IpRange ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255"); SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP; @@ -294,6 +294,6 @@ public void generateAccountSAS() { String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version, ipRange, sasProtocol); - // END: com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IPRange-SASProtocol + // END: com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol } } diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy index cfc1d9b558f9..e68121a72111 100644 --- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy +++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy @@ -3,7 +3,7 @@ package com.azure.storage.queue import com.azure.storage.common.AccountSASPermission import com.azure.storage.common.AccountSASResourceType import com.azure.storage.common.AccountSASService -import com.azure.storage.common.IPRange +import com.azure.storage.common.IpRange import com.azure.storage.common.SASProtocol import com.azure.storage.common.credentials.SASTokenCredential import com.azure.storage.queue.models.AccessPolicy @@ -28,7 +28,7 @@ class QueueSASTests extends APISpec { @Unroll def "QueueSASPermission parse"() { when: - def perms = QueueSASPermission.parse(permString) + def perms = QueueSasPermission.parse(permString) then: perms.getReadPermission() == read @@ -51,7 +51,7 @@ class QueueSASTests extends APISpec { @Unroll def "QueueSASPermission toString"() { setup: - def perms = new QueueSASPermission() + def perms = new QueueSasPermission() .setReadPermission(read) .setAddPermission(add) .setUpdatePermission(update) @@ -72,7 +72,7 @@ class QueueSASTests extends APISpec { def "QueueSASPermission parse IA"() { when: - QueueSASPermission.parse("rwaq") + QueueSasPermission.parse("rwaq") then: thrown(IllegalArgumentException) @@ -84,7 +84,7 @@ class QueueSASTests extends APISpec { def accountName = "account" when: - def serviceSASSignatureValues = new QueueServiceSASSignatureValues().setCanonicalName(queueName, accountName) + def serviceSASSignatureValues = new QueueServiceSasSignatureValues().setCanonicalName(queueName, accountName) then: serviceSASSignatureValues.getCanonicalName() == "/queue/" + accountName + "/" + queueName @@ -96,13 +96,13 @@ class QueueSASTests extends APISpec { queueClient.create() EnqueuedMessage resp = queueClient.enqueueMessage("test") - def permissions = new QueueSASPermission() + def permissions = new QueueSasPermission() .setReadPermission(true) .setAddPermission(true) .setProcessPermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -136,14 +136,14 @@ class QueueSASTests extends APISpec { queueClient.create() EnqueuedMessage resp = queueClient.enqueueMessage("test") - def permissions = new QueueSASPermission() + def permissions = new QueueSasPermission() .setReadPermission(true) .setAddPermission(true) .setProcessPermission(true) .setUpdatePermission(true) def startTime = getUTCNow().minusDays(1) def expiryTime = getUTCNow().plusDays(1) - def ipRange = new IPRange() + def ipRange = new IpRange() .setIpMin("0.0.0.0") .setIpMax("255.255.255.255") def sasProtocol = SASProtocol.HTTPS_HTTP @@ -177,7 +177,7 @@ class QueueSASTests extends APISpec { queueClient.create() queueClient.enqueueMessage("test") - def permissions = new QueueSASPermission() + def permissions = new QueueSasPermission() .setReadPermission(true) .setAddPermission(true) .setUpdatePermission(true) From bd7e1f8c8f5c395851ccd44f5683c22a8629544f Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 3 Oct 2019 14:25:56 -0700 Subject: [PATCH 2/3] Addrssed feedback --- .../storage/file/DirectoryAsyncClient.java | 6 ++-- .../azure/storage/file/FileAsyncClient.java | 32 +++++++++---------- .../com/azure/storage/file/FileClient.java | 14 ++++---- .../azure/storage/file/FileClientBuilder.java | 8 ++--- .../file/FileServiceClientBuilder.java | 6 ++-- .../azure/storage/file/ShareAsyncClient.java | 6 ++-- .../storage/file/ShareClientBuilder.java | 8 ++--- .../file/FileAsyncJavaDocCodeSamples.java | 16 +++++----- .../storage/file/FileJavaDocCodeSamples.java | 16 +++++----- .../azure/storage/file/FileAPITests.groovy | 2 +- .../storage/file/FileAsyncAPITests.groovy | 2 +- 11 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java index a85088aaaf38..75b24c890530 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/DirectoryAsyncClient.java @@ -98,12 +98,12 @@ public class DirectoryAsyncClient { * @return the URL of the storage directory client */ public String getDirectoryUrl() { - StringBuilder directoryURLString = new StringBuilder(azureFileStorageClient.getUrl()).append("/") + StringBuilder directoryUrlString = new StringBuilder(azureFileStorageClient.getUrl()).append("/") .append(shareName).append("/").append(directoryPath); if (snapshot != null) { - directoryURLString.append("?snapshot=").append(snapshot); + directoryUrlString.append("?snapshot=").append(snapshot); } - return directoryURLString.toString(); + return directoryUrlString.toString(); } /** diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java index 9f1432ee8bb1..9eb9b6acb3cf 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java @@ -125,12 +125,12 @@ public class FileAsyncClient { * @return the URL of the storage file client */ public String getFileUrl() { - StringBuilder fileURLString = new StringBuilder(azureFileStorageClient.getUrl()).append("/") + StringBuilder fileUrlstring = new StringBuilder(azureFileStorageClient.getUrl()).append("/") .append(shareName).append("/").append(filePath); if (snapshot != null) { - fileURLString.append("?snapshot=").append(snapshot); + fileUrlstring.append("?snapshot=").append(snapshot); } - return fileURLString.toString(); + return fileUrlstring.toString(); } /** @@ -796,7 +796,7 @@ Mono> uploadWithResponse(Flux data, long le * *

Upload a number of bytes from a file at defined source and destination offsets

* - * {@codesnippet com.azure.storage.file.fileAsyncClient.uploadRangeFromURL#long-long-long-uri} + * {@codesnippet com.azure.storage.file.fileAsyncClient.uploadRangeFromUrl#long-long-long-uri} * *

For more information, see the * Azure Docs.

@@ -808,9 +808,9 @@ Mono> uploadWithResponse(Flux data, long le * @return The {@link FileUploadRangeFromUrlInfo file upload range from url info} */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public Mono uploadRangeFromURL(long length, long destinationOffset, long sourceOffset, + public Mono uploadRangeFromUrl(long length, long destinationOffset, long sourceOffset, URI sourceURI) { - return uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI) + return uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, sourceURI) .flatMap(FluxUtil::toMono); } @@ -821,7 +821,7 @@ public Mono uploadRangeFromURL(long length, long des * *

Upload a number of bytes from a file at defined source and destination offsets

* - * {@codesnippet com.azure.storage.file.fileAsyncClient.uploadRangeFromURLWithResponse#long-long-long-uri} + * {@codesnippet com.azure.storage.file.fileAsyncClient.uploadRangeFromUrlWithResponse#long-long-long-uri} * *

For more information, see the * Azure Docs.

@@ -834,21 +834,21 @@ public Mono uploadRangeFromURL(long length, long des * and response status code. */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public Mono> uploadRangeFromURLWithResponse(long length, - long destinationOffset, long sourceOffset, URI sourceURI) { + public Mono> uploadRangeFromUrlWithResponse(long length, + long destinationOffset, long sourceOffset, URI sourceURI) { return withContext(context -> - uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI, context)); + uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, sourceURI, context)); } - Mono> uploadRangeFromURLWithResponse(long length, long destinationOffset, - long sourceOffset, URI sourceURI, Context context) { + Mono> uploadRangeFromUrlWithResponse(long length, long destinationOffset, + long sourceOffset, URI sourceURI, Context context) { FileRange destinationRange = new FileRange(destinationOffset, destinationOffset + length - 1); FileRange sourceRange = new FileRange(sourceOffset, sourceOffset + length - 1); return postProcessResponse(azureFileStorageClient.files() .uploadRangeFromURLWithRestResponseAsync(shareName, filePath, destinationRange.toString(), sourceURI.toString(), 0, null, sourceRange.toString(), null, null, context)) - .map(this::uploadRangeFromURLResponse); + .map(this::uploadRangeFromUrlResponse); } /** @@ -1322,15 +1322,15 @@ private Response uploadResponse(final FilesUploadRangeResponse r return new SimpleResponse<>(response, fileUploadInfo); } - private Response uploadRangeFromURLResponse( + private Response uploadRangeFromUrlResponse( final FilesUploadRangeFromURLResponse response) { FileUploadRangeFromURLHeaders headers = response.getDeserializedHeaders(); String eTag = headers.getETag(); OffsetDateTime lastModified = headers.getLastModified(); Boolean isServerEncrypted = headers.isServerEncrypted(); - FileUploadRangeFromUrlInfo fileUploadRangeFromURLInfo = + FileUploadRangeFromUrlInfo fileUploadRangeFromUrlInfo = new FileUploadRangeFromUrlInfo(eTag, lastModified, isServerEncrypted); - return new SimpleResponse<>(response, fileUploadRangeFromURLInfo); + return new SimpleResponse<>(response, fileUploadRangeFromUrlInfo); } private Response setMetadataResponse(final FilesSetMetadataResponse response) { diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java index 87a4fe3fee19..1126ffc8a86d 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java @@ -618,7 +618,7 @@ public Response uploadWithResponse(ByteBuffer data, long length, * *

Upload a number of bytes from a file at defined source and destination offsets

* - * {@codesnippet com.azure.storage.file.fileClient.uploadRangeFromURL#long-long-long-uri} + * {@codesnippet com.azure.storage.file.fileClient.uploadRangeFromUrl#long-long-long-uri} * *

For more information, see the * Azure Docs.

@@ -630,9 +630,9 @@ public Response uploadWithResponse(ByteBuffer data, long length, * @return The {@link FileUploadRangeFromUrlInfo file upload range from url info} */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public FileUploadRangeFromUrlInfo uploadRangeFromURL(long length, long destinationOffset, long sourceOffset, + public FileUploadRangeFromUrlInfo uploadRangeFromUrl(long length, long destinationOffset, long sourceOffset, URI sourceURI) { - return uploadRangeFromURLWithResponse(length, destinationOffset, sourceOffset, sourceURI, null, Context.NONE) + return uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, sourceURI, null, Context.NONE) .getValue(); } @@ -643,7 +643,7 @@ public FileUploadRangeFromUrlInfo uploadRangeFromURL(long length, long destinati * *

Upload a number of bytes from a file at defined source and destination offsets

* - * {@codesnippet com.azure.storage.file.fileClient.uploadRangeFromURLWithResponse#long-long-long-uri-duration-context} + * {@codesnippet com.azure.storage.file.fileClient.uploadRangeFromUrlWithResponse#long-long-long-uri-duration-context} * *

For more information, see the * Azure Docs.

@@ -660,9 +660,9 @@ public FileUploadRangeFromUrlInfo uploadRangeFromURL(long length, long destinati * @throws RuntimeException if the operation doesn't complete before the timeout concludes. */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API - public Response uploadRangeFromURLWithResponse(long length, long destinationOffset, - long sourceOffset, URI sourceURI, Duration timeout, Context context) { - Mono> response = fileAsyncClient.uploadRangeFromURLWithResponse(length, + public Response uploadRangeFromUrlWithResponse(long length, long destinationOffset, + long sourceOffset, URI sourceURI, Duration timeout, Context context) { + Mono> response = fileAsyncClient.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, sourceURI, context); return Utility.blockWithOptionalTimeout(response, timeout); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClientBuilder.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClientBuilder.java index 82a7e55c612c..66bb69613ee9 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClientBuilder.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClientBuilder.java @@ -194,11 +194,11 @@ public FileClient buildFileClient() { @Override public FileClientBuilder endpoint(String endpoint) { try { - URL fullURL = new URL(endpoint); - super.endpoint = fullURL.getProtocol() + "://" + fullURL.getHost(); + URL fullUrl = new URL(endpoint); + super.endpoint = fullUrl.getProtocol() + "://" + fullUrl.getHost(); // Attempt to get the share name and file path from the URL passed - String[] pathSegments = fullURL.getPath().split("/"); + String[] pathSegments = fullUrl.getPath().split("/"); int length = pathSegments.length; this.shareName = length >= 2 ? pathSegments[1] : this.shareName; String[] filePathParams = length >= 3 ? Arrays.copyOfRange(pathSegments, 2, length) : null; @@ -206,7 +206,7 @@ public FileClientBuilder endpoint(String endpoint) { // Attempt to get the SAS token from the URL passed SASTokenCredential sasTokenCredential = SASTokenCredential - .fromQueryParameters(Utility.parseQueryString(fullURL.getQuery())); + .fromQueryParameters(Utility.parseQueryString(fullUrl.getQuery())); if (sasTokenCredential != null) { super.credential(sasTokenCredential); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClientBuilder.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClientBuilder.java index 744e0b82a88d..06d89d7bd5b7 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClientBuilder.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClientBuilder.java @@ -135,12 +135,12 @@ public FileServiceClient buildClient() { @Override public FileServiceClientBuilder endpoint(String endpoint) { try { - URL fullURL = new URL(endpoint); - super.endpoint = fullURL.getProtocol() + "://" + fullURL.getHost(); + URL fullUrl = new URL(endpoint); + super.endpoint = fullUrl.getProtocol() + "://" + fullUrl.getHost(); // Attempt to get the SAS token from the URL passed SASTokenCredential sasTokenCredential = SASTokenCredential - .fromQueryParameters(Utility.parseQueryString(fullURL.getQuery())); + .fromQueryParameters(Utility.parseQueryString(fullUrl.getQuery())); if (sasTokenCredential != null) { super.credential(sasTokenCredential); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java index ad6417f433af..ddaef6a2dda3 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java @@ -93,11 +93,11 @@ public class ShareAsyncClient { * @return the url of the Storage Share. */ public String getShareUrl() { - StringBuilder shareURLString = new StringBuilder(azureFileStorageClient.getUrl()).append("/").append(shareName); + StringBuilder shareUrlString = new StringBuilder(azureFileStorageClient.getUrl()).append("/").append(shareName); if (snapshot != null) { - shareURLString.append("?snapshot=").append(snapshot); + shareUrlString.append("?snapshot=").append(snapshot); } - return shareURLString.toString(); + return shareUrlString.toString(); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClientBuilder.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClientBuilder.java index d4ac755b2412..cf389f34e5b1 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClientBuilder.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClientBuilder.java @@ -145,11 +145,11 @@ public ShareClient buildClient() { @Override public ShareClientBuilder endpoint(String endpoint) { try { - URL fullURL = new URL(endpoint); - super.endpoint = fullURL.getProtocol() + "://" + fullURL.getHost(); + URL fullUrl = new URL(endpoint); + super.endpoint = fullUrl.getProtocol() + "://" + fullUrl.getHost(); // Attempt to get the share name from the URL passed - String[] pathSegments = fullURL.getPath().split("/"); + String[] pathSegments = fullUrl.getPath().split("/"); int length = pathSegments.length; if (length > 3) { throw logger.logExceptionAsError(new IllegalArgumentException( @@ -159,7 +159,7 @@ public ShareClientBuilder endpoint(String endpoint) { // Attempt to get the SAS token from the URL passed SASTokenCredential sasTokenCredential = SASTokenCredential - .fromQueryParameters(Utility.parseQueryString(fullURL.getQuery())); + .fromQueryParameters(Utility.parseQueryString(fullUrl.getQuery())); if (sasTokenCredential != null) { super.credential(sasTokenCredential); } diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java index 602321d9d30d..4d757d91d651 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java @@ -299,33 +299,33 @@ public void uploadFileAsync() { } /** - * Generates a code sample for using {@link FileAsyncClient#uploadRangeFromURL(long, long, long, URI)} + * Generates a code sample for using {@link FileAsyncClient#uploadRangeFromUrl(long, long, long, URI)} * @throws URISyntaxException when the URI is invalid */ public void uploadFileFromURLAsync() throws URISyntaxException { FileAsyncClient fileAsyncClient = createAsyncClientWithSASToken(); - // BEGIN: com.azure.storage.file.fileAsyncClient.uploadRangeFromURL#long-long-long-uri - fileAsyncClient.uploadRangeFromURL(6, 8, 0, new URI("filewithSAStoken")).subscribe( + // BEGIN: com.azure.storage.file.fileAsyncClient.uploadRangeFromUrl#long-long-long-uri + fileAsyncClient.uploadRangeFromUrl(6, 8, 0, new URI("filewithSAStoken")).subscribe( response -> { }, error -> System.err.print(error.toString()), () -> System.out.println("Completed upload range from url!") ); - // END: com.azure.storage.file.fileAsyncClient.uploadRangeFromURL#long-long-long-uri + // END: com.azure.storage.file.fileAsyncClient.uploadRangeFromUrl#long-long-long-uri } /** - * Generates a code sample for using {@link FileAsyncClient#uploadRangeFromURLWithResponse(long, long, long, URI)} + * Generates a code sample for using {@link FileAsyncClient#uploadRangeFromUrlWithResponse(long, long, long, URI)} * @throws URISyntaxException when the URI is invalid */ public void uploadFileFromURLWithResponseAsync() throws URISyntaxException { FileAsyncClient fileAsyncClient = createAsyncClientWithSASToken(); - // BEGIN: com.azure.storage.file.fileAsyncClient.uploadRangeFromURLWithResponse#long-long-long-uri - fileAsyncClient.uploadRangeFromURLWithResponse(6, 8, 0, new URI("filewithSAStoken")).subscribe( + // BEGIN: com.azure.storage.file.fileAsyncClient.uploadRangeFromUrlWithResponse#long-long-long-uri + fileAsyncClient.uploadRangeFromUrlWithResponse(6, 8, 0, new URI("filewithSAStoken")).subscribe( response -> { }, error -> System.err.print(error.toString()), () -> System.out.println("Completed upload range from url!") ); - // END: com.azure.storage.file.fileAsyncClient.uploadRangeFromURLWithResponse#long-long-long-uri + // END: com.azure.storage.file.fileAsyncClient.uploadRangeFromUrlWithResponse#long-long-long-uri } /** diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java index e8c5d8e78f5c..9250d5d01a9d 100644 --- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java @@ -342,28 +342,28 @@ public void downloadFileMaxOverload() { } /** - * Generates a code sample for using {@link FileClient#uploadRangeFromURL(long, long, long, URI)} + * Generates a code sample for using {@link FileClient#uploadRangeFromUrl(long, long, long, URI)} * @throws URISyntaxException when the URI is invalid */ public void uploadFileFromURLAsync() throws URISyntaxException { FileClient fileClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.fileClient.uploadRangeFromURL#long-long-long-uri - FileUploadRangeFromUrlInfo response = fileClient.uploadRangeFromURL(6, 8, 0, new URI("filewithSAStoken")); + // BEGIN: com.azure.storage.file.fileClient.uploadRangeFromUrl#long-long-long-uri + FileUploadRangeFromUrlInfo response = fileClient.uploadRangeFromUrl(6, 8, 0, new URI("filewithSAStoken")); System.out.println("Completed upload range from url!"); - // END: com.azure.storage.file.fileClient.uploadRangeFromURL#long-long-long-uri + // END: com.azure.storage.file.fileClient.uploadRangeFromUrl#long-long-long-uri } /** - * Generates a code sample for using {@link FileClient#uploadRangeFromURLWithResponse(long, long, long, URI, Duration, Context)} + * Generates a code sample for using {@link FileClient#uploadRangeFromUrlWithResponse(long, long, long, URI, Duration, Context)} * @throws URISyntaxException when the URI is invalid */ public void uploadFileFromURLWithResponseAsync() throws URISyntaxException { FileClient fileClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.fileClient.uploadRangeFromURLWithResponse#long-long-long-uri-duration-context - Response response = fileClient.uploadRangeFromURLWithResponse(6, + // BEGIN: com.azure.storage.file.fileClient.uploadRangeFromUrlWithResponse#long-long-long-uri-duration-context + Response response = fileClient.uploadRangeFromUrlWithResponse(6, 8, 0, new URI("filewithSAStoken"), Duration.ofSeconds(1), Context.NONE); System.out.println("Completed upload range from url!"); - // END: com.azure.storage.file.fileClient.uploadRangeFromURLWithResponse#long-long-long-uri-duration-context + // END: com.azure.storage.file.fileClient.uploadRangeFromUrlWithResponse#long-long-long-uri-duration-context } /** diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy index d4001af5d343..d32dcbbc78d6 100644 --- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy +++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy @@ -401,7 +401,7 @@ class FileAPITests extends APISpec { .buildFileClient() client.create(1024) - client.uploadRangeFromURL(length, destinationOffset, sourceOffset, (primaryFileClient.getFileUrl() +"?" + sasToken).toURI()) + client.uploadRangeFromUrl(length, destinationOffset, sourceOffset, (primaryFileClient.getFileUrl() +"?" + sasToken).toURI()) then: def result = new String(client.downloadWithProperties().getBody().blockLast().array()) diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy index 08ce4e36e74e..4201c3e21914 100644 --- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy +++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy @@ -393,7 +393,7 @@ class FileAsyncAPITests extends APISpec { .buildFileAsyncClient() client.create(1024).block() - client.uploadRangeFromURL(length, destinationOffset, sourceOffset, (primaryFileAsyncClient.getFileUrl().toString() +"?" + sasToken).toURI()).block() + client.uploadRangeFromUrl(length, destinationOffset, sourceOffset, (primaryFileAsyncClient.getFileUrl().toString() +"?" + sasToken).toURI()).block() then: def result = new String(client.downloadWithProperties().block().getBody().blockLast().array()) From b242372081ed767c2a2e977c50dd05a7fa3d365d Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Thu, 3 Oct 2019 14:41:46 -0700 Subject: [PATCH 3/3] Fix linting --- .../src/main/java/com/azure/storage/file/FileAsyncClient.java | 4 ++-- .../src/main/java/com/azure/storage/file/FileClient.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java index 9eb9b6acb3cf..bff2f488bde1 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java @@ -835,13 +835,13 @@ public Mono uploadRangeFromUrl(long length, long des */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API public Mono> uploadRangeFromUrlWithResponse(long length, - long destinationOffset, long sourceOffset, URI sourceURI) { + long destinationOffset, long sourceOffset, URI sourceURI) { return withContext(context -> uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, sourceURI, context)); } Mono> uploadRangeFromUrlWithResponse(long length, long destinationOffset, - long sourceOffset, URI sourceURI, Context context) { + long sourceOffset, URI sourceURI, Context context) { FileRange destinationRange = new FileRange(destinationOffset, destinationOffset + length - 1); FileRange sourceRange = new FileRange(sourceOffset, sourceOffset + length - 1); diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java index 1126ffc8a86d..59ad4102ee4d 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java @@ -661,7 +661,7 @@ public FileUploadRangeFromUrlInfo uploadRangeFromUrl(long length, long destinati */ // TODO: (gapra) Fix put range from URL link. Service docs have not been updated to show this API public Response uploadRangeFromUrlWithResponse(long length, long destinationOffset, - long sourceOffset, URI sourceURI, Duration timeout, Context context) { + long sourceOffset, URI sourceURI, Duration timeout, Context context) { Mono> response = fileAsyncClient.uploadRangeFromUrlWithResponse(length, destinationOffset, sourceOffset, sourceURI, context); return Utility.blockWithOptionalTimeout(response, timeout);