CloudBlobContainer Class

Definition

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.

public class CloudBlobContainer
Inheritance
java.lang.Object
CloudBlobContainer

Constructors

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.

Fields

metadata

Represents the container metadata.

Methods

acquireLease()

Acquires a new infinite lease on the container.

acquireLease(final Integer leaseTimeInSeconds, final String proposedLeaseId)

Acquires a new lease on the container with the specified lease time and proposed lease ID.

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.

breakLease(final Integer breakPeriodInSeconds)

Breaks the lease and ensures that another client cannot acquire a new lease until the current lease period has expired.

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.

changeLease(final String proposedLeaseId, final AccessCondition accessCondition)

Changes the existing lease ID to the proposed lease ID.

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.

create()

Creates the container.

create(BlobContainerPublicAccessType accessType, BlobRequestOptions options, OperationContext opContext)

Creates the container using the specified options and operation context.

create(BlobRequestOptions options, OperationContext opContext)

Creates the container using the specified options and operation context.

createIfNotExists()

Creates the container if it does not exist.

createIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions options, OperationContext opContext)

Creates the container if it does not exist, using the specified request options and operation context.

createIfNotExists(BlobRequestOptions options, OperationContext opContext)

Creates the container if it does not exist, using the specified request options and operation context.

delete()

Deletes the container.

delete(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Deletes the container using the specified request options and operation context.

deleteIfExists()

Deletes the container if it exists.

deleteIfExists(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Deletes the container if it exists using the specified request options and operation context.

downloadAccountInfo()

Gets information related to the storage account in which this container resides.

downloadAccountInfo(BlobRequestOptions options, OperationContext opContext)

Gets information related to the storage account in which this container resides.

downloadAccountInformationImpl(final RequestOptions options)
downloadAttributes()

Downloads the container's attributes, which consist of metadata and properties.

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.

downloadPermissions()

Downloads the permission settings for the container.

downloadPermissions(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Downloads the permissions settings for the container using the specified request options and operation context.

exists()

Returns a value that indicates whether the container exists.

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.

generateSharedAccessSignature(final SharedAccessBlobPolicy policy, final String groupPolicyIdentifier)

Returns a shared access signature for the container. Note this does not contain the leading "?".

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 "?".

getAppendBlobReference(final String blobName)

Returns a reference to a CloudAppendBlob object that represents an append blob in this container.

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.

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.

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.

getBlockBlobReference(final String blobName)

Returns a reference to a CloudBlockBlob object that represents a block blob in this container.

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.

getDirectoryReference(String directoryName)

Returns a reference to a CloudBlobDirectory object that represents a virtual blob directory within this container.

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.

getName()

Returns the name of the container.

getPageBlobReference(final String blobName)

Returns a reference to a CloudPageBlob object that represents a page blob in this container.

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.

getProperties()

Returns the properties for the container.

getServiceClient()

Returns the Blob service client associated with this container.

getStorageUri()

Returns the list of URIs for all locations.

getUri()

Returns the URI for this container.

listBlobs()

Returns an enumerable collection of blob items for the container.

listBlobs(final String prefix)

Returns an enumerable collection of blob items for the container whose names begin with the specified prefix.

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.

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.

listBlobsSegmented()

Returns a result segment of an enumerable collection of blob items in the container.

listBlobsSegmented(final String prefix)

Returns a result segment containing a collection of blob items whose names begin with the specified prefix.

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.

listContainers()

Returns an enumerable collection of containers for the service client associated with this container.

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.

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.

listContainersSegmented()

Returns a result segment of an enumerable collection of containers for the service client associated with this container.

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.

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.

releaseLease(final AccessCondition accessCondition)

Releases the lease on the container.

releaseLease(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Releases the lease on the container using the specified access conditions, request options, and operation context.

renewLease(final AccessCondition accessCondition)

Renews an existing lease with the specified access conditions.

renewLease(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Renews an existing lease with the specified access conditions, request options, and operation context.

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.

setProperties(final BlobContainerProperties properties)

Sets the properties for the container.

setStorageUri(final StorageUri storageUri)

Sets the list of URIs for all locations.

uploadMetadata()

Uploads the container's metadata.

uploadMetadata(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Uploads the container's metadata using the specified request options and operation context.

uploadPermissions(final BlobContainerPermissions permissions)

Uploads the container's permissions.

uploadPermissions(final BlobContainerPermissions permissions, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Uploads the container's permissions using the specified request options and operation context.

Applies to