public final class BlobUrlParts extends Object
BlobUrlParts.parse(URL)
class. You may construct a URL from parts by calling BlobUrlParts.toUrl()
.Constructor and Description |
---|
BlobUrlParts()
Initializes a BlobUrlParts object which helps aid in the construction of a Blob Storage URL.
|
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.
|
String |
getHost()
Gets the URL host, ex.
|
BlobServiceSasQueryParameters |
getSasQueryParameters()
Gets the
BlobServiceSasQueryParameters representing the SAS query parameters that will be used to
generate the SAS token for this URL. |
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.
|
static BlobUrlParts |
parse(String url)
Parses a string into a BlobUrlParts.
|
static BlobUrlParts |
parse(URL url)
Parses an existing URL into a BlobUrlParts.
|
BlobUrlParts |
setAccountName(String accountName)
Sets the account name.
|
BlobUrlParts |
setBlobName(String blobName)
Sets the blob name that will be used as part of the URL path.
|
BlobUrlParts |
setContainerName(String containerName)
Sets the container name that will be used as part of the URL path.
|
BlobUrlParts |
setHost(String host)
Sets the URL host, ex.
|
BlobUrlParts |
setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters)
Sets the
BlobServiceSasQueryParameters representing the SAS query parameters that will be used to
generate the SAS token for this URL. |
BlobUrlParts |
setScheme(String scheme)
Sets the URL scheme, ex.
|
BlobUrlParts |
setSnapshot(String snapshot)
Sets the snapshot identifier that will be used as part of the query string if set.
|
BlobUrlParts |
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.
|
URL |
toUrl()
Converts the blob URL parts to a
URL . |
public BlobUrlParts()
public String getAccountName()
public BlobUrlParts setAccountName(String accountName)
accountName
- The account name.public String getScheme()
public BlobUrlParts setScheme(String scheme)
scheme
- The URL scheme.public String getHost()
public BlobUrlParts setHost(String host)
host
- The URL host.public String getBlobContainerName()
public BlobUrlParts setContainerName(String containerName)
containerName
- The container nme.public String getBlobName()
public BlobUrlParts setBlobName(String blobName)
blobName
- The blob name.public String getSnapshot()
public BlobUrlParts setSnapshot(String snapshot)
snapshot
- The snapshot identifier.public BlobServiceSasQueryParameters getSasQueryParameters()
BlobServiceSasQueryParameters
representing the SAS query parameters that will be used to
generate the SAS token for this URL.BlobServiceSasQueryParameters
of the URLpublic BlobUrlParts setSasQueryParameters(BlobServiceSasQueryParameters blobServiceSasQueryParameters)
BlobServiceSasQueryParameters
representing the SAS query parameters that will be used to
generate the SAS token for this URL.blobServiceSasQueryParameters
- The SAS query parameters.public Map<String,String[]> getUnparsedParameters()
public BlobUrlParts setUnparsedParameters(Map<String,String[]> unparsedParameters)
unparsedParameters
- The non-SAS token query string values.public URL toUrl()
URL
.URL
to the blob resource composed of all the elements in this object.IllegalStateException
- The fields present on the BlobUrlParts object were insufficient to construct a
valid URL or were ill-formatted.public static BlobUrlParts parse(String url)
Query parameters will be parsed into two properties, BlobServiceSasQueryParameters
which contains
all SAS token related values and unparsedParameters
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
.
url
- The URL
to be parsed.BlobUrlParts
object containing all the components of a BlobURL.IllegalArgumentException
- If url
is a malformed URL
.public static BlobUrlParts parse(URL url)
Query parameters will be parsed into two properties, BlobServiceSasQueryParameters
which contains
all SAS token related values and unparsedParameters
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
.
url
- The URL
to be parsed.BlobUrlParts
object containing all the components of a BlobURL.Copyright © 2019 Microsoft Corporation. All rights reserved.