public final class BlobServiceClientBuilder extends Object
BlobServiceClients and BlobServiceAsyncClients, call buildClient and buildAsyncClient respectively to construct an instance of the desired
client.
The following information must be provided on this builder:
.endpoint(), in the format of https://{accountName}.blob.core.windows.net.
.credential() or .connectionString() if the container is not publicly
accessible.
| Constructor and Description |
|---|
BlobServiceClientBuilder()
Creates a builder instance that is able to configure and construct
BlobServiceClients
and BlobServiceAsyncClients. |
| Modifier and Type | Method and Description |
|---|---|
BlobServiceClientBuilder |
addPolicy(com.azure.core.http.policy.HttpPipelinePolicy pipelinePolicy)
Adds a pipeline policy to apply on each request sent.
|
BlobServiceClientBuilder |
blobContainerEncryptionScope(BlobContainerEncryptionScope blobContainerEncryptionScope)
Sets the
encryption scope that is used to determine how blob contents are
encrypted on the server. |
BlobServiceAsyncClient |
buildAsyncClient() |
BlobServiceClient |
buildClient() |
BlobServiceClientBuilder |
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration object used to retrieve environment configuration values during building of the client.
|
BlobServiceClientBuilder |
connectionString(String connectionString)
Sets the connection string to connect to the service.
|
BlobServiceClientBuilder |
credential(StorageSharedKeyCredential credential)
Sets the
StorageSharedKeyCredential used to authorize requests sent to the service. |
BlobServiceClientBuilder |
credential(com.azure.core.credential.TokenCredential credential)
Sets the
TokenCredential used to authorize requests sent to the service. |
BlobServiceClientBuilder |
customerProvidedKey(CustomerProvidedKey customerProvidedKey)
Sets the
customer provided key that is used to encrypt blob contents on the server. |
BlobServiceClientBuilder |
encryptionScope(String encryptionScope)
Sets the
encryption scope that is used to encrypt blob contents on the server. |
BlobServiceClientBuilder |
endpoint(String endpoint)
Sets the blob service endpoint, additionally parses it for information (SAS token)
|
static com.azure.core.http.policy.HttpLogOptions |
getDefaultHttpLogOptions()
Gets the default Storage whitelist log headers and query parameters.
|
BlobServiceClientBuilder |
httpClient(com.azure.core.http.HttpClient httpClient)
Sets the
HttpClient to use for sending a receiving requests to and from the service. |
BlobServiceClientBuilder |
httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets the
HttpLogOptions for service requests. |
BlobServiceClientBuilder |
pipeline(com.azure.core.http.HttpPipeline httpPipeline)
Sets the
HttpPipeline to use for the service client. |
BlobServiceClientBuilder |
retryOptions(RequestRetryOptions retryOptions)
Sets the request retry options for all the requests made through the client.
|
BlobServiceClientBuilder |
sasToken(String sasToken)
Sets the SAS token used to authorize requests sent to the service.
|
BlobServiceClientBuilder |
serviceVersion(BlobServiceVersion version)
Sets the
BlobServiceVersion that is used when making API requests. |
public BlobServiceClientBuilder()
BlobServiceClients
and BlobServiceAsyncClients.public BlobServiceClient buildClient()
BlobServiceClient created from the configurations in this builder.public BlobServiceAsyncClient buildAsyncClient()
BlobServiceAsyncClient created from the configurations in this builder.IllegalArgumentException - If no credentials are provided.public BlobServiceClientBuilder endpoint(String endpoint)
endpoint - URL of the serviceIllegalArgumentException - If endpoint is null or is a malformed URL.public BlobServiceClientBuilder customerProvidedKey(CustomerProvidedKey customerProvidedKey)
customer provided key that is used to encrypt blob contents on the server.customerProvidedKey - Customer provided key containing the encryption key information.public BlobServiceClientBuilder encryptionScope(String encryptionScope)
encryption scope that is used to encrypt blob contents on the server.encryptionScope - Encryption scope containing the encryption key information.public BlobServiceClientBuilder blobContainerEncryptionScope(BlobContainerEncryptionScope blobContainerEncryptionScope)
encryption scope that is used to determine how blob contents are
encrypted on the server.blobContainerEncryptionScope - Encryption scope containing the encryption key information.public BlobServiceClientBuilder credential(StorageSharedKeyCredential credential)
StorageSharedKeyCredential used to authorize requests sent to the service.credential - StorageSharedKeyCredential.NullPointerException - If credential is null.public BlobServiceClientBuilder credential(com.azure.core.credential.TokenCredential credential)
TokenCredential used to authorize requests sent to the service.credential - TokenCredential.NullPointerException - If credential is null.public BlobServiceClientBuilder sasToken(String sasToken)
sasToken - The SAS token to use for authenticating requests.NullPointerException - If sasToken is null.public BlobServiceClientBuilder connectionString(String connectionString)
connectionString - Connection string of the storage account.IllegalArgumentException - If connectionString in invalid.NullPointerException - If connectionString is null.public BlobServiceClientBuilder httpClient(com.azure.core.http.HttpClient httpClient)
HttpClient to use for sending a receiving requests to and from the service.httpClient - HttpClient to use for requests.public BlobServiceClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy pipelinePolicy)
pipelinePolicy - a pipeline policyNullPointerException - If pipelinePolicy is null.public BlobServiceClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
HttpLogOptions for service requests.logOptions - The logging configuration to use when sending and receiving HTTP requests/responses.NullPointerException - If logOptions is null.public static com.azure.core.http.policy.HttpLogOptions getDefaultHttpLogOptions()
public BlobServiceClientBuilder configuration(com.azure.core.util.Configuration configuration)
configuration - Configuration store used to retrieve environment configurations.public BlobServiceClientBuilder retryOptions(RequestRetryOptions retryOptions)
retryOptions - RequestRetryOptions.NullPointerException - If retryOptions is null.public BlobServiceClientBuilder pipeline(com.azure.core.http.HttpPipeline httpPipeline)
HttpPipeline to use for the service client.
If pipeline is set, all other settings are ignored, aside from endpoint.httpPipeline - HttpPipeline to use for sending service requests and receiving responses.public BlobServiceClientBuilder serviceVersion(BlobServiceVersion version)
BlobServiceVersion that is used when making API requests.
If a service version is not provided, the service version that will be used will be the latest known service version based on the version of the client library being used. If no service version is specified, updating to a newer version of the client library will have the result of potentially moving to a newer service version.
Targeting a specific service version may also mean that the service will return an error for newer APIs.
version - BlobServiceVersion of the service to be used when making requests.Copyright © 2020 Microsoft Corporation. All rights reserved.