public final class DataLakePathClientBuilder extends Object
FileClients
, FileAsyncClients
, DirectoryClients
and
DirectoryAsyncClients
, call buildFileClient
,
buildFileAsyncClient
, buildDirectoryClient
and buildDirectoryAsyncClient
respectively to construct an instance of the desired client.
The following information must be provided on this builder:
.endpoint()
, including the file system name and file/directory name, in the format
of https://{accountName}.dfs.core.windows.net/{fileSystemName}/{pathName}
.
.credential()
or .connectionString()
if the file system is not publicly
accessible.
Constructor and Description |
---|
DataLakePathClientBuilder()
Creates a builder instance that is able to configure and construct
FileClients , FileAsyncClients , DirectoryClients and
DirectoryAsyncClients . |
Modifier and Type | Method and Description |
---|---|
DataLakePathClientBuilder |
addPolicy(com.azure.core.http.policy.HttpPipelinePolicy pipelinePolicy)
Adds a pipeline policy to apply on each request sent.
|
DataLakeDirectoryAsyncClient |
buildDirectoryAsyncClient()
Creates a
DataLakeDirectoryAsyncClient based on options set in the builder. |
DataLakeDirectoryClient |
buildDirectoryClient()
Creates a
DataLakeDirectoryClient based on options set in the builder. |
DataLakeFileAsyncClient |
buildFileAsyncClient()
Creates a
DataLakeFileAsyncClient based on options set in the builder. |
DataLakeFileClient |
buildFileClient()
Creates a
DataLakeFileClient based on options set in the builder. |
DataLakePathClientBuilder |
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration object used to retrieve environment configuration values during building of the client.
|
DataLakePathClientBuilder |
credential(com.azure.storage.common.StorageSharedKeyCredential credential)
Sets the
StorageSharedKeyCredential used to authorize requests sent to the service. |
DataLakePathClientBuilder |
credential(com.azure.core.credential.TokenCredential credential)
Sets the
TokenCredential used to authorize requests sent to the service. |
DataLakePathClientBuilder |
endpoint(String endpoint)
Sets the service endpoint, additionally parses it for information (SAS token, file system name, path name)
|
DataLakePathClientBuilder |
fileSystemName(String fileSystemName)
Sets the name of the file system that contains the path.
|
static com.azure.core.http.policy.HttpLogOptions |
getDefaultHttpLogOptions()
Gets the default Storage whitelist log headers and query parameters.
|
DataLakePathClientBuilder |
httpClient(com.azure.core.http.HttpClient httpClient)
Sets the
HttpClient to use for sending a receiving requests to and from the service. |
DataLakePathClientBuilder |
httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets the
HttpLogOptions for service requests. |
DataLakePathClientBuilder |
pathName(String pathName)
Sets the name of the file/directory.
|
DataLakePathClientBuilder |
pipeline(com.azure.core.http.HttpPipeline httpPipeline)
Sets the
HttpPipeline to use for the service client. |
DataLakePathClientBuilder |
retryOptions(com.azure.storage.common.policy.RequestRetryOptions retryOptions)
Sets the request retry options for all the requests made through the client.
|
DataLakePathClientBuilder |
sasToken(String sasToken)
Sets the SAS token used to authorize requests sent to the service.
|
DataLakePathClientBuilder |
serviceVersion(DataLakeServiceVersion version)
Sets the
DataLakeServiceVersion that is used when making API requests. |
DataLakePathClientBuilder |
setAnonymousAccess()
Clears the credential used to authorize the request.
|
public DataLakePathClientBuilder()
FileClients
, FileAsyncClients
, DirectoryClients
and
DirectoryAsyncClients
.public DataLakeFileClient buildFileClient()
DataLakeFileClient
based on options set in the builder.
Code Samples
DataLakeFileClient client = new DataLakePathClientBuilder() .endpoint(endpoint) .credential(storageSharedKeyCredential) .buildFileClient();
DataLakeFileClient
created from the configurations in this builder.NullPointerException
- If endpoint
or pathName
is null
.public DataLakeFileAsyncClient buildFileAsyncClient()
DataLakeFileAsyncClient
based on options set in the builder.
Code Samples
DataLakeFileAsyncClient client = new DataLakePathClientBuilder() .endpoint(endpoint) .credential(storageSharedKeyCredential) .buildFileAsyncClient();
DataLakeFileAsyncClient
created from the configurations in this builder.NullPointerException
- If endpoint
or pathName
is null
.public DataLakeDirectoryClient buildDirectoryClient()
DataLakeDirectoryClient
based on options set in the builder.
Code Samples
DataLakeDirectoryClient client = new DataLakePathClientBuilder() .endpoint(endpoint) .credential(storageSharedKeyCredential) .buildDirectoryClient();
DataLakeDirectoryClient
created from the configurations in this builder.NullPointerException
- If endpoint
or pathName
is null
.public DataLakeDirectoryAsyncClient buildDirectoryAsyncClient()
DataLakeDirectoryAsyncClient
based on options set in the builder.
Code Samples
DataLakeDirectoryAsyncClient client = new DataLakePathClientBuilder() .endpoint(endpoint) .credential(storageSharedKeyCredential) .buildDirectoryAsyncClient();
DataLakeDirectoryAsyncClient
created from the configurations in this builder.NullPointerException
- If endpoint
or pathName
is null
.public DataLakePathClientBuilder credential(com.azure.storage.common.StorageSharedKeyCredential credential)
StorageSharedKeyCredential
used to authorize requests sent to the service.credential
- StorageSharedKeyCredential
.NullPointerException
- If credential
is null
.public DataLakePathClientBuilder credential(com.azure.core.credential.TokenCredential credential)
TokenCredential
used to authorize requests sent to the service.credential
- TokenCredential
.NullPointerException
- If credential
is null
.public DataLakePathClientBuilder sasToken(String sasToken)
sasToken
- The SAS token to use for authenticating requests.NullPointerException
- If sasToken
is null
.public DataLakePathClientBuilder setAnonymousAccess()
This is for paths that are publicly accessible.
public DataLakePathClientBuilder endpoint(String endpoint)
If the endpoint is to a file/directory in the root container, this method will fail as it will interpret the
path name as the file system name. With only one path element, it is impossible to distinguish between a file
system name and a path in the root file system, so it is assumed to be the file system name as this is much more
common. When working with paths in the root file system, it is best to set the endpoint to the account url and
specify the path name separately using the pathName
method.
endpoint
- URL of the serviceIllegalArgumentException
- If endpoint
is null
or is a malformed URL.public DataLakePathClientBuilder fileSystemName(String fileSystemName)
fileSystemName
- Name of the file system. If the value null
or empty the root file system,
$root
, will be used.public DataLakePathClientBuilder pathName(String pathName)
pathName
- Name of the path.NullPointerException
- If pathName
is null
public DataLakePathClientBuilder 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 DataLakePathClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy pipelinePolicy)
pipelinePolicy
- a pipeline policyNullPointerException
- If pipelinePolicy
is null
.public static com.azure.core.http.policy.HttpLogOptions getDefaultHttpLogOptions()
public DataLakePathClientBuilder 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 DataLakePathClientBuilder configuration(com.azure.core.util.Configuration configuration)
configuration
- Configuration store used to retrieve environment configurations.public DataLakePathClientBuilder retryOptions(com.azure.storage.common.policy.RequestRetryOptions retryOptions)
retryOptions
- RequestRetryOptions
.NullPointerException
- If retryOptions
is null
.public DataLakePathClientBuilder 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 DataLakePathClientBuilder serviceVersion(DataLakeServiceVersion version)
DataLakeServiceVersion
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
- DataLakeServiceVersion
of the service to be used when making requests.Copyright © 2020 Microsoft Corporation. All rights reserved.