### YamlMime:JavaType uid: "com.azure.storage.file.share.ShareClientBuilder" fullName: "com.azure.storage.file.share.ShareClientBuilder" name: "ShareClientBuilder" nameWithType: "ShareClientBuilder" summary: "This class provides a fluent builder API to help aid the configuration and instantiation of the and , calling constructs an instance of ShareClient and calling constructs an instance of ShareAsyncClient." inheritances: - "" inheritedClassMethods: - classRef: "java.lang.Object" methodsRef: - "clone" - "equals" - "finalize" - "getClass" - "hashCode" - "notify" - "notifyAll" - "toString" - "wait" - "wait" - "wait" syntax: "public class **ShareClientBuilder**
implements <>, <>, <>, <>, <>, <>" constructors: - uid: "com.azure.storage.file.share.ShareClientBuilder.ShareClientBuilder()" fullName: "com.azure.storage.file.share.ShareClientBuilder.ShareClientBuilder()" name: "ShareClientBuilder()" nameWithType: "ShareClientBuilder.ShareClientBuilder()" summary: "Creates a builder instance that is able to configure and construct and ." syntax: "public ShareClientBuilder()" desc: "Creates a builder instance that is able to configure and construct and ." methods: - uid: "com.azure.storage.file.share.ShareClientBuilder.addPolicy(com.azure.core.http.policy.HttpPipelinePolicy)" fullName: "com.azure.storage.file.share.ShareClientBuilder.addPolicy(HttpPipelinePolicy pipelinePolicy)" name: "addPolicy(HttpPipelinePolicy pipelinePolicy)" nameWithType: "ShareClientBuilder.addPolicy(HttpPipelinePolicy pipelinePolicy)" summary: "Adds a to apply on each request sent." parameters: - description: "A ." name: "pipelinePolicy" type: "" syntax: "public ShareClientBuilder addPolicy(HttpPipelinePolicy pipelinePolicy)" desc: "Adds a to apply on each request sent.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.buildAsyncClient()" fullName: "com.azure.storage.file.share.ShareClientBuilder.buildAsyncClient()" name: "buildAsyncClient()" nameWithType: "ShareClientBuilder.buildAsyncClient()" summary: "Creates a based on options set in the builder." syntax: "public ShareAsyncClient buildAsyncClient()" desc: "Creates a based on options set in the builder. Every time `buildAsyncClient()` is called a new instance of is created.\n\nIf is set, then the `pipeline` and are used to create the . All other builder settings are ignored." returns: description: "A ShareAsyncClient with the options set from the builder." type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.buildClient()" fullName: "com.azure.storage.file.share.ShareClientBuilder.buildClient()" name: "buildClient()" nameWithType: "ShareClientBuilder.buildClient()" summary: "Creates a based on options set in the builder." syntax: "public ShareClient buildClient()" desc: "Creates a based on options set in the builder. Every time `buildClient()` is called a new instance of is created.\n\nIf is set, then the `pipeline` and are used to create the . All other builder settings are ignored." returns: description: "A ShareClient with the options set from the builder." type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.clientOptions(com.azure.core.util.ClientOptions)" fullName: "com.azure.storage.file.share.ShareClientBuilder.clientOptions(ClientOptions clientOptions)" name: "clientOptions(ClientOptions clientOptions)" nameWithType: "ShareClientBuilder.clientOptions(ClientOptions clientOptions)" summary: "Allows for setting common properties such as application ID, headers, proxy configuration, etc." parameters: - description: "A configured instance of ." name: "clientOptions" type: "" syntax: "public ShareClientBuilder clientOptions(ClientOptions clientOptions)" desc: "Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is recommended that this method be called with an instance of the class (a subclass of the base class). The HttpClientOptions subclass provides more configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait interface.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.configuration(com.azure.core.util.Configuration)" fullName: "com.azure.storage.file.share.ShareClientBuilder.configuration(Configuration configuration)" name: "configuration(Configuration configuration)" nameWithType: "ShareClientBuilder.configuration(Configuration configuration)" summary: "Sets the configuration object used to retrieve environment configuration values during building of the client." parameters: - description: "Configuration store used to retrieve environment configurations." name: "configuration" type: "" syntax: "public ShareClientBuilder configuration(Configuration configuration)" desc: "Sets the configuration object used to retrieve environment configuration values during building of the client." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.connectionString(java.lang.String)" fullName: "com.azure.storage.file.share.ShareClientBuilder.connectionString(String connectionString)" name: "connectionString(String connectionString)" nameWithType: "ShareClientBuilder.connectionString(String connectionString)" summary: "Sets the connection string to connect to the service." parameters: - description: "Connection string of the storage account." name: "connectionString" type: "String" syntax: "public ShareClientBuilder connectionString(String connectionString)" desc: "Sets the connection string to connect to the service." returns: description: "the updated ShareClientBuilder" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.credential(com.azure.core.credential.AzureNamedKeyCredential)" fullName: "com.azure.storage.file.share.ShareClientBuilder.credential(AzureNamedKeyCredential credential)" name: "credential(AzureNamedKeyCredential credential)" nameWithType: "ShareClientBuilder.credential(AzureNamedKeyCredential credential)" summary: "Sets the used to authorize requests sent to the service." parameters: - description: "." name: "credential" type: "" syntax: "public ShareClientBuilder credential(AzureNamedKeyCredential credential)" desc: "Sets the used to authorize requests sent to the service." returns: description: "the updated ShareClientBuilder" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.credential(com.azure.core.credential.AzureSasCredential)" fullName: "com.azure.storage.file.share.ShareClientBuilder.credential(AzureSasCredential credential)" name: "credential(AzureSasCredential credential)" nameWithType: "ShareClientBuilder.credential(AzureSasCredential credential)" summary: "Sets the used to authorize requests sent to the service." parameters: - description: " used to authorize requests sent to the service." name: "credential" type: "" syntax: "public ShareClientBuilder credential(AzureSasCredential credential)" desc: "Sets the used to authorize requests sent to the service." returns: description: "the updated ShareClientBuilder" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.credential(com.azure.storage.common.StorageSharedKeyCredential)" fullName: "com.azure.storage.file.share.ShareClientBuilder.credential(StorageSharedKeyCredential credential)" name: "credential(StorageSharedKeyCredential credential)" nameWithType: "ShareClientBuilder.credential(StorageSharedKeyCredential credential)" summary: "Sets the used to authorize requests sent to the service." parameters: - description: "." name: "credential" type: "" syntax: "public ShareClientBuilder credential(StorageSharedKeyCredential credential)" desc: "Sets the used to authorize requests sent to the service." returns: description: "the updated ShareClientBuilder" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.endpoint(java.lang.String)" fullName: "com.azure.storage.file.share.ShareClientBuilder.endpoint(String endpoint)" name: "endpoint(String endpoint)" nameWithType: "ShareClientBuilder.endpoint(String endpoint)" summary: "Sets the endpoint for the Azure Storage File instance that the client will interact with." parameters: - description: "The URL of the Azure Storage File instance to send service requests to and receive responses\n from." name: "endpoint" type: "String" syntax: "public ShareClientBuilder endpoint(String endpoint)" desc: "Sets the endpoint for the Azure Storage File instance that the client will interact with.\n\nThe first path segment, if the endpoint contains path segments, will be assumed to be the name of the share that the client will interact with.\n\nQuery parameters of the endpoint will be parsed in an attempt to generate a SAS token to authenticate requests sent to the service." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.getDefaultHttpLogOptions()" fullName: "com.azure.storage.file.share.ShareClientBuilder.getDefaultHttpLogOptions()" name: "getDefaultHttpLogOptions()" nameWithType: "ShareClientBuilder.getDefaultHttpLogOptions()" summary: "Gets the default log options with Storage headers and query parameters." modifiers: - "static" syntax: "public static HttpLogOptions getDefaultHttpLogOptions()" desc: "Gets the default log options with Storage headers and query parameters." returns: description: "the default log options." type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.httpClient(com.azure.core.http.HttpClient)" fullName: "com.azure.storage.file.share.ShareClientBuilder.httpClient(HttpClient httpClient)" name: "httpClient(HttpClient httpClient)" nameWithType: "ShareClientBuilder.httpClient(HttpClient httpClient)" summary: "Sets the to use for sending and receiving requests to and from the service." parameters: - description: "The to use for requests." name: "httpClient" type: "" syntax: "public ShareClientBuilder httpClient(HttpClient httpClient)" desc: "Sets the to use for sending and receiving requests to and from the service.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.httpLogOptions(com.azure.core.http.policy.HttpLogOptions)" fullName: "com.azure.storage.file.share.ShareClientBuilder.httpLogOptions(HttpLogOptions logOptions)" name: "httpLogOptions(HttpLogOptions logOptions)" nameWithType: "ShareClientBuilder.httpLogOptions(HttpLogOptions logOptions)" summary: "Sets the to use when sending and receiving requests to and from the service." parameters: - description: "The to use when sending and receiving requests to\n and from the service." name: "logOptions" type: "" syntax: "public ShareClientBuilder httpLogOptions(HttpLogOptions logOptions)" desc: "Sets the to use when sending and receiving requests to and from the service. If a `logLevel` is not provided, default value of is set.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.pipeline(com.azure.core.http.HttpPipeline)" fullName: "com.azure.storage.file.share.ShareClientBuilder.pipeline(HttpPipeline httpPipeline)" name: "pipeline(HttpPipeline httpPipeline)" nameWithType: "ShareClientBuilder.pipeline(HttpPipeline httpPipeline)" summary: "Sets the to use for the service client." parameters: - description: " to use for sending service requests and receiving responses." name: "httpPipeline" type: "" syntax: "public ShareClientBuilder pipeline(HttpPipeline httpPipeline)" desc: "Sets the to use for the service client.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.\n\nThe is not ignored when `pipeline` is set." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.retryOptions(com.azure.core.http.policy.RetryOptions)" fullName: "com.azure.storage.file.share.ShareClientBuilder.retryOptions(RetryOptions retryOptions)" name: "retryOptions(RetryOptions retryOptions)" nameWithType: "ShareClientBuilder.retryOptions(RetryOptions retryOptions)" summary: "Sets the for all the requests made through the client." parameters: - description: "The to use for all the requests made through the client." name: "retryOptions" type: "" syntax: "public ShareClientBuilder retryOptions(RetryOptions retryOptions)" desc: "Sets the for all the requests made through the client.\n\n**Note:** It is important to understand the precedence order of the HttpTrait APIs. In particular, if a is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If no is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if an is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.\n\nSetting this is mutually exclusive with using . Consider using to also set storage specific options." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.retryOptions(com.azure.storage.common.policy.RequestRetryOptions)" fullName: "com.azure.storage.file.share.ShareClientBuilder.retryOptions(RequestRetryOptions retryOptions)" name: "retryOptions(RequestRetryOptions retryOptions)" nameWithType: "ShareClientBuilder.retryOptions(RequestRetryOptions retryOptions)" summary: "Sets the request retry options for all the requests made through the client." parameters: - description: "." name: "retryOptions" type: "" syntax: "public ShareClientBuilder retryOptions(RequestRetryOptions retryOptions)" desc: "Sets the request retry options for all the requests made through the client. Setting this is mutually exclusive with using ." returns: description: "the updated ShareClientBuilder object." type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.sasToken(java.lang.String)" fullName: "com.azure.storage.file.share.ShareClientBuilder.sasToken(String sasToken)" name: "sasToken(String sasToken)" nameWithType: "ShareClientBuilder.sasToken(String sasToken)" summary: "Sets the SAS token used to authorize requests sent to the service." parameters: - description: "The SAS token to use for authenticating requests. This string should only be the query parameters\n (with or without a leading '?') and not a full url." name: "sasToken" type: "String" syntax: "public ShareClientBuilder sasToken(String sasToken)" desc: "Sets the SAS token used to authorize requests sent to the service." returns: description: "the updated ShareClientBuilder" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.serviceVersion(com.azure.storage.file.share.ShareServiceVersion)" fullName: "com.azure.storage.file.share.ShareClientBuilder.serviceVersion(ShareServiceVersion version)" name: "serviceVersion(ShareServiceVersion version)" nameWithType: "ShareClientBuilder.serviceVersion(ShareServiceVersion version)" summary: "Sets the that is used when making API requests." parameters: - description: " of the service to be used when making requests." name: "version" type: "" syntax: "public ShareClientBuilder serviceVersion(ShareServiceVersion version)" desc: "Sets the that is used when making API requests.\n\nIf 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.\n\nTargeting a specific service version may also mean that the service will return an error for newer APIs." returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.shareName(java.lang.String)" fullName: "com.azure.storage.file.share.ShareClientBuilder.shareName(String shareName)" name: "shareName(String shareName)" nameWithType: "ShareClientBuilder.shareName(String shareName)" summary: "Sets the share that the constructed clients will interact with" parameters: - description: "Name of the share" name: "shareName" type: "String" syntax: "public ShareClientBuilder shareName(String shareName)" desc: "Sets the share that the constructed clients will interact with" returns: description: "the updated ShareClientBuilder object" type: "" - uid: "com.azure.storage.file.share.ShareClientBuilder.snapshot(java.lang.String)" fullName: "com.azure.storage.file.share.ShareClientBuilder.snapshot(String snapshot)" name: "snapshot(String snapshot)" nameWithType: "ShareClientBuilder.snapshot(String snapshot)" summary: "Sets the snapshot that the constructed clients will interact with." parameters: - description: "Identifier of the snapshot" name: "snapshot" type: "String" syntax: "public ShareClientBuilder snapshot(String snapshot)" desc: "Sets the snapshot that the constructed clients will interact with. This snapshot must be linked to the share that has been specified in the builder." returns: description: "the updated ShareClientBuilder object" type: "" type: "class" desc: "This class provides a fluent builder API to help aid the configuration and instantiation of the and , calling constructs an instance of ShareClient and calling constructs an instance of ShareAsyncClient.\n\nThe client needs the endpoint of the Azure Storage File service, name of the share, and authorization credential. gives the builder the endpoint and may give the builder the and a that authorizes the client.\n\n**Instantiating a synchronous Share Client with SAS token**\n\n```java\nShareClient shareClient = new ShareClientBuilder()\n .endpoint(\"https://${accountName}.file.core.windows.net?${SASToken}\")\n .shareName(\"myshare\")\n .buildClient();\n```\n\n**Instantiating an Asynchronous Share Client with SAS token**\n\n```java\nShareAsyncClient shareAsyncClient = new ShareClientBuilder()\n .endpoint(\"https://{accountName}.file.core.windows.net?{SASToken}\")\n .shareName(\"myshare\")\n .buildAsyncClient();\n```\n\nIf the `endpoint` doesn't contain the query parameters to construct a SAS token it may be set using .\n\n```java\nShareClient shareClient = new ShareClientBuilder()\n .endpoint(\"https://${accountName}.file.core.windows.net\")\n .sasToken(\"${SASTokenQueryParams}\")\n .shareName(\"myshare\")\n .buildClient();\n```\n\n```java\nShareAsyncClient shareAsyncClient = new ShareClientBuilder()\n .endpoint(\"https://{accountName}.file.core.windows.net\")\n .sasToken(\"${SASTokenQueryParams}\")\n .shareName(\"myshare\")\n .buildAsyncClient();\n```\n\nAnother way to authenticate the client is using a . To create a StorageSharedKeyCredential a connection string from the Storage File service must be used. Set the StorageSharedKeyCredential with . If the builder has both a SAS token and StorageSharedKeyCredential the StorageSharedKeyCredential will be preferred when authorizing requests sent to the service.\n\n**Instantiating a synchronous Share Client with connection string.**\n\n```java\nString connectionString = \"DefaultEndpointsProtocol=https;AccountName={name};AccountKey={key};\"\n + \"EndpointSuffix={core.windows.net}\";\n ShareClient shareClient = new ShareClientBuilder()\n .connectionString(connectionString).shareName(\"myshare\")\n .buildClient();\n```\n\n**Instantiating an Asynchronous Share Client with connection string.**\n\n```java\nString connectionString = \"DefaultEndpointsProtocol=https;AccountName={name};AccountKey={key};\"\n + \"EndpointSuffix={core.windows.net}\";\n ShareAsyncClient shareAsyncClient = new ShareClientBuilder()\n .connectionString(connectionString).shareName(\"myshare\")\n .buildAsyncClient();\n```" implements: - "<>" - "<>" - "<>" - "<>" - "<>" - "<>" metadata: {} package: "com.azure.storage.file.share" artifact: com.azure:azure-storage-file-share:12.17.1