Class ShareLeaseClientBuilder
java.lang.Object
com.azure.storage.file.share.specialized.ShareLeaseClientBuilder
This class provides a fluent builder API to help aid the configuration and instantiation of Storage Lease
clients. Lease clients are able to interact with both share and share file clients and act as a supplement client. A
new instance of
ShareLeaseClient and ShareLeaseAsyncClient are constructed every time
buildClient and buildAsyncClient are called
respectively.
When a client is instantiated and a leaseId hasn't been set a UUID will be used
as the lease identifier.
Instantiating LeaseClients
ShareLeaseClient fileLeaseClient = new ShareLeaseClientBuilder()
.fileClient(shareFileClient)
.leaseId(leaseId)
.buildClient();
ShareLeaseClient fileLeaseClient = new ShareLeaseClientBuilder()
.shareClient(shareClient)
.leaseId(leaseId)
.buildClient();
Instantiating LeaseAsyncClients
ShareLeaseAsyncClient fileLeaseAsyncClient = new ShareLeaseClientBuilder()
.fileAsyncClient(shareFileAsyncClient)
.leaseId(leaseId)
.buildAsyncClient();
ShareLeaseAsyncClient fileLeaseAsyncClient = new ShareLeaseClientBuilder()
.shareAsyncClient(shareAsyncClient)
.leaseId(leaseId)
.buildAsyncClient();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowSourceTrailingDot(boolean allowSourceTrailingDot) Set the trailing dot property to specify whether trailing dot will be trimmed or not from the source URI.allowTrailingDot(boolean allowTrailingDot) Set the trailing dot property to specify whether trailing dot will be trimmed or not from the target URI.Creates aShareLeaseAsyncClientbased on the configurations set in the builder.Creates aShareLeaseClientbased on the configurations set in the builder.fileAsyncClient(ShareFileAsyncClient fileAsyncClient) Configures the builder based on the passedShareFileAsyncClient.fileClient(ShareFileClient fileClient) Configures the builder based on the passedShareFileClient.Sets the identifier for the lease.shareAsyncClient(ShareAsyncClient shareAsyncClient) Configures the builder based on the passedShareAsyncClient.shareClient(ShareClient shareClient) Configures the builder based on the passedShareClient.shareTokenIntent(ShareTokenIntent shareTokenIntent) Sets theShareTokenIntentthat specifies whether there is intent for a file to be backed up.
-
Constructor Details
-
ShareLeaseClientBuilder
public ShareLeaseClientBuilder()Creates a new instance ofShareLeaseClientBuilder.
-
-
Method Details
-
buildClient
Creates aShareLeaseClientbased on the configurations set in the builder.- Returns:
- a
ShareLeaseClientbased on the configurations in this builder.
-
buildAsyncClient
Creates aShareLeaseAsyncClientbased on the configurations set in the builder.- Returns:
- a
ShareLeaseAsyncClientbased on the configurations in this builder.
-
leaseId
Sets the identifier for the lease.If a lease ID isn't set then a
UUIDwill be used.- Parameters:
leaseId- Identifier for the lease.- Returns:
- the updated ShareLeaseClientBuilder object
-
allowSourceTrailingDot
Set the trailing dot property to specify whether trailing dot will be trimmed or not from the source URI. If set to true, trailing dot (.) will be allowed to suffix directory and file names. If false, the trailing dot will be trimmed. Supported by x-ms-version 2022-11-02 and above.- Parameters:
allowSourceTrailingDot- the allowSourceTrailingDot value.- Returns:
- the updated ShareLeaseClientBuilder object
-
allowTrailingDot
Set the trailing dot property to specify whether trailing dot will be trimmed or not from the target URI. If set to true, trailing dot (.) will be allowed to suffix directory and file names. If false, the trailing dot will be trimmed. Supported by x-ms-version 2022-11-02 and above.- Parameters:
allowTrailingDot- the allowTrailingDot value.- Returns:
- the updated ShareLeaseClientBuilder object
-