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(HttpPipelinePolicy pipelinePolicy)
Adds a pipeline policy to apply on each request sent.
|
BlobServiceAsyncClient |
buildAsyncClient() |
BlobServiceClient |
buildClient() |
BlobServiceClientBuilder |
configuration(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(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 |
endpoint(String endpoint)
Sets the blob service endpoint, additionally parses it for information (SAS token)
|
static HttpLogOptions |
getDefaultHttpLogOptions()
Gets the default Storage whitelist log headers and query parameters.
|
BlobServiceClientBuilder |
httpClient(HttpClient httpClient)
Sets the
HttpClient to use for sending a receiving requests to and from the service. |
BlobServiceClientBuilder |
httpLogOptions(HttpLogOptions logOptions)
Sets the
HttpLogOptions for service requests. |
BlobServiceClientBuilder |
pipeline(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.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 credential(StorageSharedKeyCredential credential)
StorageSharedKeyCredential
used to authorize requests sent to the service.credential
- The credential to use for authenticating request.NullPointerException
- If credential
is null
.public BlobServiceClientBuilder credential(TokenCredential credential)
TokenCredential
used to authorize requests sent to the service.credential
- The credential to use for authenticating request.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(HttpClient httpClient)
HttpClient
to use for sending a receiving requests to and from the service.httpClient
- HttpClient to use for requests.public BlobServiceClientBuilder addPolicy(HttpPipelinePolicy pipelinePolicy)
pipelinePolicy
- a pipeline policyNullPointerException
- If pipelinePolicy
is null
.public BlobServiceClientBuilder httpLogOptions(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 HttpLogOptions getDefaultHttpLogOptions()
public BlobServiceClientBuilder configuration(Configuration configuration)
configuration
- Configuration store used to retrieve environment configurations.public BlobServiceClientBuilder retryOptions(RequestRetryOptions retryOptions)
retryOptions
- The options used to configure retry behavior.NullPointerException
- If retryOptions
is null
.public BlobServiceClientBuilder pipeline(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 the client library will have the result of potentially moving to a newer service version.
version
- BlobServiceVersion
of the service to be used when making requests.Copyright © 2019 Microsoft Corporation. All rights reserved.