Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
<Or>
<Package name="com.microsoft.azure.storage.blob"/>
<Package name="com.azure.storage.file.models"/>
<Class name="com.azure.storage.blob.HTTPGetterInfo"/>
<Class name="com.azure.storage.blob.HttpGetterInfo"/>
<Class name="com.azure.storage.blob.BlobProperties"/>
<Class name="com.azure.storage.blob.BlobContainerProperties"/>
<Class name="com.azure.storage.file.implementation.models.DirectoryCreateHeaders"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.azure.messaging.eventhubs.models.PartitionOwnership;
import com.azure.storage.blob.BlobContainerAsyncClient;
import com.azure.storage.blob.BlobContainerClientBuilder;
import com.azure.storage.common.credentials.SASTokenCredential;
import com.azure.storage.common.credentials.SasTokenCredential;
import java.util.StringJoiner;

/**
Expand All @@ -24,7 +24,7 @@ public class BlobPartitionManagerSample {
* @throws Exception If there are any errors while running the sample.
*/
public static void main(String[] args) throws Exception {
SASTokenCredential sasTokenCredential = SASTokenCredential.fromSASTokenString("");
SasTokenCredential sasTokenCredential = SasTokenCredential.fromSasTokenString("");
BlobContainerAsyncClient blobContainerAsyncClient = new BlobContainerClientBuilder()
.connectionString("")
.containerName("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.azure.messaging.eventhubs.models.PartitionContext;
import com.azure.storage.blob.BlobContainerAsyncClient;
import com.azure.storage.blob.BlobContainerClientBuilder;
import com.azure.storage.common.credentials.SASTokenCredential;
import com.azure.storage.common.credentials.SasTokenCredential;
import java.util.concurrent.TimeUnit;
import reactor.core.publisher.Mono;

Expand Down Expand Up @@ -51,7 +51,7 @@ public static void main(String[] args) throws Exception {
.connectionString(EH_CONNECTION_STRING)
.buildAsyncClient();

SASTokenCredential sasTokenCredential = SASTokenCredential.fromSASTokenString(SAS_TOKEN_STRING);
SasTokenCredential sasTokenCredential = SasTokenCredential.fromSasTokenString(SAS_TOKEN_STRING);
BlobContainerAsyncClient blobContainerAsyncClient = new BlobContainerClientBuilder()
.connectionString(STORAGE_CONNECTION_STRING)
.containerName("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.azure.core.http.HttpPipeline;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;
import com.azure.storage.common.credentials.SASTokenCredential;
import com.azure.storage.common.credentials.SasTokenCredential;

import java.io.OutputStream;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -104,15 +104,15 @@ public BlobAsyncClient buildAsyncClient() {
public BlobClientBuilder endpoint(String endpoint) {
try {
URL url = new URL(endpoint);
BlobURLParts parts = BlobURLParts.parse(url);
BlobUrlParts parts = BlobUrlParts.parse(url);

this.endpoint = parts.getScheme() + "://" + parts.getHost();
this.containerName = parts.getBlobContainerName();
this.blobName = parts.getBlobName();
this.snapshot = parts.getSnapshot();

SASTokenCredential sasTokenCredential =
SASTokenCredential.fromSASTokenString(parts.getSasQueryParameters().encode());
SasTokenCredential sasTokenCredential =
SasTokenCredential.fromSasTokenString(parts.getSasQueryParameters().encode());
if (sasTokenCredential != null) {
super.credential(sasTokenCredential);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import com.azure.storage.blob.specialized.BlobServiceSasSignatureValues;
import com.azure.storage.common.Constants;
import com.azure.storage.common.IpRange;
import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.SasProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -151,7 +151,7 @@ public String getBlobContainerUrl() {
* @return The name of container.
*/
public String getBlobContainerName() {
return BlobURLParts.parse(this.azureBlobStorage.getUrl(), logger).getBlobContainerName();
return BlobUrlParts.parse(this.azureBlobStorage.getUrl(), logger).getBlobContainerName();
}

/**
Expand Down Expand Up @@ -801,9 +801,9 @@ private boolean validateNoEtag(ModifiedAccessConditions modifiedAccessConditions
* @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
* @return A string that represents the SAS token
*/
public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
public String generateUserDelegationSas(UserDelegationKey userDelegationKey, String accountName,
BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, null, null,
return this.generateUserDelegationSas(userDelegationKey, accountName, permissions, expiryTime, null, null,
null, null, null, null, null, null, null);
}

Expand All @@ -816,14 +816,14 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str
* @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 sasProtocol An optional {@code SasProtocol} protocol 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,
public String generateUserDelegationSas(UserDelegationKey userDelegationKey, String accountName,
BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
SASProtocol sasProtocol, IpRange ipRange) {
return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime,
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 */);
}
Expand All @@ -833,7 +833,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str
*
* <p><strong>Code Samples</strong></p>
*
* {@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}
*
* <p>For more information, see the
* <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas">Azure
Expand All @@ -845,7 +845,7 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str
* @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 sasProtocol An optional {@code SasProtocol} protocol 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.
Expand All @@ -854,16 +854,16 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str
* @param contentType An optional {@code String} content-type header for the SAS.
* @return A string that represents the SAS token
*/
public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
public String generateUserDelegationSas(UserDelegationKey userDelegationKey, String accountName,
BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition,
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);

BlobServiceSasSignatureValues values =
configureServiceSASSignatureValues(blobServiceSASSignatureValues, accountName);
configureServiceSasSignatureValues(blobServiceSASSignatureValues, accountName);

BlobServiceSasQueryParameters blobServiceSasQueryParameters =
values.generateSASQueryParameters(userDelegationKey);
Expand All @@ -878,8 +878,8 @@ public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, Str
* @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
* @return A string that represents the SAS token
*/
public String generateSAS(BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
return this.generateSAS(null, permissions, /* identifier */ expiryTime, null /* startTime */, null /* version
public String generateSas(BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
return this.generateSas(null, permissions, /* identifier */ expiryTime, null /* startTime */, null /* version
*/, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentDisposition */,
null /* contentEncoding */, null /* contentLanguage */, null /*contentType*/);
}
Expand All @@ -890,8 +890,8 @@ public String generateSAS(BlobContainerSasPermission permissions, OffsetDateTime
* @param identifier The {@code String} name of the access policy on the container this SAS references if any
* @return A string that represents the SAS token
*/
public String generateSAS(String identifier) {
return this.generateSAS(identifier, null /* permissions*/, null /* expiryTime */, null /* startTime */, null
public String generateSas(String identifier) {
return this.generateSas(identifier, null /* permissions*/, null /* expiryTime */, null /* startTime */, null
/* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /*
contentDisposition */, null /* contentEncoding */, null /* contentLanguage */, null /*contentType*/);
}
Expand All @@ -904,13 +904,13 @@ public String generateSAS(String identifier) {
* @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 sasProtocol An optional {@code SasProtocol} protocol 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) {
return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null
public String generateSas(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime,
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*/);
}
Expand All @@ -920,7 +920,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi
*
* <p><strong>Code Samples</strong></p>
*
* {@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}
*
* <p>For more information, see the
* <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/create-service-sas">Azure Docs</a></p>
Expand All @@ -930,7 +930,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi
* @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 sasProtocol An optional {@code SasProtocol} protocol 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.
Expand All @@ -939,8 +939,8 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi
* @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, BlobContainerSasPermission permissions, OffsetDateTime expiryTime,
OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
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) {
BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version,
sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
Expand All @@ -951,7 +951,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi

Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);

BlobServiceSasSignatureValues values = configureServiceSASSignatureValues(blobServiceSASSignatureValues,
BlobServiceSasSignatureValues values = configureServiceSasSignatureValues(blobServiceSASSignatureValues,
sharedKeyCredential.getAccountName());

BlobServiceSasQueryParameters blobServiceSasQueryParameters =
Expand All @@ -963,7 +963,7 @@ public String generateSAS(String identifier, BlobContainerSasPermission permissi
/**
* Sets blobServiceSASSignatureValues parameters dependent on the current blob type
*/
private BlobServiceSasSignatureValues configureServiceSASSignatureValues(
private BlobServiceSasSignatureValues configureServiceSasSignatureValues(
BlobServiceSasSignatureValues blobServiceSASSignatureValues, String accountName) {
// Set canonical name
blobServiceSASSignatureValues.setCanonicalName(this.azureBlobStorage.getUrl(), accountName);
Expand Down
Loading