ShareAcquireLeaseOptions Class

  • java.lang.Object
    • com.azure.storage.file.share.options.ShareAcquireLeaseOptions

public class ShareAcquireLeaseOptions

Extended options that may be passed when acquiring a lease to a file or share.

Constructor Summary

Constructor Description
ShareAcquireLeaseOptions()

Creates a new options object with an infinite duration.

Method Summary

Modifier and Type Method and Description
int getDuration()

Gets the duration of the lease between 15 and 60 seconds or -1 for an infinite duration.

ShareAcquireLeaseOptions setDuration(int durationInSeconds)

Sets the duration of the lease between 15 and 60 seconds or -1 for an infinite duration.

Methods inherited from java.lang.Object

Constructor Details

ShareAcquireLeaseOptions

public ShareAcquireLeaseOptions()

Creates a new options object with an infinite duration.

Method Details

getDuration

public int getDuration()

Gets the duration of the lease between 15 and 60 seconds or -1 for an infinite duration.

Returns:

The duration of the lease between 15 and 60 seconds or -1 for an infinite duration.

setDuration

public ShareAcquireLeaseOptions setDuration(int durationInSeconds)

Sets the duration of the lease between 15 and 60 seconds or -1 for an infinite duration.

Parameters:

durationInSeconds - The duration of the lease between 15 and 60 seconds or -1 for an infinite duration. Note: Share files only support infinite lease.

Returns:

The updated options.

Applies to