CloudBlobContainer Class
- java.
lang. Object - com.
microsoft. azure. storage. blob. CloudBlobContainer
- com.
public class CloudBlobContainer
Represents a container in the Microsoft Azure Blob service.
Containers hold directories, which are encapsulated as CloudBlobDirectory objects, and directories hold block blobs and page blobs. Directories can also contain sub-directories.
Field Summary
Modifier and Type | Field and Description |
---|---|
HashMap<String, String> |
metadata
Represents the container metadata. |
Constructor Summary
Constructor | Description |
---|---|
CloudBlobContainer(final StorageUri storageUri) |
Creates an instance of the class using the specified URI. The blob URI should include a SAS token unless anonymous access is to be used. |
CloudBlobContainer(final StorageUri storageUri, final StorageCredentials credentials) |
Creates an instance of the class using the specified StorageUri and credentials. |
CloudBlobContainer(final String containerName, final CloudBlobClient client) |
Creates an instance of the class using the specified name and client. |
CloudBlobContainer(final URI uri) |
Creates an instance of the class using the specified URI. The blob URI should include a SAS token unless anonymous access is to be used. |
CloudBlobContainer(final URI uri, final StorageCredentials credentials) |
Creates an instance of the class using the specified URI and credentials. |
Method Summary
Modifier and Type | Method and Description |
---|---|
final String |
acquireLease()
Acquires a new infinite lease on the container. |
final String |
acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId)
Acquires a new lease on the container with the specified lease time and proposed lease ID. |
final String |
acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId, final 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. |
final long |
breakLease(final Integer breakPeriodInSeconds)
Breaks the lease and ensures that another client cannot acquire a new lease until the current lease period has expired. |
final long |
breakLease(final Integer breakPeriodInSeconds, final 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. |
final String |
changeLease(final String proposedLeaseId, final AccessCondition accessCondition)
Changes the existing lease ID to the proposed lease ID. |
final String |
changeLease(final String proposedLeaseId, final 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(BlobContainerPublicAccessType accessType, BlobRequestOptions options, OperationContext opContext)
Creates the container using the specified options and operation context. |
void |
create(BlobRequestOptions options, OperationContext opContext)
Creates the container using the specified options and operation context. |
boolean |
createIfNotExists()
Creates the container if it does not exist. |
boolean |
createIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions options, OperationContext opContext)
Creates the container if it does not exist, using the specified request options and operation context. |
boolean |
createIfNotExists(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(AccessCondition accessCondition, 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(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Deletes the container if it exists using the specified request options and operation context. |
Account |
downloadAccountInfo()
Gets information related to the storage account in which this container resides. |
Account |
downloadAccountInfo(BlobRequestOptions options, OperationContext opContext)
Gets information related to the storage account in which this container resides. |
Storage |
downloadAccountInformationImpl(final RequestOptions options) |
void |
downloadAttributes()
Downloads the container's attributes, which consist of metadata and properties. |
void |
downloadAttributes(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Downloads the container's attributes, which consist of metadata and properties, using the specified request options and operation context. |
Blob |
downloadPermissions()
Downloads the permission settings for the container. |
Blob |
downloadPermissions(AccessCondition accessCondition, 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(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Returns a value that indicates whether the container exists, using the specified request options and operation context. |
String |
generateSharedAccessSignature(final SharedAccessBlobPolicy policy, final String groupPolicyIdentifier)
Returns a shared access signature for the container. Note this does not contain the leading "?". |
String |
generateSharedAccessSignature(final SharedAccessBlobPolicy policy, final String groupPolicyIdentifier, final IPRange ipRange, final SharedAccessProtocols protocols)
Returns a shared access signature for the container. Note this does not contain the leading "?". |
Cloud |
getAppendBlobReference(final String blobName)
Returns a reference to a CloudAppendBlob object that represents an append blob in this container. |
Cloud |
getAppendBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudAppendBlob object that represents an append blob in the container, using the specified snapshot ID. |
final Cloud |
getBlobReferenceFromServer(final String blobName)
Gets a reference to a blob in this container. The blob must already exist on the service. Unlike the other get*Reference methods, this method does a service request to retrieve the blob's metadata and properties. The returned blob may be used directly as a CloudBlob or cast using either instanceof or getProperties().getBlobType() to determine its subtype. |
final Cloud |
getBlobReferenceFromServer(final String blobName, final String snapshotID, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Gets a reference to a blob in this container. The blob must already exist on the service. Unlike the other get*Reference methods, this method does a service request to retrieve the blob's metadata and properties. The returned blob may be used directly as a CloudBlob or cast using either instanceof or getProperties().getBlobType() to determine its subtype. |
Cloud |
getBlockBlobReference(final String blobName)
Returns a reference to a CloudBlockBlob object that represents a block blob in this container. |
Cloud |
getBlockBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudBlockBlob object that represents a block blob in this container, using the specified snapshot ID. |
Cloud |
getDirectoryReference(String directoryName)
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. This value is initialized with the metadata from the queue by a call to downloadAttributes(), and is set on the queue with a call to uploadMetadata(). |
String |
getName()
Returns the name of the container. |
Cloud |
getPageBlobReference(final String blobName)
Returns a reference to a CloudPageBlob object that represents a page blob in this container. |
Cloud |
getPageBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudPageBlob object that represents a page blob in the container, using the specified snapshot ID. |
Blob |
getProperties()
Returns the properties for the container. |
Cloud |
getServiceClient()
Returns the Blob service client associated with this container. |
Storage |
getStorageUri()
Returns the list of URIs for all locations. |
URI |
getUri()
Returns the URI for this container. |
Iterable<List |
listBlobs()
Returns an enumerable collection of blob items for the container. |
Iterable<List |
listBlobs(final String prefix)
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix. |
Iterable<List |
listBlobs(final String prefix, final boolean useFlatBlobListing)
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix using the specified flat or hierarchical option. |
Iterable<List |
listBlobs(final String prefix, final boolean useFlatBlobListing, final EnumSet<BlobListingDetails> listingDetails, BlobRequestOptions options, OperationContext opContext)
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix, using the specified flat or hierarchical option, listing details options, request options, and operation context. |
Result |
listBlobsSegmented()
Returns a result segment of an enumerable collection of blob items in the container. |
Result |
listBlobsSegmented(final String prefix)
Returns a result segment containing a collection of blob items whose names begin with the specified prefix. |
Result |
listBlobsSegmented(final String prefix, final boolean useFlatBlobListing, final EnumSet<BlobListingDetails> listingDetails, final Integer maxResults, final 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<Cloud |
listContainers()
Returns an enumerable collection of containers for the service client associated with this container. |
Iterable<Cloud |
listContainers(final String prefix)
Returns an enumerable collection of containers whose names begin with the specified prefix for the service client associated with this container. |
Iterable<Cloud |
listContainers(final String prefix, final ContainerListingDetails detailsIncluded, final BlobRequestOptions options, final 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. |
Result |
listContainersSegmented()
Returns a result segment of an enumerable collection of containers for the service client associated with this container. |
Result |
listContainersSegmented(final 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. |
Result |
listContainersSegmented(final String prefix, final ContainerListingDetails detailsIncluded, final Integer maxResults, final ResultContinuation continuationToken, final BlobRequestOptions options, final 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. |
final void |
releaseLease(final AccessCondition accessCondition)
Releases the lease on the container. |
final void |
releaseLease(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Releases the lease on the container using the specified access conditions, request options, and operation context. |
final void |
renewLease(final AccessCondition accessCondition)
Renews an existing lease with the specified access conditions. |
final void |
renewLease(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Renews an existing lease with the specified access conditions, request options, and operation context. |
void |
setMetadata(final HashMap<String, String> metadata)
Sets the metadata collection of name-value pairs to be set on the container with an uploadMetadata() call. This collection will overwrite any existing container metadata. If this is set to an empty collection, the container metadata will be cleared on an uploadMetadata() call. |
void |
setProperties(final BlobContainerProperties properties)
Sets the properties for the container. |
void |
setStorageUri(final StorageUri storageUri)
Sets the list of URIs for all locations. |
void |
uploadMetadata()
Uploads the container's metadata. |
void |
uploadMetadata(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Uploads the container's metadata using the specified request options and operation context. |
void |
uploadPermissions(final BlobContainerPermissions permissions)
Uploads the container's permissions. |
void |
uploadPermissions(final BlobContainerPermissions permissions, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Uploads the container's permissions using the specified request options and operation context. |
Field Details
metadata
protected HashMap
Represents the container metadata.
Constructor Details
CloudBlobContainer
public CloudBlobContainer(final StorageUri storageUri)
Creates an instance of the class using the specified URI. The blob URI should include a SAS token unless anonymous access is to be used.
Parameters:
Throws:
CloudBlobContainer
public CloudBlobContainer(final StorageUri storageUri, final StorageCredentials credentials)
Creates an instance of the class using the specified StorageUri and credentials.
Parameters:
Throws:
CloudBlobContainer
protected CloudBlobContainer(final String containerName, final CloudBlobClient client)
Creates an instance of the class using the specified name and client.
Parameters:
String
which represents the name of the container, which must adhere to container naming rules. The container name should not include any path separator characters (/). Container names must be lowercase, between 3-63 characters long and must start with a letter or number. Container names may contain only letters, numbers, and the dash (-) character.
Throws:
CloudBlobContainer
public CloudBlobContainer(final URI uri)
Creates an instance of the class using the specified URI. The blob URI should include a SAS token unless anonymous access is to be used.
Parameters:
java.net.URI
object which represents the URI of the container.
Throws:
CloudBlobContainer
public CloudBlobContainer(final URI uri, final StorageCredentials credentials)
Creates an instance of the class using the specified URI and credentials.
Parameters:
java.net.URI
object that represents the absolute URI of the container.
Throws:
Method Details
acquireLease
public final String acquireLease()
Acquires a new infinite lease on the container.
Returns:
String
that represents the lease ID.Throws:
acquireLease
public final String acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId)
Acquires a new lease on the container with the specified lease time and proposed lease ID.
Parameters:
Integer
which 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.
String
that represents the proposed lease ID for the new lease, or null if no lease ID is proposed.
Returns:
String
that represents the lease ID.Throws:
acquireLease
public final String acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId, final 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.
Parameters:
Integer
which 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.
String
that represents the proposed lease ID for the new lease, or null if no lease ID is proposed.
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
String
that represents the lease ID.Throws:
breakLease
public final long breakLease(final Integer breakPeriodInSeconds)
Breaks the lease and ensures that another client cannot acquire a new lease until the current lease period has expired.
Parameters:
Integer
which 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.
Returns:
Throws:
breakLease
public final long breakLease(final Integer breakPeriodInSeconds, final 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.
Parameters:
Integer
which 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.
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
Throws:
changeLease
public final String changeLease(final String proposedLeaseId, final AccessCondition accessCondition)
Changes the existing lease ID to the proposed lease ID.
Parameters:
String
that represents the proposed lease ID for the new lease, or null if no lease ID is proposed.
Returns:
String
that represents the new lease ID.Throws:
changeLease
public final String changeLease(final String proposedLeaseId, final 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.
Parameters:
String
that represents the proposed lease ID for the new lease. This cannot be null.
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
String
that represents the new lease ID.Throws:
create
public void create()
Creates the container.
Throws:
create
public void create(BlobContainerPublicAccessType accessType, BlobRequestOptions options, OperationContext opContext)
Creates the container using the specified options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws:
create
public void create(BlobRequestOptions options, OperationContext opContext)
Creates the container using the specified options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws:
createIfNotExists
public boolean createIfNotExists()
Creates the container if it does not exist.
Returns:
true
if the container did not already exist and was created; otherwise, false
.
Throws:
createIfNotExists
public boolean createIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions options, OperationContext opContext)
Creates the container if it does not exist, using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
true
if the container did not already exist and was created; otherwise, false
.
Throws:
createIfNotExists
public boolean createIfNotExists(BlobRequestOptions options, OperationContext opContext)
Creates the container if it does not exist, using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
true
if the container did not already exist and was created; otherwise, false
.
Throws:
delete
public void delete()
Deletes the container.
Throws:
delete
public void delete(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Deletes the container using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws:
deleteIfExists
public boolean deleteIfExists()
Deletes the container if it exists.
Returns:
true
if the container did not already exist and was created; otherwise, false
.
Throws:
deleteIfExists
public boolean deleteIfExists(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Deletes the container if it exists using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
true
if the container existed and was deleted; otherwise, false
.
Throws:
downloadAccountInfo
public AccountInformation downloadAccountInfo()
Gets information related to the storage account in which this container resides.
Returns:
Throws:
downloadAccountInfo
public AccountInformation downloadAccountInfo(BlobRequestOptions options, OperationContext opContext)
Gets information related to the storage account in which this container resides.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
downloadAccountInformationImpl
protected StorageRequest
Parameters:
downloadAttributes
public void downloadAttributes()
Downloads the container's attributes, which consist of metadata and properties.
Throws:
downloadAttributes
public void downloadAttributes(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Downloads the container's attributes, which consist of metadata and properties, using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws:
downloadPermissions
public BlobContainerPermissions downloadPermissions()
Downloads the permission settings for the container.
Returns:
Throws:
downloadPermissions
public BlobContainerPermissions downloadPermissions(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Downloads the permissions settings for the container using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
exists
public boolean exists()
Returns a value that indicates whether the container exists.
Returns:
true
if the container exists, otherwise false
.
Throws:
exists
public boolean exists(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Returns a value that indicates whether the container exists, using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
true
if the container exists, otherwise false
.
Throws:
generateSharedAccessSignature
public String generateSharedAccessSignature(final SharedAccessBlobPolicy policy, final String groupPolicyIdentifier)
Returns a shared access signature for the container. Note this does not contain the leading "?".
Parameters:
String
which represents the container-level access policy.
Returns:
String
which represents a shared access signature for the container.Throws:
generateSharedAccessSignature
public String generateSharedAccessSignature(final SharedAccessBlobPolicy policy, final String groupPolicyIdentifier, final IPRange ipRange, final SharedAccessProtocols protocols)
Returns a shared access signature for the container. Note this does not contain the leading "?".
Parameters:
String
which represents the container-level access policy.
Returns:
String
which represents a shared access signature for the container.Throws:
getAppendBlobReference
public CloudAppendBlob getAppendBlobReference(final String blobName)
Returns a reference to a CloudAppendBlob object that represents an append blob in this container.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getAppendBlobReference
public CloudAppendBlob getAppendBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudAppendBlob object that represents an append blob in the container, using the specified snapshot ID.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
Returns:
Throws:
getBlobReferenceFromServer
public final CloudBlob getBlobReferenceFromServer(final String blobName)
Gets a reference to a blob in this container. The blob must already exist on the service.
Unlike the other get*Reference methods, this method does a service request to retrieve the blob's metadata and properties. The returned blob may be used directly as a CloudBlob or cast using either instanceof or getProperties().getBlobType() to determine its subtype.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getBlobReferenceFromServer
public final CloudBlob getBlobReferenceFromServer(final String blobName, final String snapshotID, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Gets a reference to a blob in this container. The blob must already exist on the service.
Unlike the other get*Reference methods, this method does a service request to retrieve the blob's metadata and properties. The returned blob may be used directly as a CloudBlob or cast using either instanceof or getProperties().getBlobType() to determine its subtype.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
getBlockBlobReference
public CloudBlockBlob getBlockBlobReference(final String blobName)
Returns a reference to a CloudBlockBlob object that represents a block blob in this container.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getBlockBlobReference
public CloudBlockBlob getBlockBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudBlockBlob object that represents a block blob in this container, using the specified snapshot ID.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
Returns:
Throws:
getDirectoryReference
public CloudBlobDirectory getDirectoryReference(String directoryName)
Returns a reference to a CloudBlobDirectory object that represents a virtual blob directory within this container.
Parameters:
String
that represents the name of the virtual blob directory. If the root directory (the directory representing the container itself) is desired, use an empty string.
Returns:
Throws:
getMetadata
public HashMap
Returns the metadata for the container. This value is initialized with the metadata from the queue by a call to downloadAttributes(), and is set on the queue with a call to uploadMetadata().
Returns:
java.util.HashMap
object that represents the metadata for the container.getName
public String getName()
Returns the name of the container.
Returns:
String
that represents the name of the container.getPageBlobReference
public CloudPageBlob getPageBlobReference(final String blobName)
Returns a reference to a CloudPageBlob object that represents a page blob in this container.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getPageBlobReference
public CloudPageBlob getPageBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudPageBlob object that represents a page blob in the container, using the specified snapshot ID.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
Returns:
Throws:
getProperties
public BlobContainerProperties getProperties()
Returns the properties for the container.
Returns:
getServiceClient
public CloudBlobClient getServiceClient()
Returns the Blob service client associated with this container.
Returns:
getStorageUri
public StorageUri getStorageUri()
Returns the list of URIs for all locations.
Returns:
getUri
public URI getUri()
Returns the URI for this container.
Returns:
listBlobs
public Iterable
Returns an enumerable collection of blob items for the container.
Returns:
listBlobs
public Iterable
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix.
Parameters:
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.
Returns:
listBlobs
public Iterable
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix using the specified flat or hierarchical option.
Parameters:
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.
true
to indicate that the returned list will be flat; false
to indicate that the returned list will be hierarchical.
Returns:
listBlobs
public Iterable
Returns an enumerable collection of blob items for the container whose names begin with the specified prefix, using the specified flat or hierarchical option, listing details options, request options, and operation context.
Parameters:
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.
true
to indicate that the returned list will be flat; false
to indicate that the returned list will be hierarchical.
java.util.EnumSet
object that contains BlobListingDetails values that indicate whether snapshots, soft-deleted blobs, metadata, and/or uncommitted blocks are returned. Committed blocks are always returned.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
listBlobsSegmented
public ResultSegment
Returns a result segment of an enumerable collection of blob items in the container.
Returns:
Throws:
listBlobsSegmented
public ResultSegment
Returns a result segment containing a collection of blob items whose names begin with the specified prefix.
Parameters:
String
that represents the prefix of the blob name.
Returns:
Throws:
listBlobsSegmented
public ResultSegment
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.
Parameters:
String
that represents the prefix of the blob name.
true
to indicate that the returned list will be flat; false
to indicate that the returned list will be hierarchical.
java.util.EnumSet
object that contains BlobListingDetails values that indicate whether snapshots, soft-deleted blobs, metadata, and/or uncommitted blocks are returned. Committed blocks are always returned.
null
or greater than 5000, the server will return up to 5,000 items. Must be at least 1.
null
will use the default request options from the associated service client (CloudBlobClient).
Returns:
Throws:
listContainers
public Iterable
Returns an enumerable collection of containers for the service client associated with this container.
Returns:
listContainers
public Iterable
Returns an enumerable collection of containers whose names begin with the specified prefix for the service client associated with this container.
Parameters:
String
that represents the container name prefix.
Returns:
listContainers
public Iterable
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.
Parameters:
String
that represents the container name prefix.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
listContainersSegmented
public ResultSegment
Returns a result segment of an enumerable collection of containers for the service client associated with this container.
Returns:
Throws:
listContainersSegmented
public ResultSegment
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.
Parameters:
String
that represents the blob name prefix.
Returns:
Throws:
listContainersSegmented
public ResultSegment
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.
Parameters:
String
that represents the prefix of the container name.
null
or greater than 5000, the server will return up to 5,000 items. Must be at least 1.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
releaseLease
public final void releaseLease(final AccessCondition accessCondition)
Releases the lease on the container.
Parameters:
Throws:
releaseLease
public final void releaseLease(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Releases the lease on the container using the specified access conditions, request options, and operation context.
Parameters:
null
will use the default request options from the associated service client (CloudBlobClient).
Throws:
renewLease
public final void renewLease(final AccessCondition accessCondition)
Renews an existing lease with the specified access conditions.
Parameters:
Throws:
renewLease
public final void renewLease(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Renews an existing lease with the specified access conditions, request options, and operation context.
Parameters:
null
will use the default request options from the associated service client (CloudBlobClient).
Throws:
setMetadata
public void setMetadata(final HashMap
Sets the metadata collection of name-value pairs to be set on the container with an uploadMetadata() call. This collection will overwrite any existing container metadata. If this is set to an empty collection, the container metadata will be cleared on an uploadMetadata() call.
Parameters:
java.util.HashMap
object that represents the metadata being assigned to the container.
setProperties
protected void setProperties(final BlobContainerProperties properties)
Sets the properties for the container.
Parameters:
setStorageUri
protected void setStorageUri(final StorageUri storageUri)
Sets the list of URIs for all locations.
Parameters:
uploadMetadata
public void uploadMetadata()
Uploads the container's metadata.
Throws:
uploadMetadata
public void uploadMetadata(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Uploads the container's metadata using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws:
uploadPermissions
public void uploadPermissions(final BlobContainerPermissions permissions)
Uploads the container's permissions.
Parameters:
Throws:
uploadPermissions
public void uploadPermissions(final BlobContainerPermissions permissions, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
Uploads the container's permissions using the specified request options and operation context.
Parameters:
null
will use the default request options from the associated service client ( CloudBlobClient).
Throws:
Applies to
Azure SDK for Java