public final class CloudStorageAccount extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ACCOUNT_KEY_NAME
Represents the setting name for the account key.
|
protected static String |
ACCOUNT_NAME_NAME
Represents the setting name for the account name.
|
protected static String |
BLOB_ENDPOINT_NAME
Represents the setting name for a custom blob storage endpoint.
|
protected static String |
QUEUE_BASE_DNS_NAME
Represents the root queue DNS name.
|
protected static String |
QUEUE_ENDPOINT_NAME
Represents the setting name for a custom queue endpoint.
|
protected static String |
SHARED_ACCESS_SIGNATURE_NAME
Represents the setting name for a shared access key.
|
protected static String |
TABLE_BASE_DNS_NAME
Represents the root table storage DNS name.
|
protected static String |
TABLE_ENDPOINT_NAME
Represents the setting name for a custom table storage endpoint.
|
| Constructor and Description |
|---|
CloudStorageAccount(StorageCredentials storageCredentials)
Creates an instance of the
CloudStorageAccount class using the specified account credentials. |
CloudStorageAccount(StorageCredentialsAccountAndKey storageCredentials,
boolean useHttps)
Creates an instance of the
CloudStorageAccount class using the specified account credentials and the
default service endpoints, using HTTP or HTTPS as specified. |
CloudStorageAccount(StorageCredentials storageCredentials,
URI blobEndpoint,
URI queueEndpoint,
URI tableEndpoint)
Creates an instance of the
CloudStorageAccount class using the specified account credentials and
service endpoints. |
| Modifier and Type | Method and Description |
|---|---|
CloudBlobClient |
createCloudBlobClient()
Creates a new Blob service client.
|
CloudQueueClient |
createCloudQueueClient()
Creates a new queue service client.
|
CloudTableClient |
createCloudTableClient()
Creates a new table service client.
|
URI |
getBlobEndpoint()
Returns the endpoint for the Blob service, as configured for the storage account.
|
StorageCredentials |
getCredentials()
Returns the credentials for the Blob service, as configured for the storage account.
|
static CloudStorageAccount |
getDevelopmentStorageAccount()
Returns a
CloudStorageAccount object that represents the development storage credentials. |
static CloudStorageAccount |
getDevelopmentStorageAccount(URI proxyUri)
Returns a
CloudStorageAccount object that represents the development storage credentials, using the
specified proxy URI. |
URI |
getQueueEndpoint()
Returns the endpoint for the Queue service, as configured for the storage account.
|
URI |
getTableEndpoint()
Returns the endpoint for the table service, as configured for the storage account.
|
static CloudStorageAccount |
parse(String connectionString)
Parses a connection string and returns a cloud storage account created from the connection string.
|
protected void |
setCredentials(StorageCredentials credentials)
Reserved for internal use.
|
String |
toString()
Returns a connection string for this storage account, without sensitive data.
|
String |
toString(boolean exportSecrets)
Returns a connection string for this storage account, optionally with sensitive data.
|
protected static final String ACCOUNT_KEY_NAME
protected static final String ACCOUNT_NAME_NAME
protected static final String BLOB_ENDPOINT_NAME
protected static final String QUEUE_BASE_DNS_NAME
protected static final String QUEUE_ENDPOINT_NAME
protected static final String SHARED_ACCESS_SIGNATURE_NAME
protected static final String TABLE_BASE_DNS_NAME
protected static final String TABLE_ENDPOINT_NAME
public CloudStorageAccount(StorageCredentials storageCredentials) throws URISyntaxException
CloudStorageAccount class using the specified account credentials.
With this constructor, the CloudStorageAccount object is constructed using the default HTTP storage
service endpoints. The default HTTP storage service endpoints are
http://myaccount.blob.core.windows.net,
http://myaccount.queue.core.windows.net, and
http://myaccount.table.core.windows.net, where myaccount is the name of
your storage account.
The credentials provided when constructing the CloudStorageAccount object are used to authenticate
all further requests against resources that are accessed via the CloudStorageAccount object or a
client object created from it. A client object may be a CloudBlobClient object.
storageCredentials - A StorageCredentials object that represents the storage credentials to use to authenticate
this account.URISyntaxException - If storageCredentials specify an invalid account name.public CloudStorageAccount(StorageCredentials storageCredentials, URI blobEndpoint, URI queueEndpoint, URI tableEndpoint)
CloudStorageAccount class using the specified account credentials and
service endpoints.
Use this constructor to construct a CloudStorageAccount object using custom endpoints, in the case
where you've configured a custom domain name for your storage account.
The credentials provided when constructing the CloudStorageAccount object are used to authenticate
all further requests against resources that are accessed via the CloudStorageAccount object or a
client object created from it. A client object may be a CloudBlobClient object.
storageCredentials - A StorageCredentials object that represents the storage credentials to use to authenticate
this account.blobEndpoint - A java.net.URI object that represents the Blob service endpoint.queueEndpoint - A java.net.URI object that represents the Queue service endpoint.tableEndpoint - A java.net.URI object that represents the Table service endpoint.public CloudStorageAccount(StorageCredentialsAccountAndKey storageCredentials, boolean useHttps) throws URISyntaxException
CloudStorageAccount class using the specified account credentials and the
default service endpoints, using HTTP or HTTPS as specified.
With this constructor, the CloudStorageAccount object is constructed using the default storage
service endpoints. The default storage service endpoints are
[http|https]://myaccount.blob.core.windows.net;
[http|https]://myaccount.queue.core.windows.net; and
[http|https]://myaccount.table.core.windows.net, where myaccount is the
name of your storage account. Access to the cloud storage account may be via HTTP or HTTPS, as specified by the
useHttps parameter.
The credentials provided when constructing the CloudStorageAccount object are used to authenticate
all further requests against resources that are accessed via the CloudStorageAccount object or a
client object created from it. A client object may be a CloudBlobClient object.
storageCredentials - A StorageCredentialsAccountAndKey object that represents the storage credentials to use to
authenticate this account.useHttps - true to use HTTPS to connect to the storage service endpoints; otherwise,
false.URISyntaxException - If storageCredentials specify an invalid account name.public static CloudStorageAccount getDevelopmentStorageAccount()
CloudStorageAccount object that represents the development storage credentials.CloudStorageAccount object for the development storage credentials.public static CloudStorageAccount getDevelopmentStorageAccount(URI proxyUri) throws URISyntaxException
CloudStorageAccount object that represents the development storage credentials, using the
specified proxy URI.proxyUri - A java.net.URI object that represents the proxy endpoint to use.CloudStorageAccount object for the development storage credentials.URISyntaxException - If the resource URI is invalid.public static CloudStorageAccount parse(String connectionString) throws URISyntaxException, InvalidKeyException
Note this method is not supported for shared access signature credentials as they do not contain the required endpoint configuration parameters.
connectionString - A String that represents the connection string to parse.CloudStorageAccount object that represents the cloud storage account constructed from the
values provided in the connection string.InvalidKeyException - If credentials in the connection string contain an invalid key.URISyntaxException - If the connection string specifies an invalid URI.public CloudBlobClient createCloudBlobClient()
CloudBlobClient that represents the cloud blob client.public CloudQueueClient createCloudQueueClient()
public CloudTableClient createCloudTableClient()
public URI getBlobEndpoint()
java.net.URI object that represents the blob endpoint associated with this account.public StorageCredentials getCredentials()
StorageCredentials object that represents the credentials for this storage account.public URI getQueueEndpoint()
java.net.URI object that represents the queue endpoint associated with this account.public URI getTableEndpoint()
java.net.URI object that represents the table endpoint associated with this account.protected void setCredentials(StorageCredentials credentials)
credentials - Reserved.public String toString()
public String toString(boolean exportSecrets)
exportSecrets - true to include sensitive data in the string; otherwise, false.String that represents the connection string for this storage account, optionally with
sensitive data./**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/