你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ShareServiceSasSignatureValues Class
- java.
lang. Object - com.
azure. storage. file. share. sas. ShareServiceSasSignatureValues
- com.
public final class ShareServiceSasSignatureValues
Used to initialize parameters for a Shared Access Signature (SAS) for an Azure File Storage service. Once all the values here are set, use the appropriate SAS generation method on the desired share/file/directory 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
Constructor | Description |
---|---|
ShareServiceSasSignatureValues() |
Deprecated
Please use ShareServiceSasSignatureValues(String identifier), ShareServiceSasSignatureValues(OffsetDateTime expiryTime, ShareSasPermission permissions), or ShareServiceSasSignatureValues(OffsetDateTime expiryTime, ShareFileSasPermission permissions)
Creates an object with empty values for all fields. |
ShareServiceSasSignatureValues(String identifier) |
Creates an object with the specified identifier. |
ShareServiceSasSignatureValues(OffsetDateTime expiryTime, ShareFileSasPermission permissions) |
Creates an object with the specified expiry time and permissions |
ShareServiceSasSignatureValues(OffsetDateTime expiryTime, ShareSasPermission permissions) |
Creates an object with the specified expiry time and permissions |
Method Summary
Modifier and Type | Method and Description |
---|---|
Share |
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 | getCacheControl() |
String | getContentDisposition() |
String | getContentEncoding() |
String | getContentLanguage() |
String | getContentType() |
Offset |
getExpiryTime() |
String |
getFilePath()
Deprecated
File path is now auto-populated by the SAS generation methods provided on the desired file/directory client.
Gets the path of the file or directory being made accessible. |
String | getIdentifier() |
String | getPermissions() |
Sas |
getProtocol() |
Sas |
getSasIpRange() |
String |
getShareName()
Deprecated
Share name is now auto-populated by the SAS generation methods provided on the desired share/file/directory client.
Gets the name of the share being made accessible. |
Offset |
getStartTime() |
String | getVersion() |
Share |
setCacheControl(String cacheControl)
Sets the cache-control header for the SAS. |
Share |
setContentDisposition(String contentDisposition)
Sets the content-disposition header for the SAS. |
Share |
setContentEncoding(String contentEncoding)
Sets the content-encoding header for the SAS. |
Share |
setContentLanguage(String contentLanguage)
Sets the content-language header for the SAS. |
Share |
setContentType(String contentType)
Sets the content-type header for the SAS. |
Share |
setExpiryTime(OffsetDateTime expiryTime)
Sets the time after which the SAS will no longer work. |
Share |
setFilePath(String filePath)
Deprecated
Please use the generate
Sets the path of the file or directory being made accessible. |
Share |
setIdentifier(String identifier)
Sets the name of the access policy on the share this SAS references if any. |
Share |
setPermissions(ShareFileSasPermission permissions)
Sets the permissions allowed by the SAS. |
Share |
setPermissions(ShareSasPermission permissions)
Sets the permissions allowed by the SAS. |
Share |
setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the protocols allowed by the SAS. |
Share |
setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS. |
Share |
setShareName(String shareName)
Deprecated
Please use the generate
Sets the name of the share being made accessible. |
Share |
setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect. |
Share |
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
ShareServiceSasSignatureValues
@Deprecated
public ShareServiceSasSignatureValues()
Deprecated
Creates an object with empty values for all fields.
ShareServiceSasSignatureValues
public ShareServiceSasSignatureValues(String identifier)
Creates an object with the specified identifier.
Parameters:
ShareServiceSasSignatureValues
public ShareServiceSasSignatureValues(OffsetDateTime expiryTime, ShareFileSasPermission permissions)
Creates an object with the specified expiry time and permissions
Parameters:
ShareServiceSasSignatureValues
public ShareServiceSasSignatureValues(OffsetDateTime expiryTime, ShareSasPermission permissions)
Creates an object with the specified expiry time and permissions
Parameters:
Method Details
generateSasQueryParameters
@Deprecated
public ShareServiceSasQueryParameters 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 getFilePath() is not set, query parameters for a share SAS are returned.
- Otherwise, getShareName() and getFilePath() are used to create query parameters for a file SAS.
See class level JavaDocs for code snippets.
Parameters:
Returns:
getCacheControl
public String getCacheControl()
Returns:
getContentDisposition
public String getContentDisposition()
Returns:
getContentEncoding
public String getContentEncoding()
Returns:
getContentLanguage
public String getContentLanguage()
Returns:
getContentType
public String getContentType()
Returns:
getExpiryTime
public OffsetDateTime getExpiryTime()
Returns:
getFilePath
@Deprecated
public String getFilePath()
Deprecated
Gets the path of the file or directory being made accessible. null
or an empty string for a share SAS.
Returns:
null
or an empty string for a share SAS.getIdentifier
public String getIdentifier()
Returns:
getPermissions
public String getPermissions()
Returns:
getProtocol
public SasProtocol getProtocol()
Returns:
getSasIpRange
public SasIpRange getSasIpRange()
Returns:
getShareName
@Deprecated
public String getShareName()
Deprecated
Gets the name of the share being made accessible.
Returns:
getStartTime
public OffsetDateTime getStartTime()
Returns:
getVersion
public String getVersion()
Returns:
setCacheControl
public ShareServiceSasSignatureValues setCacheControl(String cacheControl)
Sets the cache-control header for the SAS.
Parameters:
Returns:
setContentDisposition
public ShareServiceSasSignatureValues setContentDisposition(String contentDisposition)
Sets the content-disposition header for the SAS.
Parameters:
Returns:
setContentEncoding
public ShareServiceSasSignatureValues setContentEncoding(String contentEncoding)
Sets the content-encoding header for the SAS.
Parameters:
Returns:
setContentLanguage
public ShareServiceSasSignatureValues setContentLanguage(String contentLanguage)
Sets the content-language header for the SAS.
Parameters:
Returns:
setContentType
public ShareServiceSasSignatureValues setContentType(String contentType)
Sets the content-type header for the SAS.
Parameters:
Returns:
setExpiryTime
public ShareServiceSasSignatureValues setExpiryTime(OffsetDateTime expiryTime)
Sets the time after which the SAS will no longer work.
Parameters:
Returns:
setFilePath
@Deprecated
public ShareServiceSasSignatureValues setFilePath(String filePath)
Deprecated
Sets the path of the file or directory being made accessible. Pass in null
or an empty string for a share SAS.
Parameters:
Returns:
setIdentifier
public ShareServiceSasSignatureValues setIdentifier(String identifier)
Sets the name of the access policy on the share this SAS references if any. Please see Establishing a stored access policy for more information.
Parameters:
Returns:
setPermissions
public ShareServiceSasSignatureValues setPermissions(ShareFileSasPermission permissions)
Sets the permissions allowed by the SAS. Share file SASs are created when both a setShareName(String shareName) and setFilePath(String filePath) are set on the builder.
Parameters:
Returns:
setPermissions
public ShareServiceSasSignatureValues setPermissions(ShareSasPermission permissions)
Sets the permissions allowed by the SAS. Share SASs are created when only setShareName(String shareName) is set on the builder.
Parameters:
Returns:
setProtocol
public ShareServiceSasSignatureValues setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the protocols allowed by the SAS.
Parameters:
Returns:
setSasIpRange
public ShareServiceSasSignatureValues setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS.
Parameters:
Returns:
setShareName
@Deprecated
public ShareServiceSasSignatureValues setShareName(String shareName)
Deprecated
Sets the name of the share being made accessible.
Parameters:
Returns:
setStartTime
public ShareServiceSasSignatureValues setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect.
Parameters:
Returns:
setVersion
@Deprecated
public ShareServiceSasSignatureValues 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: