CloudBlobClient Class
- java.
lang. Object - ServiceClient
- com.
microsoft. azure. storage. blob. CloudBlobClient
- com.
public class CloudBlobClient extends ServiceClient
Provides a client for accessing the Microsoft Azure Blob service.
This class provides a point of access to the Blob service. The service client encapsulates the base URI for the Blob service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
Constructor Summary
Constructor | Description |
---|---|
CloudBlobClient(final StorageUri baseUri) |
Creates an instance of the class using the specified Blob service endpoint and anonymous credentials. |
CloudBlobClient(final StorageUri storageUri, StorageCredentials credentials) |
Creates an instance of the class using the specified Blob service endpoint and account credentials. |
CloudBlobClient(final URI baseUri) |
Creates an instance of the class using the specified Blob service endpoint and anonymous credentials. |
CloudBlobClient(final URI baseUri, StorageCredentials credentials) |
Creates an instance of the class using the specified Blob service endpoint and account credentials. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Account |
downloadAccountInfo()
Gets information related to the storage account. |
Account |
downloadAccountInfo(BlobRequestOptions options, OperationContext opContext)
Gets information related to the storage account. |
Storage |
downloadAccountInformationImpl(final RequestOptions options) |
final Service |
downloadServiceProperties()
Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations. |
final Service |
downloadServiceProperties(BlobRequestOptions options, OperationContext opContext)
Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations. |
<P, T> Map<P, T> |
executeBatch(BlobBatchOperation<P, T> batch)
Executes a pre-constructed batch operation on the blob service. For more information on constructing blob batch requests, see BlobBatchOperation<P,R>. |
<P, T> Map<P, T> |
executeBatch(BlobBatchOperation<P, T> batch, BlobRequestOptions requestOptions, OperationContext operationContext)
Executes a pre-constructed batch operation on the blob service. For more information on constructing blob batch requests, see BlobBatchOperation<P,R>. |
Cloud |
getContainerReference(final String containerName)
Gets a CloudBlobContainer object with the specified name. |
Blob |
getDefaultRequestOptions()
Gets the BlobRequestOptions that is used for requests associated with this |
String |
getDirectoryDelimiter()
Returns the value for the default delimiter used for cloud blob directories. The default is '/'. |
Service |
getServiceStats()
Queries the service for the ServiceStats. |
Service |
getServiceStats(BlobRequestOptions options, OperationContext opContext)
Queries the given storage service for the ServiceStats. |
User |
getUserDelegationKey(Date keyStart, Date keyEnd)
Requests a new user delegation key based on this client's oauth credentials. |
User |
getUserDelegationKey(Date keyStart, Date keyEnd, BlobRequestOptions options, OperationContext opContext)
Requests a new user delegation key based on this client's oauth credentials. |
boolean |
isUsePathStyleUris()
Indicates whether path-style URIs are being used. |
Iterable<Cloud |
listContainers()
Returns an enumerable collection of blob containers for this Blob service client. |
Iterable<Cloud |
listContainers(final String prefix)
Returns an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client. |
Iterable<Cloud |
listContainers(final String prefix, final ContainerListingDetails detailsIncluded, final BlobRequestOptions options, final OperationContext opContext)
Returns an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client, using the specified details setting, request options, and operation context. |
Result |
listContainersSegmented()
Returns a result segment of an enumerable collection of blob containers for this Blob service client. |
Result |
listContainersSegmented(final String prefix)
Returns a result segment of an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client. |
Result |
listContainersSegmented(final String prefix, final ContainerListingDetails detailsIncluded, final Integer maxResults, final ResultContinuation continuationToken, final BlobRequestOptions options, final OperationContext opContext)
Returns a result segment of an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client, using the specified listing details options, request options, and operation context. |
void |
setDefaultRequestOptions(BlobRequestOptions defaultRequestOptions)
Sets the BlobRequestOptions that is used for any requests associated with this object. |
void |
setDirectoryDelimiter(final String directoryDelimiter)
Sets the value for the default delimiter used for cloud blob directories. |
void |
uploadServiceProperties(final ServiceProperties properties)
Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations. |
void |
uploadServiceProperties(final ServiceProperties properties, BlobRequestOptions options, OperationContext opContext)
Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations. |
Inherited Members
Constructor Details
CloudBlobClient
public CloudBlobClient(final StorageUri baseUri)
Creates an instance of the class using the specified Blob service endpoint and anonymous credentials.
Parameters:
CloudBlobClient
public CloudBlobClient(final StorageUri storageUri, StorageCredentials credentials)
Creates an instance of the class using the specified Blob service endpoint and account credentials.
Parameters:
CloudBlobClient
public CloudBlobClient(final URI baseUri)
Creates an instance of the class using the specified Blob service endpoint and anonymous credentials.
Parameters:
java.net.URI
object that represents the Blob service endpoint used to create the client.
CloudBlobClient
public CloudBlobClient(final URI baseUri, StorageCredentials credentials)
Creates an instance of the class using the specified Blob service endpoint and account credentials.
Parameters:
java.net.URI
object that represents the Blob service endpoint used to create the client.
Method Details
downloadAccountInfo
public AccountInformation downloadAccountInfo()
Gets information related to the storage account.
Returns:
Throws:
downloadAccountInfo
public AccountInformation downloadAccountInfo(BlobRequestOptions options, OperationContext opContext)
Gets information related to the storage account.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
downloadAccountInformationImpl
protected StorageRequest
Parameters:
downloadServiceProperties
public final ServiceProperties downloadServiceProperties()
Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.
Returns:
Throws:
downloadServiceProperties
public final ServiceProperties downloadServiceProperties(BlobRequestOptions options, OperationContext opContext)
Retrieves the current ServiceProperties for the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
executeBatch
public
Map
executeBatch(BlobBatchOperation
batch)
Executes a pre-constructed batch operation on the blob service. For more information on constructing blob batch requests, see BlobBatchOperation<P,R>.
Parameters:
Returns:
Throws:
executeBatch
public
Map
executeBatch(BlobBatchOperation
batch, BlobRequestOptions requestOptions, OperationContext operationContext)
Executes a pre-constructed batch operation on the blob service. For more information on constructing blob batch requests, see BlobBatchOperation<P,R>.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
getContainerReference
public CloudBlobContainer getContainerReference(final String containerName)
Gets a CloudBlobContainer object with the specified name.
Parameters:
Returns:
Throws:
getDefaultRequestOptions
public BlobRequestOptions getDefaultRequestOptions()
Gets the BlobRequestOptions that is used for requests associated with this
Returns:
CloudBlobClient
getDirectoryDelimiter
public String getDirectoryDelimiter()
Returns the value for the default delimiter used for cloud blob directories. The default is '/'.
Returns:
String
which represents the value for the default delimiter.getServiceStats
public ServiceStats getServiceStats()
Queries the service for the ServiceStats.
Returns:
Throws:
getServiceStats
public ServiceStats getServiceStats(BlobRequestOptions options, OperationContext opContext)
Queries the given storage service for the ServiceStats.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
getUserDelegationKey
public UserDelegationKey getUserDelegationKey(Date keyStart, Date keyEnd)
Requests a new user delegation key based on this client's oauth credentials.
Parameters:
Returns:
Throws:
getUserDelegationKey
public UserDelegationKey getUserDelegationKey(Date keyStart, Date keyEnd, BlobRequestOptions options, OperationContext opContext)
Requests a new user delegation key based on this client's oauth credentials.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
isUsePathStyleUris
protected boolean isUsePathStyleUris()
Indicates whether path-style URIs are being used.
Returns:
true
if using path-style URIs; otherwise, false
.
listContainers
public Iterable
Returns an enumerable collection of blob containers for this Blob service client.
Returns:
listContainers
public Iterable
Returns an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client.
Parameters:
String
that represents the container name prefix.
Returns:
listContainers
public Iterable
Returns an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client, using the specified details setting, request options, and operation context.
Parameters:
String
that represents the container name prefix.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
listContainersSegmented
public ResultSegment
Returns a result segment of an enumerable collection of blob containers for this Blob service client.
Returns:
Throws:
listContainersSegmented
public ResultSegment
Returns a result segment of an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client.
Parameters:
String
that represents the prefix of the container name.
Returns:
Throws:
listContainersSegmented
public ResultSegment
Returns a result segment of an enumerable collection of blob containers whose names begin with the specified prefix for this Blob service client, using the specified listing details options, request options, and operation context.
Parameters:
String
that represents the prefix of the container name.
null
or greater than 5000, the server will return up to 5,000 items. Must be at least 1.
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
Throws:
setDefaultRequestOptions
public void setDefaultRequestOptions(BlobRequestOptions defaultRequestOptions)
Sets the BlobRequestOptions that is used for any requests associated with this object.
Parameters:
setDirectoryDelimiter
public void setDirectoryDelimiter(final String directoryDelimiter)
Sets the value for the default delimiter used for cloud blob directories.
Parameters:
String
that specifies the value for the default directory delimiter.
uploadServiceProperties
public void uploadServiceProperties(final ServiceProperties properties)
Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.
Parameters:
Throws:
uploadServiceProperties
public void uploadServiceProperties(final ServiceProperties properties, BlobRequestOptions options, OperationContext opContext)
Uploads a new ServiceProperties configuration to the given storage service. This includes Logging, HourMetrics, MinuteMetrics and CORS configurations.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws: