CloudBlockBlob Class

Definition

Represents a blob that is uploaded as a set of blocks.

public class CloudBlockBlob extends CloudBlob
Inheritance
java.lang.Object
CloudBlockBlob

Inherited Members

Constructors

CloudBlockBlob(final CloudBlockBlob otherBlob)

Creates an instance of the class by copying values from another cloud block blob.

CloudBlockBlob(final StorageUri blobAbsoluteUri)

Creates an instance of the class using the specified absolute StorageUri.

CloudBlockBlob(final StorageUri blobAbsoluteUri, final StorageCredentials credentials)

Creates an instance of the class using the specified absolute StorageUri and credentials.

CloudBlockBlob(final StorageUri blobAbsoluteUri, final String snapshotID, final StorageCredentials credentials)

Creates an instance of the class using the specified absolute StorageUri, snapshot ID, and credentials.

CloudBlockBlob(final URI blobAbsoluteUri)

Creates an instance of the class using the specified absolute URI.

CloudBlockBlob(final URI blobAbsoluteUri, final StorageCredentials credentials)

Creates an instance of the class using the specified absolute URI and credentials.

CloudBlockBlob(final URI blobAbsoluteUri, final String snapshotID, final StorageCredentials credentials)

Creates an instance of the class using the specified absolute URI, snapshot ID, and credentials.

CloudBlockBlob(String blobName, String snapshotID, CloudBlobContainer container)

Creates an instance of the class using the specified type, name, snapshot ID, and container.

Methods

commitBlockList(final Iterable<BlockEntry> blockList)

Commits a block list to the storage service. In order to be written as part of a blob, a block must have been successfully written to the server in a prior uploadBlock operation.

commitBlockList(final Iterable<BlockEntry> blockList, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Commits a block list to the storage service using the specified lease ID, request options, and operation context. In order to be written as part of a blob, a block must have been successfully written to the server in a prior uploadBlock operation.

downloadBlockList()

Downloads the committed block list from the block blob.

The committed block list includes the list of blocks that have been successfully committed to the block blob. The list of committed blocks is returned in the same order that they were committed to the blob. No block may appear more than once in the committed block list.

downloadBlockList(final BlockListingFilter blockListingFilter, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Downloads the block list from the block blob using the specified block listing filter, request options, and operation context.

The committed block list includes the list of blocks that have been successfully committed to the block blob. The list of committed blocks is returned in the same order that they were committed to the blob. No block may appear more than once in the committed block list.

downloadText()

Downloads a blob to a string using the platform's default encoding.

downloadText(final String charsetName, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Downloads a blob to a string using the specified encoding.

isStreamWriteSizeModified()

Gets the flag that indicates whether the default streamWriteSize was modified.

openOutputStream()

Creates and opens an output stream to write data to the block blob. If the blob already exists on the service, it will be overwritten.

To avoid overwriting and instead throw an error, please use the openOutputStream(AccessCondition, BlobRequestOptions, OperationContext) overload with the appropriate AccessCondition.

openOutputStream(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Creates and opens an output stream to write data to the block blob using the specified request options and operation context. If the blob already exists on the service, it will be overwritten.

To avoid overwriting and instead throw an error, please pass in an AccessCondition generated using AccessCondition#generateIfNotExistsCondition().

setStreamWriteSizeInBytes(final int streamWriteSizeInBytes)

Sets the number of bytes to buffer when writing to a BlobOutputStream.

startCopy(final CloudBlockBlob sourceBlob)

Requests the service to start copying a block blob's contents, properties, and metadata to a new block blob.

startCopy(final CloudBlockBlob sourceBlob, final AccessCondition sourceAccessCondition, final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext)

Requests the service to start copying a block blob's contents, properties, and metadata to a new block blob, using the specified access conditions, lease ID, request options, and operation context.

startCopy(final CloudFile sourceFile)

Requests the service to start copying a file's contents, properties, and metadata to a new block blob.

startCopy(final CloudFile sourceFile, final AccessCondition sourceAccessCondition, final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext)

Requests the service to start copying a file's contents, properties, and metadata to a new block blob, using the specified access conditions, lease ID, request options, and operation context.

upload(final InputStream sourceStream, final long length)

Uploads the source stream data to the block blob. If the blob already exists on the service, it will be overwritten.

upload(final InputStream sourceStream, final long length, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Uploads the source stream data to the blob, using the specified lease ID, request options, and operation context. If the blob already exists on the service, it will be overwritten.

uploadBlock(final String blockId, final InputStream sourceStream, final long length)

Uploads a block to be committed as part of the block blob, using the specified block ID.

uploadBlock(final String blockId, final InputStream sourceStream, final long length, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Uploads a block to be committed as part of the block blob, using the specified block ID, the specified lease ID, request options, and operation context.

uploadFullBlob(final InputStream sourceStream, final long length, final AccessCondition accessCondition, final BlobRequestOptions options, final OperationContext opContext)

Uploads a blob in a single operation.

uploadStandardBlobTier(final StandardBlobTier standardBlobTier)

Sets the blob tier on a block blob on a standard storage account.

uploadStandardBlobTier(final StandardBlobTier standardBlobTier, BlobRequestOptions options, OperationContext opContext)

Sets the tier on a block blob on a standard storage account.

uploadText(final String content)

Uploads a blob from a string using the platform's default encoding. If the blob already exists on the service, it will be overwritten.

uploadText(final String content, final String charsetName, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)

Uploads a blob from a string using the specified encoding. If the blob already exists on the service, it will be overwritten.