你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
BlobServiceSasSignatureValues Class
- java.
lang. Object - com.
azure. storage. blob. sas. BlobServiceSasSignatureValues
- com.
public final class BlobServiceSasSignatureValues
Used to initialize parameters for a Shared Access Signature (SAS) for an Azure Blob Storage service. Once all the values here are set, use the appropriate SAS generation method on the desired container/blob client to obtain a representation of the SAS which can then be applied to a new client using the .sasToken(String) method on the desired client builder.
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
Blob |
generateSasQueryParameters(UserDelegationKey delegationKey, String accountName)
Deprecated
Please use the generate
Uses a user delegation key to sign these signature values to produce the proper SAS query parameters. |
Blob |
generateSasQueryParameters(StorageSharedKeyCredential storageSharedKeyCredentials)
Deprecated
Please use the generate
Uses an account's shared key credential to sign these signature values to produce the proper SAS query parameters. |
String |
getBlobName()
Deprecated
Blob name is now auto-populated by the SAS generation methods provided on the desired blob client.
Decodes and gets the name of the blob the SAS user may access. |
String | getCacheControl() |
String |
getContainerName()
Deprecated
Container name is now auto-populated by the SAS generation methods provided on the desired container/blob client.
Gets the name of the container the SAS user may access. |
String | getContentDisposition() |
String | getContentEncoding() |
String | getContentLanguage() |
String | getContentType() |
String | getCorrelationId() |
Offset |
getExpiryTime() |
String | getIdentifier() |
String | getPermissions() |
String | getPreauthorizedAgentObjectId() |
Sas |
getProtocol() |
Sas |
getSasIpRange() |
String |
getSnapshotId()
Deprecated
Snapshot id is now auto-populated by the SAS generation methods provided on the desired (snapshot) blob client.
|
Offset |
getStartTime() |
String | getVersion() |
Blob |
setBlobName(String blobName)
Deprecated
Please use the SAS generation methods provided on the desired blob client that will auto-populate the blob name.
Sets the blob the SAS user may access. |
Blob |
setCacheControl(String cacheControl)
Sets the cache-control header for the SAS. |
Blob |
setContainerName(String containerName)
Deprecated
Please use the SAS generation methods provided on the desired container/blob client that will auto-populate the container name.
Sets the container the SAS user may access. |
Blob |
setContentDisposition(String contentDisposition)
Sets the content-disposition header for the SAS. |
Blob |
setContentEncoding(String contentEncoding)
Sets the content-encoding header for the SAS. |
Blob |
setContentLanguage(String contentLanguage)
Sets the content-language header for the SAS. |
Blob |
setContentType(String contentType)
Sets the content-type header for the SAS. |
Blob |
setCorrelationId(String correlationId)
Sets the correlation id value for the SAS. |
Blob |
setExpiryTime(OffsetDateTime expiryTime)
Sets the time after which the SAS will no longer work. |
Blob |
setIdentifier(String identifier)
Sets the name of the access policy on the container this SAS references if any. |
Blob |
setPermissions(BlobContainerSasPermission permissions)
Sets the Container permissions allowed by the SAS. |
Blob |
setPermissions(BlobSasPermission permissions)
Sets the Blob permissions allowed by the SAS. |
Blob |
setPreauthorizedAgentObjectId(String preauthorizedAgentObjectId)
Sets the AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the action granted by the SAS token. |
Blob |
setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the protocols allowed by the SAS. |
Blob |
setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS. |
Blob |
setSnapshotId(String snapshotId)
Deprecated
Please use the SAS generation methods provided on the desired (snapshot) blob client that will auto-populate the snapshot id.
Sets the specific snapshot the SAS user may access. |
Blob |
setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect. |
Blob |
setVersion(String version)
Deprecated
The version is set to the latest version of sas. Users should stop calling this API as it is now treated as a no-op.
Sets the version of the service this SAS will target. |
Methods inherited from java.lang.Object
Constructor Details
BlobServiceSasSignatureValues
@Deprecated
public BlobServiceSasSignatureValues()
Deprecated
Creates an object with empty values for all fields.
BlobServiceSasSignatureValues
public BlobServiceSasSignatureValues(String identifier)
Creates an object with the specified identifier. NOTE: Identifier can not be used for a UserDelegationKey SAS.
Parameters:
BlobServiceSasSignatureValues
@Deprecated
public BlobServiceSasSignatureValues(String version, SasProtocol sasProtocol, OffsetDateTime startTime, OffsetDateTime expiryTime, String permission, SasIpRange sasIpRange, String identifier, String cacheControl, String contentDisposition, String contentEncoding, String contentLanguage, String contentType)
Deprecated
Creates an object with the specified values.
Parameters:
BlobServiceSasSignatureValues
public BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobContainerSasPermission permissions)
Creates an object with the specified expiry time and permissions
Parameters:
BlobServiceSasSignatureValues
public BlobServiceSasSignatureValues(OffsetDateTime expiryTime, BlobSasPermission permissions)
Creates an object with the specified expiry time and permissions
Parameters:
Method Details
generateSasQueryParameters
@Deprecated
public BlobServiceSasQueryParameters generateSasQueryParameters(UserDelegationKey delegationKey, String accountName)
Deprecated
Uses a user delegation key to sign these signature values to produce the proper SAS query parameters.
Notes on SAS generation
- If setIdentifier(String identifier) is set, setExpiryTime(OffsetDateTime expiryTime) and permissions should not be set. These values are inherited from the stored access policy.
- Otherwise, setExpiryTime(OffsetDateTime expiryTime) and getPermissions() must be set.
The type of SAS query parameters returned depends on the following:
- If getBlobName() is not set, container SAS query parameters are returned.
- If getBlobName() and getSnapshotId() are set, blob snapshot SAS query parameters are returned.
- If only getBlobName() is set, blob SAS query parameters are returned.
See class level JavaDocs for code snippets.
Parameters:
Returns:
generateSasQueryParameters
@Deprecated
public BlobServiceSasQueryParameters generateSasQueryParameters(StorageSharedKeyCredential storageSharedKeyCredentials)
Deprecated
Uses an account's shared key credential to sign these signature values to produce the proper SAS query parameters.
Notes on SAS generation
- If setIdentifier(String identifier) is set, setExpiryTime(OffsetDateTime expiryTime) and permissions should not be set. These values are inherited from the stored access policy.
- Otherwise, setExpiryTime(OffsetDateTime expiryTime) and getPermissions() must be set.
The type of SAS query parameters returned depends on the following:
- If getBlobName() is not set, container SAS query parameters are returned.
- If getBlobName() and getSnapshotId() are set, blob snapshot SAS query parameters are returned.
- If only getBlobName() is set, blob SAS query parameters are returned.
See class level JavaDocs for code snippets.
Parameters:
Returns:
getBlobName
@Deprecated
public String getBlobName()
Deprecated
Decodes and gets the name of the blob the SAS user may access. null
or an empty string is returned when a creating a container SAS.
Returns:
null
or an empty string is returned when a
creating a container SAS.getCacheControl
public String getCacheControl()
Returns:
getContainerName
@Deprecated
public String getContainerName()
Deprecated
Gets the name of the container the SAS user may access.
Returns:
getContentDisposition
public String getContentDisposition()
Returns:
getContentEncoding
public String getContentEncoding()
Returns:
getContentLanguage
public String getContentLanguage()
Returns:
getContentType
public String getContentType()
Returns:
getCorrelationId
public String getCorrelationId()
Returns:
getExpiryTime
public OffsetDateTime getExpiryTime()
Returns:
getIdentifier
public String getIdentifier()
Returns:
getPermissions
public String getPermissions()
Returns:
getPreauthorizedAgentObjectId
public String getPreauthorizedAgentObjectId()
Returns:
getProtocol
public SasProtocol getProtocol()
Returns:
getSasIpRange
public SasIpRange getSasIpRange()
Returns:
getSnapshotId
@Deprecated
public String getSnapshotId()
Deprecated
Returns:
getStartTime
public OffsetDateTime getStartTime()
Returns:
getVersion
public String getVersion()
Returns:
setBlobName
@Deprecated
public BlobServiceSasSignatureValues setBlobName(String blobName)
Deprecated
Sets the blob the SAS user may access. Use null
or an empty string to create a container SAS.
Parameters:
null
or an empty string to create a container SAS.
Returns:
setCacheControl
public BlobServiceSasSignatureValues setCacheControl(String cacheControl)
Sets the cache-control header for the SAS.
Parameters:
Returns:
setContainerName
@Deprecated
public BlobServiceSasSignatureValues setContainerName(String containerName)
Deprecated
Sets the container the SAS user may access.
Parameters:
Returns:
setContentDisposition
public BlobServiceSasSignatureValues setContentDisposition(String contentDisposition)
Sets the content-disposition header for the SAS.
Parameters:
Returns:
setContentEncoding
public BlobServiceSasSignatureValues setContentEncoding(String contentEncoding)
Sets the content-encoding header for the SAS.
Parameters:
Returns:
setContentLanguage
public BlobServiceSasSignatureValues setContentLanguage(String contentLanguage)
Sets the content-language header for the SAS.
Parameters:
Returns:
setContentType
public BlobServiceSasSignatureValues setContentType(String contentType)
Sets the content-type header for the SAS.
Parameters:
Returns:
setCorrelationId
public BlobServiceSasSignatureValues setCorrelationId(String correlationId)
Sets the correlation id value for the SAS.
Note: This parameter is only valid for user delegation SAS.
Parameters:
Returns:
setExpiryTime
public BlobServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime)
Sets the time after which the SAS will no longer work.
Parameters:
Returns:
setIdentifier
public BlobServiceSasSignatureValues setIdentifier(String identifier)
Sets the name of the access policy on the container this SAS references if any. Please see here for more information.
Parameters:
Returns:
setPermissions
public BlobServiceSasSignatureValues setPermissions(BlobContainerSasPermission permissions)
Sets the Container permissions allowed by the SAS.
Parameters:
Returns:
setPermissions
public BlobServiceSasSignatureValues setPermissions(BlobSasPermission permissions)
Sets the Blob permissions allowed by the SAS.
Parameters:
Returns:
setPreauthorizedAgentObjectId
public BlobServiceSasSignatureValues setPreauthorizedAgentObjectId(String preauthorizedAgentObjectId)
Sets the AAD object ID of a user assumed to be authorized by the owner of the user delegation key to perform the action granted by the SAS token.
Parameters:
Returns:
setProtocol
public BlobServiceSasSignatureValues setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the protocols allowed by the SAS.
Parameters:
Returns:
setSasIpRange
public BlobServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS.
Parameters:
Returns:
setSnapshotId
@Deprecated
public BlobServiceSasSignatureValues setSnapshotId(String snapshotId)
Deprecated
Sets the specific snapshot the SAS user may access.
#resource will be set to #SAS_BLOB_SNAPSHOT_CONSTANT if the passed snapshotId
isn't null
amd #resource is set to #SAS_BLOB_CONSTANT.
Parameters:
Returns:
setStartTime
public BlobServiceSasSignatureValues setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect.
Parameters:
Returns:
setVersion
@Deprecated
public BlobServiceSasSignatureValues setVersion(String version)
Deprecated
Sets the version of the service this SAS will target. If not specified, it will default to the version targeted by the library.
Parameters:
Returns: