Class BlobUrlParts
parse(URL)
class. You may construct a URL from parts by calling toUrl()
.-
Constructor Summary
ConstructorDescriptionInitializes a BlobUrlParts object which helps aid in the construction of a Blob Storage URL. -
Method Summary
Modifier and TypeMethodDescriptionGets the accountname, ex.Gets the container name that will be used as part of the URL path.Decodes and gets the blob name that will be used as part of the URL path.Gets theCommonSasQueryParameters
representing the SAS query parameters that will be used to generate the SAS token for this URL.getHost()
Gets the URL host, ex.Deprecated.Gets the URL scheme, ex.Gets the snapshot identifier that will be used as part of the query string if set.Gets the query string parameters that aren't part of the SAS token that will be used by this URL.Gets the version identifier that will be used as part of the query string if set.static BlobUrlParts
Parses a string into a BlobUrlParts.static BlobUrlParts
Parses an existing URL into a BlobUrlParts.parseSasQueryParameters
(String queryParams) Sets theCommonSasQueryParameters
representing the SAS query parameters that will be used to generate the SAS token for this URL.setAccountName
(String accountName) Sets the account name.setBlobName
(String blobName) Sets the blob name that will be used as part of the URL path.setCommonSasQueryParameters
(CommonSasQueryParameters commonSasQueryParameters) Sets theCommonSasQueryParameters
representing the SAS query parameters that will be used to generate the SAS token for this URL.setContainerName
(String containerName) Sets the container name that will be used as part of the URL path.Sets the URL host, ex.setSasQueryParameters
(BlobServiceSasQueryParameters blobServiceSasQueryParameters) Deprecated.Sets the URL scheme, ex.setSnapshot
(String snapshot) Sets the snapshot identifier that will be used as part of the query string if set.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.setVersionId
(String versionId) Sets the version identifier that will be used as part of the query string if set.toUrl()
Converts the blob URL parts to aURL
.
-
Constructor Details
-
BlobUrlParts
public BlobUrlParts()Initializes a BlobUrlParts object which helps aid in the construction of a Blob Storage URL.
-
-
Method Details
-
getAccountName
Gets the accountname, ex. "myaccountname".- Returns:
- the account name.
-
setAccountName
Sets the account name.- Parameters:
accountName
- The account name.- Returns:
- the updated BlobURLParts object.
-
getScheme
Gets the URL scheme, ex. "https".- Returns:
- the URL scheme.
-
setScheme
Sets the URL scheme, ex. "https".- Parameters:
scheme
- The URL scheme.- Returns:
- the updated BlobUrlParts object.
-
getHost
Gets the URL host, ex. "account.blob.core.windows.net" or "127.0.0.1:10000".- Returns:
- the URL host.
-
setHost
Sets the URL host, ex. "account.blob.core.windows.net" or "127.0.0.1:10000".- Parameters:
host
- The URL host.- Returns:
- the updated BlobUrlParts object.
-
getBlobContainerName
Gets the container name that will be used as part of the URL path.- Returns:
- the container name.
-
setContainerName
Sets the container name that will be used as part of the URL path.- Parameters:
containerName
- The container nme.- Returns:
- the updated BlobUrlParts object.
-
getBlobName
Decodes and gets the blob name that will be used as part of the URL path.- Returns:
- the decoded blob name.
-
setBlobName
Sets the blob name that will be used as part of the URL path.- Parameters:
blobName
- The blob name. If the blob name contains special characters, pass in the url encoded version of the blob name.- Returns:
- the updated BlobUrlParts object.
-
getSnapshot
Gets the snapshot identifier that will be used as part of the query string if set.- Returns:
- the snapshot identifier.
-
setSnapshot
Sets the snapshot identifier that will be used as part of the query string if set.- Parameters:
snapshot
- The snapshot identifier.- Returns:
- the updated BlobUrlParts object.
-
getVersionId
Gets the version identifier that will be used as part of the query string if set.- Returns:
- the version identifier.
-
setVersionId
Sets the version identifier that will be used as part of the query string if set.- Parameters:
versionId
- The version identifier.- Returns:
- the updated BlobUrlParts object.
-
getSasQueryParameters
Deprecated.Please usegetCommonSasQueryParameters()
Gets theBlobServiceSasQueryParameters
representing the SAS query parameters- Returns:
- the
BlobServiceSasQueryParameters
of the URL
-
setSasQueryParameters
@Deprecated public BlobUrlParts setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters) Deprecated.Sets theBlobServiceSasQueryParameters
representing the SAS query parameters.- Parameters:
blobServiceSasQueryParameters
- The SAS query parameters.- Returns:
- the updated BlobUrlParts object.
-
getCommonSasQueryParameters
Gets theCommonSasQueryParameters
representing the SAS query parameters that will be used to generate the SAS token for this URL.- Returns:
- the
CommonSasQueryParameters
of the URL
-
setCommonSasQueryParameters
Sets theCommonSasQueryParameters
representing the SAS query parameters that will be used to generate the SAS token for this URL.- Parameters:
commonSasQueryParameters
- The SAS query parameters.- Returns:
- the updated BlobUrlParts object.
-
parseSasQueryParameters
Sets theCommonSasQueryParameters
representing the SAS query parameters that will be used to generate the SAS token for this URL.- Parameters:
queryParams
- The SAS query parameter string.- Returns:
- the updated BlobUrlParts object.
-
getUnparsedParameters
Gets the query string parameters that aren't part of the SAS token that will be used by this URL.- Returns:
- the non-SAS token query string values.
-
setUnparsedParameters
Sets the query string parameters that aren't part of the SAS token that will be used by this URL.- Parameters:
unparsedParameters
- The non-SAS token query string values.- Returns:
- the updated BlobUrlParts object.
-
toUrl
Converts the blob URL parts to aURL
.- Returns:
- A
URL
to the blob resource composed of all the elements in this object. - Throws:
IllegalStateException
- The fields present on the BlobUrlParts object were insufficient to construct a valid URL or were ill-formatted.
-
parse
Parses a string into a BlobUrlParts.Query parameters will be parsed into two properties,
BlobServiceSasQueryParameters
which contains all SAS token related values andunparsedParameters
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
- TheURL
to be parsed.- Returns:
- A
BlobUrlParts
object containing all the components of a BlobURL. - Throws:
IllegalArgumentException
- Ifurl
is a malformedURL
.
-
parse
Parses an existing URL into a BlobUrlParts.Query parameters will be parsed into two properties,
BlobServiceSasQueryParameters
which contains all SAS token related values andunparsedParameters
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
- TheURL
to be parsed.- Returns:
- A
BlobUrlParts
object containing all the components of a BlobURL.
-
getCommonSasQueryParameters()