EncryptedBlobClientBuilder Class

Definition

This class provides a fluent builder API to help aid the configuration and instantiation of Storage Blob clients.

The following information must be provided on this builder:

Once all the configurations are set on this builder use the following mapping to construct the given client:

public final class EncryptedBlobClientBuilder
Inheritance
java.lang.Object
EncryptedBlobClientBuilder

Inherited Members

java.lang.Object.clone() java.lang.Object.equals(java.lang.Object) java.lang.Object.finalize() java.lang.Object.getClass() java.lang.Object.hashCode() java.lang.Object.notify() java.lang.Object.notifyAll() java.lang.Object.toString() java.lang.Object.wait() java.lang.Object.wait(long) java.lang.Object.wait(long,int)

Constructors

EncryptedBlobClientBuilder()

Creates a new instance of the EncryptedBlobClientBuilder

Methods

addPolicy(HttpPipelinePolicy pipelinePolicy)

Adds a HttpPipelinePolicy to apply on each request sent. The policy will be added after the retry policy. If the method is called multiple times, all policies will be added and their order preserved.

blobAsyncClient(BlobAsyncClient blobAsyncClient)

Configures the builder based on the passed BlobAsyncClient. This will set the HttpPipeline, URL and BlobServiceVersion that are used to interact with the service. Note that the underlying pipeline should not already be configured for encryption/decryption.

If pipeline is set, all other settings are ignored, aside from endpoint(String endpoint) and serviceVersion(BlobServiceVersion version).

Note that for security reasons, this method does not copy over the CustomerProvidedKey and encryption scope properties from the provided client. To set CPK, please use customerProvidedKey(CustomerProvidedKey customerProvidedKey).

blobClient(BlobClient blobClient)

Configures the builder based on the passed BlobClient. This will set the HttpPipeline, URL and BlobServiceVersion that are used to interact with the service. Note that the underlying pipeline should not already be configured for encryption/decryption.

If pipeline is set, all other settings are ignored, aside from endpoint(String endpoint) and serviceVersion(BlobServiceVersion version).

Note that for security reasons, this method does not copy over the CustomerProvidedKey and encryption scope properties from the provided client. To set CPK, please use customerProvidedKey(CustomerProvidedKey customerProvidedKey).

blobName(String blobName)

Sets the name of the blob.

buildEncryptedBlobAsyncClient()

Creates a EncryptedBlobAsyncClient based on options set in the Builder.

Code Samples

EncryptedBlobClient client = new EncryptedBlobClientBuilder()
     .key(key, keyWrapAlgorithm)
     .keyResolver(keyResolver)
     .connectionString(connectionString)
     .buildEncryptedBlobClient();
buildEncryptedBlobClient()

Creates a EncryptedBlobClient based on options set in the Builder.

Code Samples

EncryptedBlobAsyncClient client = new EncryptedBlobClientBuilder()
     .key(key, keyWrapAlgorithm)
     .keyResolver(keyResolver)
     .connectionString(connectionString)
     .buildEncryptedBlobAsyncClient();
clientOptions(ClientOptions clientOptions)

Sets the client options for all the requests made through the client.

configuration(Configuration configuration)

Sets the configuration object used to retrieve environment configuration values during building of the client.

connectionString(String connectionString)

Sets the connection string to connect to the service.

containerName(String containerName)

Sets the name of the container that contains the blob.

credential(AzureSasCredential credential)

Sets the AzureSasCredential used to authorize requests sent to the service.

credential(TokenCredential credential)

Sets the TokenCredential used to authorize requests sent to the service.

credential(StorageSharedKeyCredential credential)

Sets the StorageSharedKeyCredential used to authorize requests sent to the service.

customerProvidedKey(CustomerProvidedKey customerProvidedKey)

Sets the CustomerProvidedKey that is used to encrypt blob contents on the server.

endpoint(String endpoint)

Sets the service endpoint, additionally parses it for information (SAS token, container name, blob name)

If the blob name contains special characters, pass in the url encoded version of the blob name.

If the endpoint is to a blob in the root container, this method will fail as it will interpret the blob name as the container name. With only one path element, it is impossible to distinguish between a container name and a blob in the root container, so it is assumed to be the container name as this is much more common. When working with blobs in the root container, it is best to set the endpoint to the account url and specify the blob name separately using the blobName(String blobName) method.

getDefaultHttpLogOptions()

Gets the default Storage whitelist log headers and query parameters.

httpClient(HttpClient httpClient)

Sets the HttpClient to use for sending a receiving requests to and from the service.

httpLogOptions(HttpLogOptions logOptions)

Sets the HttpLogOptions for service requests.

key(AsyncKeyEncryptionKey key, String keyWrapAlgorithm)

Sets the encryption key parameters for the client

keyResolver(AsyncKeyEncryptionKeyResolver keyResolver)

Sets the encryption parameters for this client

pipeline(HttpPipeline httpPipeline)

Sets the HttpPipeline to use for the service client, and adds a decryption policy if one is not present. Note that the underlying pipeline should not already be configured for encryption/decryption.

If pipeline is set, all other settings are ignored, aside from endpoint(String endpoint) and customerProvidedKey(CustomerProvidedKey customerProvidedKey).

requiresEncryption(boolean requiresEncryption)

Sets the requires encryption option.

retryOptions(RequestRetryOptions retryOptions)

Sets the request retry options for all the requests made through the client.

sasToken(String sasToken)

Sets the SAS token used to authorize requests sent to the service.

serviceVersion(BlobServiceVersion version)

Sets the 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.

setAnonymousAccess()

Clears the credential used to authorize the request.

This is for blobs that are publicly accessible.

snapshot(String snapshot)

Sets the snapshot identifier of the blob.

versionId(String versionId)

Sets the version identifier of the blob.

Applies to