public final class CloudBlobContainer extends Object
Containers hold directories, which are encapsulated as CloudBlobDirectory
objects, and directories hold block
blobs and page blobs. Directories can also contain sub-directories.
Modifier and Type | Field and Description |
---|---|
protected HashMap<String,String> |
metadata
Represents the container metadata.
|
Constructor and Description |
---|
CloudBlobContainer(String containerAddress,
CloudBlobClient client)
Creates an instance of the
CloudBlobContainer class using the specified address and client. |
CloudBlobContainer(URI uri,
CloudBlobClient client)
Creates an instance of the
CloudBlobContainer class using the specified URI and client. |
Modifier and Type | Method and Description |
---|---|
String |
acquireLease(Integer leaseTimeInSeconds,
String proposedLeaseId)
Acquires a new lease on the container with the specified lease time and proposed lease ID.
|
String |
acquireLease(Integer leaseTimeInSeconds,
String proposedLeaseId,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Acquires a new lease on the container with the specified lease time, proposed lease ID, request
options, and operation context.
|
long |
breakLease(Integer breakPeriodInSeconds)
Breaks the lease and ensures that another client cannot acquire a new lease until the current lease
period has expired.
|
long |
breakLease(Integer breakPeriodInSeconds,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Breaks the existing lease, using the specified request options and operation context, and ensures that
another client cannot acquire a new lease until the current lease period has expired.
|
void |
changeLease(String proposedLeaseId,
AccessCondition accessCondition)
Changes the existing lease ID to the proposed lease ID.
|
void |
changeLease(String proposedLeaseId,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Changes the existing lease ID to the proposed lease Id with the specified access conditions, request options,
and operation context.
|
void |
create()
Creates the container.
|
void |
create(BlobRequestOptions options,
OperationContext opContext)
Creates the container using the specified options and operation context.
|
boolean |
createIfNotExist()
Creates the container if it does not exist.
|
boolean |
createIfNotExist(BlobRequestOptions options,
OperationContext opContext)
Creates the container if it does not exist, using the specified request options and operation context.
|
void |
delete()
Deletes the container.
|
void |
delete(BlobRequestOptions options,
OperationContext opContext)
Deletes the container using the specified request options and operation context.
|
boolean |
deleteIfExists()
Deletes the container if it exists.
|
boolean |
deleteIfExists(BlobRequestOptions options,
OperationContext opContext)
Deletes the container if it exists using the specified request options and operation context.
|
void |
downloadAttributes()
Downloads the container's attributes, which consist of metadata and properties.
|
void |
downloadAttributes(BlobRequestOptions options,
OperationContext opContext)
Downloads the container's attributes, which consist of metadata and properties, using the specified request
options and operation context.
|
BlobContainerPermissions |
downloadPermissions()
Downloads the permission settings for the container.
|
BlobContainerPermissions |
downloadPermissions(BlobRequestOptions options,
OperationContext opContext)
Downloads the permissions settings for the container using the specified request options and operation context.
|
boolean |
exists()
Returns a value that indicates whether the container exists.
|
boolean |
exists(BlobRequestOptions options,
OperationContext opContext)
Returns a value that indicates whether the container exists, using the specified request options and operation
context.
|
String |
generateSharedAccessSignature(SharedAccessBlobPolicy policy,
String groupPolicyIdentifier)
Returns a shared access signature for the container.
|
CloudBlockBlob |
getBlockBlobReference(String blobAddressUri)
Returns a reference to a
CloudBlockBlob object that represents a block blob in this container. |
CloudBlockBlob |
getBlockBlobReference(String blobAddressUri,
String snapshotID)
Returns a reference to a
CloudBlockBlob object that represents a block blob in this container, using the
specified snapshot ID. |
CloudBlobDirectory |
getDirectoryReference(String relativeAddress)
Returns a reference to a
CloudBlobDirectory object that represents a virtual blob directory within this
container. |
HashMap<String,String> |
getMetadata()
Returns the metadata for the container.
|
String |
getName()
Returns the name of the container.
|
CloudPageBlob |
getPageBlobReference(String blobAddressUri)
Returns a reference to a
CloudPageBlob object that represents a page blob in this container. |
CloudPageBlob |
getPageBlobReference(String blobAddressUri,
String snapshotID)
Returns a reference to a
CloudPageBlob object that represents a page blob in the directory, using the
specified snapshot ID. |
BlobContainerProperties |
getProperties()
Returns the properties for the container.
|
CloudBlobClient |
getServiceClient()
Returns the Blob service client associated with this container.
|
protected URI |
getTransformedAddress()
Returns the URI after applying the authentication transformation.
|
URI |
getUri()
Returns the URI for this container.
|
Iterable<ListBlobItem> |
listBlobs()
Returns an enumerable collection of blob items for the container.
|
Iterable<ListBlobItem> |
listBlobs(String prefix)
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix.
|
Iterable<ListBlobItem> |
listBlobs(String prefix,
boolean useFlatBlobListing,
EnumSet<BlobListingDetails> listingDetails,
BlobRequestOptions options,
OperationContext opContext)
Returns an enumerable collection of blob items whose names begin with the specified prefix, using the specified
flat or hierarchical option, listing details options, request options, and operation context.
|
ResultSegment<ListBlobItem> |
listBlobsSegmented()
Returns a result segment of an enumerable collection of blob items in the container.
|
ResultSegment<ListBlobItem> |
listBlobsSegmented(String prefix)
Returns a result segment containing a collection of blob items whose names begin with the specified prefix.
|
ResultSegment<ListBlobItem> |
listBlobsSegmented(String prefix,
boolean useFlatBlobListing,
EnumSet<BlobListingDetails> listingDetails,
int maxResults,
ResultContinuation continuationToken,
BlobRequestOptions options,
OperationContext opContext)
Returns a result segment containing a collection of blob items whose names begin with the specified prefix, using
the specified flat or hierarchical option, listing details options, request options, and operation context.
|
Iterable<CloudBlobContainer> |
listContainers()
Returns an enumerable collection of containers for the service client associated with this container.
|
Iterable<CloudBlobContainer> |
listContainers(String prefix)
Returns an enumerable collection of containers whose names begin with the specified prefix for the service client
associated with this container.
|
Iterable<CloudBlobContainer> |
listContainers(String prefix,
ContainerListingDetails detailsIncluded,
BlobRequestOptions options,
OperationContext opContext)
Returns an enumerable collection of containers whose names begin with the specified prefix for the service client
associated with this container, using the specified details setting, request options, and operation context.
|
ResultSegment<CloudBlobContainer> |
listContainersSegmented()
Returns a result segment of an enumerable collection of containers for the service client associated with this
container.
|
ResultSegment<CloudBlobContainer> |
listContainersSegmented(String prefix)
Returns a result segment of an enumerable collection of containers whose names begin with the specified prefix
for the service client associated with this container.
|
ResultSegment<CloudBlobContainer> |
listContainersSegmented(String prefix,
ContainerListingDetails detailsIncluded,
int maxResults,
ResultContinuation continuationToken,
BlobRequestOptions options,
OperationContext opContext)
Returns a result segment containing a collection of containers whose names begin with the specified prefix for
the service client associated with this container, using the specified listing details options, request options,
and operation context.
|
void |
releaseLease(AccessCondition accessCondition)
Releases the lease on the container.
|
void |
releaseLease(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Releases the lease on the container using the specified access conditions, request options, and operation
context.
|
void |
renewLease(AccessCondition accessCondition)
Renews an existing lease with the specified access conditions.
|
void |
renewLease(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Renews an existing lease with the specified access conditions, request options, and operation context.
|
void |
setMetadata(HashMap<String,String> metadata)
Sets the metadata for the container.
|
protected void |
setName(String name)
Sets the name of the container.
|
protected void |
setProperties(BlobContainerProperties properties)
Sets the properties for the container.
|
protected void |
setUri(URI uri)
Sets the URI of the container.
|
void |
uploadMetadata()
Uploads the container's metadata.
|
void |
uploadMetadata(BlobRequestOptions options,
OperationContext opContext)
Uploads the container's metadata using the specified request options and operation context.
|
void |
uploadPermissions(BlobContainerPermissions permissions)
Uploads the container's permissions.
|
void |
uploadPermissions(BlobContainerPermissions permissions,
BlobRequestOptions options,
OperationContext opContext)
Uploads the container's permissions using the specified request options and operation context.
|
public CloudBlobContainer(String containerAddress, CloudBlobClient client) throws URISyntaxException, StorageException
CloudBlobContainer
class using the specified address and client.containerAddress
- A String
that represents either the absolute URI to the container, or the container name.client
- A CloudBlobClient
object that represents the associated service client, and that specifies the
endpoint for the Blob service.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public CloudBlobContainer(URI uri, CloudBlobClient client) throws URISyntaxException, StorageException
CloudBlobContainer
class using the specified URI and client.uri
- A java.net.URI
object that represents the URI of the container.client
- A CloudBlobClient
object that represents the associated service client, and that specifies the
endpoint for the Blob service.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.@DoesServiceRequest public void create() throws StorageException
StorageException
- If a storage service error occurred.@DoesServiceRequest public void create(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public boolean createIfNotExist() throws StorageException
true
if the container did not already exist and was created; otherwise, false
.StorageException
- If a storage service error occurred.@DoesServiceRequest public boolean createIfNotExist(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.true
if the container did not already exist and was created; otherwise, false
.StorageException
- If a storage service error occurred.@DoesServiceRequest public void delete() throws StorageException
StorageException
- If a storage service error occurred.@DoesServiceRequest public void delete(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public boolean deleteIfExists() throws StorageException
true
if the container did not already exist and was created; otherwise, false
.StorageException
- If a storage service error occurred.@DoesServiceRequest public boolean deleteIfExists(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.true
if the container did not already exist and was created; otherwise, false
.StorageException
- If a storage service error occurred.@DoesServiceRequest public void downloadAttributes() throws StorageException
StorageException
- If a storage service error occurred.@DoesServiceRequest public void downloadAttributes(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public BlobContainerPermissions downloadPermissions() throws StorageException
BlobContainerPermissions
object that represents the container's permissions.StorageException
- If a storage service error occurred.@DoesServiceRequest public BlobContainerPermissions downloadPermissions(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.BlobContainerPermissions
object that represents the container's permissions.StorageException
- If a storage service error occurred.@DoesServiceRequest public boolean exists() throws StorageException
true
if the container exists, otherwise false
.StorageException
- If a storage service error occurred.@DoesServiceRequest public boolean exists(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.true
if the container exists, otherwise false
.StorageException
- If a storage service error occurred.public String generateSharedAccessSignature(SharedAccessBlobPolicy policy, String groupPolicyIdentifier) throws InvalidKeyException, StorageException
policy
- The access policy for the shared access signature.groupPolicyIdentifier
- A container-level access policy.InvalidKeyException
StorageException
IllegalArgumentException
public CloudBlockBlob getBlockBlobReference(String blobAddressUri) throws URISyntaxException, StorageException
CloudBlockBlob
object that represents a block blob in this container.blobAddressUri
- A String
that represents the name of the blob, or the absolute URI to the blob.CloudBlockBlob
object that represents a reference to the specified block blob.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public CloudBlockBlob getBlockBlobReference(String blobAddressUri, String snapshotID) throws URISyntaxException, StorageException
CloudBlockBlob
object that represents a block blob in this container, using the
specified snapshot ID.blobAddressUri
- A String
that represents the name of the blob, or the absolute URI to the blob.snapshotID
- A String
that represents the snapshot ID of the blob.CloudBlockBlob
object that represents a reference to the specified block blob.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public CloudBlobDirectory getDirectoryReference(String relativeAddress) throws URISyntaxException, StorageException
CloudBlobDirectory
object that represents a virtual blob directory within this
container.relativeAddress
- A String
that represents the name of the virtual blob directory, or the absolute URI to
the virtual blob directory.CloudBlobDirectory
that represents a virtual blob directory within this container.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public HashMap<String,String> getMetadata()
java.util.HashMap
object that represents the metadata for the container.public String getName()
String
that represents the name of the container.public CloudPageBlob getPageBlobReference(String blobAddressUri) throws URISyntaxException, StorageException
CloudPageBlob
object that represents a page blob in this container.blobAddressUri
- A String
that represents the name of the blob, or the absolute URI to the blob.CloudPageBlob
object that represents a reference to the specified page blob.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public CloudPageBlob getPageBlobReference(String blobAddressUri, String snapshotID) throws URISyntaxException, StorageException
CloudPageBlob
object that represents a page blob in the directory, using the
specified snapshot ID.blobAddressUri
- A String
that represents the name of the blob, or the absolute URI to the blob.snapshotID
- A String
that represents the snapshot ID of the blob.CloudPageBlob
object that represents a reference to the specified page blob.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public BlobContainerProperties getProperties()
BlobContainerProperties
object that represents the properties for the container.public CloudBlobClient getServiceClient()
CloudBlobClient
object that represents the service client associated with this container.protected URI getTransformedAddress() throws URISyntaxException, StorageException
java.net.URI
object that represents the URI after applying the authentication
transformation.IllegalArgumentException
- If an unexpected value is passed.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.public URI getUri()
@DoesServiceRequest public Iterable<ListBlobItem> listBlobs()
ListBlobItem
objects that represents the items in this container.@DoesServiceRequest public Iterable<ListBlobItem> listBlobs(String prefix)
prefix
- A String
that represents the blob name prefix. This value must be preceded either by the
name of the container or by the absolute path to the container.ListBlobItem
objects that represents the items whose names begin with
the specified prefix in this container.@DoesServiceRequest public Iterable<ListBlobItem> listBlobs(String prefix, boolean useFlatBlobListing, EnumSet<BlobListingDetails> listingDetails, BlobRequestOptions options, OperationContext opContext)
prefix
- A String
that represents the blob name prefix. This value must be preceded either by the
name of the container or by the absolute path to the container.useFlatBlobListing
- true
to indicate that the returned list will be flat; false
to indicate that
the returned list will be hierarchical.listingDetails
- A java.util.EnumSet
object that contains BlobListingDetails
values that indicate
whether snapshots, metadata, and/or uncommitted blocks are returned. Committed blocks are always
returned.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.ListBlobItem
objects that represent the block items whose names begin
with the specified prefix in this directory.StorageException
- If a storage service error occurred.URISyntaxException
- If the resource URI is invalid.@DoesServiceRequest public ResultSegment<ListBlobItem> listBlobsSegmented() throws StorageException
ResultSegment
object that contains a segment of the enumerable collection of
ListBlobItem
objects that represent the blob items in the container.StorageException
- If a storage service error occurred.@DoesServiceRequest public ResultSegment<ListBlobItem> listBlobsSegmented(String prefix) throws StorageException
prefix
- A String
that represents the prefix of the blob name.ResultSegment
object that contains a segment of the enumerable collection of
ListBlobItem
objects that represent the blob items whose names begin with the specified prefix in
the container.StorageException
- If a storage service error occurred.@DoesServiceRequest public ResultSegment<ListBlobItem> listBlobsSegmented(String prefix, boolean useFlatBlobListing, EnumSet<BlobListingDetails> listingDetails, int maxResults, ResultContinuation continuationToken, BlobRequestOptions options, OperationContext opContext) throws StorageException
prefix
- A String
that represents the prefix of the blob name.useFlatBlobListing
- true
to indicate that the returned list will be flat; false
to indicate that
the returned list will be hierarchical.listingDetails
- A java.util.EnumSet
object that contains BlobListingDetails
values that indicate
whether snapshots, metadata, and/or uncommitted blocks are returned. Committed blocks are always
returned.maxResults
- The maximum number of results to retrieve.continuationToken
- A ResultContinuation
object that represents a continuation token returned by a previous
listing operation.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.ResultSegment
object that contains a segment of the enumerable collection of
ListBlobItem
objects that represent the block items whose names begin with the specified prefix
in the container.StorageException
- If a storage service error occurred.@DoesServiceRequest public Iterable<CloudBlobContainer> listContainers()
CloudBlobContainer
objects that represent the containers for the
service client associated with this container.@DoesServiceRequest public Iterable<CloudBlobContainer> listContainers(String prefix)
prefix
- A String
that represents the container name prefix.CloudBlobContainer
objects that represent the containers whose names
begin with the specified prefix for the service client associated with this container.@DoesServiceRequest public Iterable<CloudBlobContainer> listContainers(String prefix, ContainerListingDetails detailsIncluded, BlobRequestOptions options, OperationContext opContext)
prefix
- A String
that represents the container name prefix.detailsIncluded
- A ContainerListingDetails
value that indicates whether container metadata will be returned.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.CloudBlobContainer
objects that represents the containers for the
service client associated with this container.@DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented() throws StorageException
ResultSegment
object that contains a segment of the enumerable collection of
CloudBlobContainer
objects that represent the containers for the service client associated with
this container.StorageException
- If a storage service error occurred.@DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented(String prefix) throws StorageException
prefix
- A String
that represents the blob name prefix.ResultSegment
object that contains a segment of the enumerable collection of
CloudBlobContainer
objects that represent the containers whose names begin with the specified
prefix for the service client associated with this container.StorageException
- If a storage service error occurred.@DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented(String prefix, ContainerListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken, BlobRequestOptions options, OperationContext opContext) throws StorageException
prefix
- A String
that represents the prefix of the container name.detailsIncluded
- A ContainerListingDetails
object that indicates whether metadata is included.maxResults
- The maximum number of results to retrieve.continuationToken
- A ResultContinuation
object that represents a continuation token returned by a previous
listing operation.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.ResultSegment
object that contains a segment of the enumerable collection of
CloudBlobContainer
objects that represent the containers whose names begin with the specified
prefix for the service client associated with this container.StorageException
- If a storage service error occurred.public void setMetadata(HashMap<String,String> metadata)
metadata
- A java.util.HashMap
object that represents the metadata being assigned to the container.protected void setName(String name)
name
- A String
that represents the name being assigned to the container.protected void setProperties(BlobContainerProperties properties)
properties
- A BlobContainerProperties
object that represents the properties being assigned to the
container.protected void setUri(URI uri)
uri
- A java.net.URI
object that represents the URI being assigned to the container.@DoesServiceRequest public void uploadMetadata() throws StorageException
StorageException
- If a storage service error occurred.@DoesServiceRequest public void uploadMetadata(BlobRequestOptions options, OperationContext opContext) throws StorageException
options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public void uploadPermissions(BlobContainerPermissions permissions) throws StorageException
permissions
- A BlobContainerPermissions
object that represents the permissions to upload.StorageException
- If a storage service error occurred.@DoesServiceRequest public void uploadPermissions(BlobContainerPermissions permissions, BlobRequestOptions options, OperationContext opContext) throws StorageException
permissions
- A BlobContainerPermissions
object that represents the permissions to upload.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public final String acquireLease(Integer leaseTimeInSeconds, String proposedLeaseId) throws StorageException
leaseTimeInSeconds
- Specifies the span of time for which to acquire the lease, in seconds.
If null, an infinite lease will be acquired. If not null, the value must be greater than
zero.proposedLeaseId
- A String
that represents the proposed lease ID for the new lease,
or null if no lease ID is proposed.String
that represents the lease ID.StorageException
- If a storage service error occurred.@DoesServiceRequest public final String acquireLease(Integer leaseTimeInSeconds, String proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
leaseTimeInSeconds
- Specifies the span of time for which to acquire the lease, in seconds.
If null, an infinite lease will be acquired. If not null, the value must be greater than
zero.proposedLeaseId
- A String
that represents the proposed lease ID for the new lease,
or null if no lease ID is proposed.accessCondition
- An AccessCondition
object that represents the access conditions for the container.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. The context
is used to track requests to the storage service, and to provide additional runtime information about
the operation.String
that represents the lease ID.StorageException
- If a storage service error occurred.@DoesServiceRequest public final void renewLease(AccessCondition accessCondition) throws StorageException
accessCondition
- An AccessCondition
object that represents the access conditions for the container. The lease
ID is required to be set with an access condition.StorageException
- If a storage service error occurred.@DoesServiceRequest public final void renewLease(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
accessCondition
- An AccessCondition
object that represents the access conditions for the blob. The lease ID is
required to be set with an access condition.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. The context
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public final void releaseLease(AccessCondition accessCondition) throws StorageException
accessCondition
- An AccessCondition
object that represents the access conditions for the blob. The lease ID is
required to be set with an access condition.StorageException
- If a storage service error occurred.@DoesServiceRequest public final void releaseLease(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
accessCondition
- An AccessCondition
object that represents the access conditions for the blob. The lease ID is
required to be set with an access condition.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. The context
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public final long breakLease(Integer breakPeriodInSeconds) throws StorageException
breakPeriodInSeconds
- Specifies the time to wait, in seconds, until the current lease is broken.
If null, the break period is the remainder of the current lease, or zero for infinite leases.StorageException
- If a storage service error occurred.@DoesServiceRequest public final long breakLease(Integer breakPeriodInSeconds, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
breakPeriodInSeconds
- Specifies the time to wait, in seconds, until the current lease is broken.
If null, the break period is the remainder of the current lease, or zero for infinite leases.accessCondition
- An AccessCondition
object that represents the access conditions for the blob.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. The context
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred.@DoesServiceRequest public final void changeLease(String proposedLeaseId, AccessCondition accessCondition) throws StorageException
proposedLeaseId
- A String
that represents the proposed lease ID for the new lease,
or null if no lease ID is proposed.accessCondition
- An AccessCondition
object that represents the access conditions for the blob. The lease ID is
required to be set with an access condition.StorageException
- If a storage service error occurred.@DoesServiceRequest public final void changeLease(String proposedLeaseId, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
proposedLeaseId
- A String
that represents the proposed lease ID for the new lease,
or null if no lease ID is proposed.accessCondition
- An AccessCondition
object that represents the access conditions for the blob. The lease ID is
required to be set with an access condition.options
- A BlobRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudBlobClient
).opContext
- An OperationContext
object that represents the context for the current operation. The context
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException
- If a storage service error occurred./**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/