Class BlockBlobURL
- java.lang.Object
-
- com.microsoft.azure.storage.blob.StorageURL
-
- com.microsoft.azure.storage.blob.BlobURL
-
- com.microsoft.azure.storage.blob.BlockBlobURL
-
public final class BlockBlobURL extends BlobURL
Represents a URL to a block blob. It may be obtained by direct construction or via the create method on aContainerURL
object. This class does not hold any state about a particular blob but is instead a convenient way of sending off appropriate requests to the resource on the service. Please refer to the Azure Docs for more information on block blobs.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_BLOCKS
Indicates the maximum number of blocks allowed in a block blob.static int
MAX_STAGE_BLOCK_BYTES
Indicates the maximum number of bytes that can be sent in a call to stageBlock.static int
MAX_UPLOAD_BLOB_BYTES
Indicates the maximum number of bytes that can be sent in a call to upload.-
Fields inherited from class com.microsoft.azure.storage.blob.StorageURL
storageClient
-
-
Constructor Summary
Constructors Constructor Description BlockBlobURL(URL url, com.microsoft.rest.v2.http.HttpPipeline pipeline)
Creates aBlockBlobURL
object pointing to the account specified by the URL and using the provided pipeline to make HTTP requests.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.Single<BlockBlobCommitBlockListResponse>
commitBlockList(List<String> base64BlockIDs)
Writes a blob by specifying the list of block IDs that are to make up the blob.io.reactivex.Single<BlockBlobCommitBlockListResponse>
commitBlockList(List<String> base64BlockIDs, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, com.microsoft.rest.v2.Context context)
Writes a blob by specifying the list of block IDs that are to make up the blob.io.reactivex.Single<BlockBlobGetBlockListResponse>
getBlockList(BlockListType listType)
Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter.io.reactivex.Single<BlockBlobGetBlockListResponse>
getBlockList(BlockListType listType, LeaseAccessConditions leaseAccessConditions, com.microsoft.rest.v2.Context context)
Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter.io.reactivex.Single<BlockBlobStageBlockResponse>
stageBlock(String base64BlockID, io.reactivex.Flowable<ByteBuffer> data, long length)
Uploads the specified block to the block blob's "staging area" to be later committed by a call to commitBlockList.io.reactivex.Single<BlockBlobStageBlockResponse>
stageBlock(String base64BlockID, io.reactivex.Flowable<ByteBuffer> data, long length, LeaseAccessConditions leaseAccessConditions, com.microsoft.rest.v2.Context context)
Uploads the specified block to the block blob's "staging area" to be later committed by a call to commitBlockList.io.reactivex.Single<BlockBlobStageBlockFromURLResponse>
stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange)
Creates a new block to be committed as part of a blob where the contents are read from a URL.io.reactivex.Single<BlockBlobStageBlockFromURLResponse>
stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange, byte[] sourceContentMD5, LeaseAccessConditions leaseAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, com.microsoft.rest.v2.Context context)
Creates a new block to be committed as part of a blob where the contents are read from a URL.io.reactivex.Single<BlockBlobUploadResponse>
upload(io.reactivex.Flowable<ByteBuffer> data, long length)
Creates a new block blob, or updates the content of an existing block blob.io.reactivex.Single<BlockBlobUploadResponse>
upload(io.reactivex.Flowable<ByteBuffer> data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, com.microsoft.rest.v2.Context context)
Creates a new block blob, or updates the content of an existing block blob.BlockBlobURL
withPipeline(com.microsoft.rest.v2.http.HttpPipeline pipeline)
Creates a newBlockBlobURL
with the given pipeline.BlockBlobURL
withSnapshot(String snapshot)
Creates a newBlockBlobURL
with the given snapshot.-
Methods inherited from class com.microsoft.azure.storage.blob.BlobURL
abortCopyFromURL, abortCopyFromURL, acquireLease, acquireLease, breakLease, breakLease, changeLease, changeLease, createSnapshot, createSnapshot, delete, delete, download, download, getAccountInfo, getAccountInfo, getProperties, getProperties, releaseLease, releaseLease, renewLease, renewLease, setHTTPHeaders, setHTTPHeaders, setMetadata, setMetadata, setTier, setTier, startCopyFromURL, startCopyFromURL, syncCopyFromURL, syncCopyFromURL, toAppendBlobURL, toBlockBlobURL, toPageBlobURL, undelete, undelete
-
Methods inherited from class com.microsoft.azure.storage.blob.StorageURL
appendToURLPath, createPipeline, createPipeline, createPipeline, createPipeline, toString, toURL
-
-
-
-
Field Detail
-
MAX_UPLOAD_BLOB_BYTES
public static final int MAX_UPLOAD_BLOB_BYTES
Indicates the maximum number of bytes that can be sent in a call to upload.- See Also:
- Constant Field Values
-
MAX_STAGE_BLOCK_BYTES
public static final int MAX_STAGE_BLOCK_BYTES
Indicates the maximum number of bytes that can be sent in a call to stageBlock.- See Also:
- Constant Field Values
-
MAX_BLOCKS
public static final int MAX_BLOCKS
Indicates the maximum number of blocks allowed in a block blob.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BlockBlobURL
public BlockBlobURL(URL url, com.microsoft.rest.v2.http.HttpPipeline pipeline)
Creates aBlockBlobURL
object pointing to the account specified by the URL and using the provided pipeline to make HTTP requests.- Parameters:
url
- AURL
to an Azure Storage block blob.pipeline
- AHttpPipeline
which configures the behavior of HTTP exchanges. Please refer toStorageURL.createPipeline(ICredentials, PipelineOptions)
for more information.
-
-
Method Detail
-
withPipeline
public BlockBlobURL withPipeline(com.microsoft.rest.v2.http.HttpPipeline pipeline)
Creates a newBlockBlobURL
with the given pipeline.- Overrides:
withPipeline
in classBlobURL
- Parameters:
pipeline
- AnHttpPipeline
object to set.- Returns:
- A
BlockBlobURL
object with the given pipeline.
-
withSnapshot
public BlockBlobURL withSnapshot(String snapshot) throws MalformedURLException, UnknownHostException
Creates a newBlockBlobURL
with the given snapshot.- Overrides:
withSnapshot
in classBlobURL
- Parameters:
snapshot
- AString
of the snapshot identifier.- Returns:
- A
BlockBlobURL
object with the given pipeline. - Throws:
MalformedURLException
- Appending the specified snapshot produced an invalid URL.UnknownHostException
- If the url contains an improperly formatted ipaddress or unknown host address.
-
upload
public io.reactivex.Single<BlockBlobUploadResponse> upload(io.reactivex.Flowable<ByteBuffer> data, long length)
Creates a new block blob, or updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with PutBlob; the content of the existing blob is overwritten with the new content. To perform a partial update of a block blob's, use PutBlock and PutBlockList. For more information, see the Azure Docs.Note that the data passed must be replayable if retries are enabled (the default). In other words, the
Flowable
must produce the same data each time it is subscribed to.For more efficient bulk-upload scenarios, please refer to the
TransferManager
for convenience methods.- Parameters:
data
- The data to write to the blob. Note that thisFlowable
must be replayable if retries are enabled (the default). In other words, the Flowable must produce the same data each time it is subscribed to.length
- The exact length of the data. It is important that this value match precisely the length of the data emitted by theFlowable
.- Returns:
- Emits the successful response.
-
upload
public io.reactivex.Single<BlockBlobUploadResponse> upload(io.reactivex.Flowable<ByteBuffer> data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, com.microsoft.rest.v2.Context context)
Creates a new block blob, or updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with PutBlob; the content of the existing blob is overwritten with the new content. To perform a partial update of a block blob's, use PutBlock and PutBlockList. For more information, see the Azure Docs.Note that the data passed must be replayable if retries are enabled (the default). In other words, the
Flowable
must produce the same data each time it is subscribed to.For more efficient bulk-upload scenarios, please refer to the
TransferManager
for convenience methods.- Parameters:
data
- The data to write to the blob. Note that thisFlowable
must be replayable if retries are enabled (the default). In other words, the Flowable must produce the same data each time it is subscribed to.length
- The exact length of the data. It is important that this value match precisely the length of the data emitted by theFlowable
.headers
-BlobHTTPHeaders
metadata
-Metadata
accessConditions
-BlobAccessConditions
context
-Context
offers a means of passing arbitrary data (key/value pairs) to anHttpPipeline
's policy objects. Most applications do not need to pass arbitrary data to the pipeline and can passContext.NONE
ornull
. Each context object is immutable. ThewithContext
with data method creates a newContext
object that refers to its parent, forming a linked list.- Returns:
- Emits the successful response.
-
stageBlock
public io.reactivex.Single<BlockBlobStageBlockResponse> stageBlock(String base64BlockID, io.reactivex.Flowable<ByteBuffer> data, long length)
Uploads the specified block to the block blob's "staging area" to be later committed by a call to commitBlockList. For more information, see the Azure Docs.Note that the data passed must be replayable if retries are enabled (the default). In other words, the
Flowable
must produce the same data each time it is subscribed to.- Parameters:
base64BlockID
- A Base64 encodedString
that specifies the ID for this block. Note that all block ids for a given blob must be the same length.data
- The data to write to the block. Note that thisFlowable
must be replayable if retries are enabled (the default). In other words, the Flowable must produce the same data each time it is subscribed to.length
- The exact length of the data. It is important that this value match precisely the length of the data emitted by theFlowable
.- Returns:
- Emits the successful response.
-
stageBlock
public io.reactivex.Single<BlockBlobStageBlockResponse> stageBlock(String base64BlockID, io.reactivex.Flowable<ByteBuffer> data, long length, LeaseAccessConditions leaseAccessConditions, com.microsoft.rest.v2.Context context)
Uploads the specified block to the block blob's "staging area" to be later committed by a call to commitBlockList. For more information, see the Azure Docs.Note that the data passed must be replayable if retries are enabled (the default). In other words, the
Flowable
must produce the same data each time it is subscribed to.- Parameters:
base64BlockID
- A Base64 encodedString
that specifies the ID for this block. Note that all block ids for a given blob must be the same length.data
- The data to write to the block. Note that thisFlowable
must be replayable if retries are enabled (the default). In other words, the Flowable must produce the same data each time it is subscribed to.length
- The exact length of the data. It is important that this value match precisely the length of the data emitted by theFlowable
.leaseAccessConditions
- By setting lease access conditions, requests will fail if the provided lease does not match the active lease on the blob.context
-Context
offers a means of passing arbitrary data (key/value pairs) to anHttpPipeline
's policy objects. Most applications do not need to pass arbitrary data to the pipeline and can passContext.NONE
ornull
. Each context object is immutable. ThewithContext
with data method creates a newContext
object that refers to its parent, forming a linked list.- Returns:
- Emits the successful response.
-
stageBlockFromURL
public io.reactivex.Single<BlockBlobStageBlockFromURLResponse> stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange)
Creates a new block to be committed as part of a blob where the contents are read from a URL. For more information, see the Azure Docs.- Parameters:
base64BlockID
- A Base64 encodedString
that specifies the ID for this block. Note that all block ids for a given blob must be the same length.sourceURL
- The url to the blob that will be the source of the copy. A source blob in the same storage account can be authenticated via Shared Key. However, if the source is a blob in another account, the source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the operation.sourceRange
-BlobRange
- Returns:
- Emits the successful response.
-
stageBlockFromURL
public io.reactivex.Single<BlockBlobStageBlockFromURLResponse> stageBlockFromURL(String base64BlockID, URL sourceURL, BlobRange sourceRange, byte[] sourceContentMD5, LeaseAccessConditions leaseAccessConditions, SourceModifiedAccessConditions sourceModifiedAccessConditions, com.microsoft.rest.v2.Context context)
Creates a new block to be committed as part of a blob where the contents are read from a URL. For more information, see the Azure Docs.- Parameters:
base64BlockID
- A Base64 encodedString
that specifies the ID for this block. Note that all block ids for a given blob must be the same length.sourceURL
- The url to the blob that will be the source of the copy. A source blob in the same storage account can be authenticated via Shared Key. However, if the source is a blob in another account, the source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the operation.sourceRange
-BlobRange
sourceContentMD5
- An MD5 hash of the block content from the source blob. If specified, the service will calculate the MD5 of the received data and fail the request if it does not match the provided MD5.leaseAccessConditions
- By setting lease access conditions, requests will fail if the provided lease does not match the active lease on the blob.sourceModifiedAccessConditions
-SourceModifiedAccessConditions
context
-Context
offers a means of passing arbitrary data (key/value pairs) to anHttpPipeline
's policy objects. Most applications do not need to pass arbitrary data to the pipeline and can passContext.NONE
ornull
. Each context object is immutable. ThewithContext
with data method creates a newContext
object that refers to its parent, forming a linked list.- Returns:
- Emits the successful response.
-
getBlockList
public io.reactivex.Single<BlockBlobGetBlockListResponse> getBlockList(BlockListType listType)
Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter. For more information, see the Azure Docs.- Parameters:
listType
- Specifies which type of blocks to return.- Returns:
- Emits the successful response.
-
getBlockList
public io.reactivex.Single<BlockBlobGetBlockListResponse> getBlockList(BlockListType listType, LeaseAccessConditions leaseAccessConditions, com.microsoft.rest.v2.Context context)
Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter. For more information, see the Azure Docs.- Parameters:
listType
- Specifies which type of blocks to return.leaseAccessConditions
- By setting lease access conditions, requests will fail if the provided lease does not match the active lease on the blob.context
-Context
offers a means of passing arbitrary data (key/value pairs) to anHttpPipeline
's policy objects. Most applications do not need to pass arbitrary data to the pipeline and can passContext.NONE
ornull
. Each context object is immutable. ThewithContext
with data method creates a newContext
object that refers to its parent, forming a linked list.- Returns:
- Emits the successful response.
-
commitBlockList
public io.reactivex.Single<BlockBlobCommitBlockListResponse> commitBlockList(List<String> base64BlockIDs)
Writes a blob by specifying the list of block IDs that are to make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior stageBlock operation. You can call commitBlockList to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. Any blocks not specified in the block list and permanently deleted. For more information, see the Azure Docs.For more efficient bulk-upload scenarios, please refer to the
TransferManager
for convenience methods.- Parameters:
base64BlockIDs
- A list of base64 encodeString
s that specifies the block IDs to be committed.- Returns:
- Emits the successful response.
-
commitBlockList
public io.reactivex.Single<BlockBlobCommitBlockListResponse> commitBlockList(List<String> base64BlockIDs, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, com.microsoft.rest.v2.Context context)
Writes a blob by specifying the list of block IDs that are to make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior stageBlock operation. You can call commitBlockList to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. Any blocks not specified in the block list and permanently deleted. For more information, see the Azure Docs.For more efficient bulk-upload scenarios, please refer to the
TransferManager
for convenience methods.- Parameters:
base64BlockIDs
- A list of base64 encodeString
s that specifies the block IDs to be committed.headers
-BlobHTTPHeaders
metadata
-Metadata
accessConditions
-BlobAccessConditions
context
-Context
offers a means of passing arbitrary data (key/value pairs) to anHttpPipeline
's policy objects. Most applications do not need to pass arbitrary data to the pipeline and can passContext.NONE
ornull
. Each context object is immutable. ThewithContext
with data method creates a newContext
object that refers to its parent, forming a linked list.- Returns:
- Emits the successful response.
-
-