BlobUrlParts Class
- java.
lang. Object - com.
azure. storage. blob. BlobUrlParts
- com.
public final class BlobUrlParts
This class represents the components that make up an Azure Storage Container/Blob URL. You may parse an existing URL into its parts with the parse(URL url) class. You may construct a URL from parts by calling toUrl().
Constructor Summary
Constructor | Description |
---|---|
BlobUrlParts() |
Initializes a Blob |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getAccountName()
Gets the accountname, ex. |
String |
getBlobContainerName()
Gets the container name that will be used as part of the URL path. |
String |
getBlobName()
Decodes and gets the blob name that will be used as part of the URL path. |
Common |
getCommonSasQueryParameters()
Gets the CommonSasQueryParameters representing the SAS query parameters that will be used to generate the SAS token for this URL. |
String |
getHost()
Gets the URL host, ex. |
Blob |
getSasQueryParameters()
Deprecated
Please use getCommonSasQueryParameters()
Gets the BlobServiceSasQueryParameters representing the SAS query parameters |
String |
getScheme()
Gets the URL scheme, ex. |
String |
getSnapshot()
Gets the snapshot identifier that will be used as part of the query string if set. |
Map<String,String[]> |
getUnparsedParameters()
Gets the query string parameters that aren't part of the SAS token that will be used by this URL. |
String |
getVersionId()
Gets the version identifier that will be used as part of the query string if set. |
static
Blob |
parse(String url)
Parses a string into a Blob |
static
Blob |
parse(URL url)
Parses an existing URL into a Blob |
Blob |
parseSasQueryParameters(String queryParams)
Sets the CommonSasQueryParameters representing the SAS query parameters that will be used to generate the SAS token for this URL. |
Blob |
setAccountName(String accountName)
Sets the account name. |
Blob |
setBlobName(String blobName)
Sets the blob name that will be used as part of the URL path. |
Blob |
setCommonSasQueryParameters(CommonSasQueryParameters commonSasQueryParameters)
Sets the CommonSasQueryParameters representing the SAS query parameters that will be used to generate the SAS token for this URL. |
Blob |
setContainerName(String containerName)
Sets the container name that will be used as part of the URL path. |
Blob |
setHost(String host)
Sets the URL host, ex. |
Blob |
setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters)
Deprecated Sets the BlobServiceSasQueryParameters representing the SAS query parameters. |
Blob |
setScheme(String scheme)
Sets the URL scheme, ex. |
Blob |
setSnapshot(String snapshot)
Sets the snapshot identifier that will be used as part of the query string if set. |
Blob |
setUnparsedParameters(Map<String,String[]> unparsedParameters)
Sets the query string parameters that aren't part of the SAS token that will be used by this URL. |
Blob |
setVersionId(String versionId)
Sets the version identifier that will be used as part of the query string if set. |
URL |
toUrl()
Converts the blob URL parts to a URL. |
Methods inherited from java.lang.Object
Constructor Details
BlobUrlParts
public BlobUrlParts()
Initializes a BlobUrlParts object which helps aid in the construction of a Blob Storage URL.
Method Details
getAccountName
public String getAccountName()
Gets the accountname, ex. "myaccountname".
Returns:
getBlobContainerName
public String getBlobContainerName()
Gets the container name that will be used as part of the URL path.
Returns:
getBlobName
public String getBlobName()
Decodes and gets the blob name that will be used as part of the URL path.
Returns:
getCommonSasQueryParameters
public CommonSasQueryParameters getCommonSasQueryParameters()
Gets the CommonSasQueryParameters representing the SAS query parameters that will be used to generate the SAS token for this URL.
Returns:
getHost
public String getHost()
Gets the URL host, ex. "account.blob.core.windows.net" or "127.0.0.1:10000".
Returns:
getSasQueryParameters
@Deprecated
public BlobServiceSasQueryParameters getSasQueryParameters()
Deprecated
Gets the BlobServiceSasQueryParameters representing the SAS query parameters
Returns:
getScheme
public String getScheme()
Gets the URL scheme, ex. "https".
Returns:
getSnapshot
public String getSnapshot()
Gets the snapshot identifier that will be used as part of the query string if set.
Returns:
getUnparsedParameters
public Map
Gets the query string parameters that aren't part of the SAS token that will be used by this URL.
Returns:
getVersionId
public String getVersionId()
Gets the version identifier that will be used as part of the query string if set.
Returns:
parse
public static BlobUrlParts parse(String url)
Parses a string into a BlobUrlParts.
Query parameters will be parsed into two properties, BlobServiceSasQueryParameters which contains all SAS token related values and getUnparsedParameters() which is all other query parameters.
If a URL points to a blob in the root container, and the root container is referenced implicitly, i.e. there is no path element for the container, the name of this blob in the root container will be set as the containerName field in the resulting BlobURLParts
.
Parameters:
URL
to be parsed.
Returns:
parse
public static BlobUrlParts parse(URL url)
Parses an existing URL into a BlobUrlParts.
Query parameters will be parsed into two properties, BlobServiceSasQueryParameters which contains all SAS token related values and getUnparsedParameters() which is all other query parameters.
If a URL points to a blob in the root container, and the root container is referenced implicitly, i.e. there is no path element for the container, the name of this blob in the root container will be set as the containerName field in the resulting BlobURLParts
.
Parameters:
URL
to be parsed.
Returns:
parseSasQueryParameters
public BlobUrlParts parseSasQueryParameters(String queryParams)
Sets the CommonSasQueryParameters representing the SAS query parameters that will be used to generate the SAS token for this URL.
Parameters:
Returns:
setAccountName
public BlobUrlParts setAccountName(String accountName)
Sets the account name.
Parameters:
Returns:
setBlobName
public BlobUrlParts setBlobName(String blobName)
Sets the blob name that will be used as part of the URL path.
Parameters:
Returns:
setCommonSasQueryParameters
public BlobUrlParts setCommonSasQueryParameters(CommonSasQueryParameters commonSasQueryParameters)
Sets the CommonSasQueryParameters representing the SAS query parameters that will be used to generate the SAS token for this URL.
Parameters:
Returns:
setContainerName
public BlobUrlParts setContainerName(String containerName)
Sets the container name that will be used as part of the URL path.
Parameters:
Returns:
setHost
public BlobUrlParts setHost(String host)
Sets the URL host, ex. "account.blob.core.windows.net" or "127.0.0.1:10000".
Parameters:
Returns:
setSasQueryParameters
@Deprecated
public BlobUrlParts setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters)
Deprecated
Sets the BlobServiceSasQueryParameters representing the SAS query parameters.
Parameters:
Returns:
setScheme
public BlobUrlParts setScheme(String scheme)
Sets the URL scheme, ex. "https".
Parameters:
Returns:
setSnapshot
public BlobUrlParts setSnapshot(String snapshot)
Sets the snapshot identifier that will be used as part of the query string if set.
Parameters:
Returns:
setUnparsedParameters
public BlobUrlParts setUnparsedParameters(Map
Sets the query string parameters that aren't part of the SAS token that will be used by this URL.
Parameters:
Returns:
setVersionId
public BlobUrlParts setVersionId(String versionId)
Sets the version identifier that will be used as part of the query string if set.
Parameters:
Returns:
toUrl
public URL toUrl()
Converts the blob URL parts to a URL.
Returns:
URL
to the blob resource composed of all the elements in this object.