ShareLeaseClientBuilder Class
- java.
lang. Object - com.
azure. storage. file. share. specialized. ShareLeaseClientBuilder
- com.
public final class 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(String 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();
Constructor Summary
| Constructor | Description |
|---|---|
| ShareLeaseClientBuilder() |
Creates a new instance of ShareLeaseClientBuilder. |
Method Summary
Methods inherited from java.lang.Object
Constructor Details
ShareLeaseClientBuilder
public ShareLeaseClientBuilder()
Creates a new instance of ShareLeaseClientBuilder.
Method Details
allowSourceTrailingDot
public ShareLeaseClientBuilder allowSourceTrailingDot(boolean 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:
Returns:
allowTrailingDot
public ShareLeaseClientBuilder allowTrailingDot(boolean 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:
Returns:
buildAsyncClient
public ShareLeaseAsyncClient buildAsyncClient()
Creates a ShareLeaseAsyncClient based on the configurations set in the builder.
Returns:
buildClient
public ShareLeaseClient buildClient()
Creates a ShareLeaseClient based on the configurations set in the builder.
Returns:
fileAsyncClient
public ShareLeaseClientBuilder fileAsyncClient(ShareFileAsyncClient fileAsyncClient)
Configures the builder based on the passed ShareFileAsyncClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
fileClient
public ShareLeaseClientBuilder fileClient(ShareFileClient fileClient)
Configures the builder based on the passed ShareFileClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
leaseId
public ShareLeaseClientBuilder leaseId(String leaseId)
Sets the identifier for the lease.
If a lease ID isn't set then a UUID will be used.
Parameters:
Returns:
shareAsyncClient
public ShareLeaseClientBuilder shareAsyncClient(ShareAsyncClient shareAsyncClient)
Configures the builder based on the passed ShareAsyncClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
shareClient
public ShareLeaseClientBuilder shareClient(ShareClient shareClient)
Configures the builder based on the passed ShareClient. This will set the HttpPipeline and URL that are used to interact with the service.
Parameters:
Returns:
shareTokenIntent
public ShareLeaseClientBuilder shareTokenIntent(ShareTokenIntent shareTokenIntent)
Sets the ShareTokenIntent that specifies whether there is intent for a file to be backed up. This is currently required when using TokenCredential, and ignored for other forms of authentication.
Parameters:
Returns: