public final class CloudPageBlob extends CloudBlob
blobServiceClient, parent, streamMinimumReadSizeInBytes, streamWriteSizeInBytes| Constructor and Description |
|---|
CloudPageBlob(CloudPageBlob otherBlob)
Creates an instance of the
CloudPageBlob class by copying values from another page blob. |
CloudPageBlob(StorageUri blobAbsoluteUri)
Creates an instance of the
CloudPageBlob class using the specified absolute URI and storage service
client. |
CloudPageBlob(StorageUri blobAbsoluteUri,
CloudBlobClient client)
Creates an instance of the
CloudPageBlob class using the specified URI and cloud blob client. |
CloudPageBlob(StorageUri blobAbsoluteUri,
CloudBlobClient client,
CloudBlobContainer container)
Creates an instance of the
CloudPageBlob class using the specified URI, cloud blob client, and cloud
blob container. |
CloudPageBlob(StorageUri blobAbsoluteUri,
String snapshotID,
CloudBlobClient client)
Creates an instance of the
CloudPageBlob class using the specified URI, snapshot ID, and cloud blob
client. |
CloudPageBlob(URI blobAbsoluteUri)
Creates an instance of the
CloudPageBlob class using the specified absolute URI and storage service
client. |
CloudPageBlob(URI blobAbsoluteUri,
CloudBlobClient client)
Creates an instance of the
CloudPageBlob class using the specified URI and cloud blob client. |
CloudPageBlob(URI blobAbsoluteUri,
CloudBlobClient client,
CloudBlobContainer container)
Creates an instance of the
CloudPageBlob class using the specified URI, cloud blob client, and cloud
blob container. |
CloudPageBlob(URI blobAbsoluteUri,
String snapshotID,
CloudBlobClient client)
Creates an instance of the
CloudPageBlob class using the specified URI, snapshot ID, and cloud blob
client. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearPages(long offset,
long length)
Clears pages from a page blob.
|
void |
clearPages(long offset,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Clears pages from a page blob using the specified lease ID, request options, and operation context.
|
void |
create(long length)
Creates a page blob.
|
void |
create(long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Creates a page blob using the specified request options and operation context.
|
ArrayList<PageRange> |
downloadPageRanges()
Returns a collection of page ranges and their starting and ending byte offsets.
|
ArrayList<PageRange> |
downloadPageRanges(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Returns a collection of page ranges and their starting and ending byte offsets using the specified request
options and operation context.
|
BlobOutputStream |
openWriteExisting()
Opens an output stream object to write data to the page blob.
|
BlobOutputStream |
openWriteExisting(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Opens an output stream object to write data to the page blob, using the specified lease ID, request options and
operation context.
|
BlobOutputStream |
openWriteNew(long length)
Opens an output stream object to write data to the page blob.
|
BlobOutputStream |
openWriteNew(long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Opens an output stream object to write data to the page blob, using the specified lease ID, request options and
operation context.
|
void |
resize(long size)
Resizes the page blob to the specified size.
|
void |
resize(long size,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Resizes the page blob to the specified size.
|
void |
setStreamWriteSizeInBytes(int streamWriteSizeInBytes)
Sets the number of bytes to buffer when writing to a
BlobOutputStream. |
protected void |
updateSequenceNumberFromResponse(HttpURLConnection request) |
void |
upload(InputStream sourceStream,
long length)
Uploads the source stream data to the page blob.
|
void |
upload(InputStream sourceStream,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Uploads the source stream data to the page blob using the specified lease ID, request options, and operation
context.
|
void |
uploadPages(InputStream sourceStream,
long offset,
long length)
Uploads a range of contiguous pages, up to 4 MB in size, at the specified offset in the page blob.
|
void |
uploadPages(InputStream sourceStream,
long offset,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Uploads a range of contiguous pages, up to 4 MB in size, at the specified offset in the page blob, using the
specified lease ID, request options, and operation context.
|
abortCopy, abortCopy, acquireLease, acquireLease, assertCorrectBlobType, assertNoWriteOperationForSnapshot, breakLease, breakLease, changeLease, changeLease, createSnapshot, createSnapshot, createSnapshot, delete, delete, deleteIfExists, deleteIfExists, download, download, downloadAttributes, downloadAttributes, downloadRange, downloadRange, downloadRangeInternal, downloadRangeToByteArray, downloadRangeToByteArray, downloadToByteArray, downloadToByteArray, downloadToFile, downloadToFile, exists, exists, generateSharedAccessSignature, generateSharedAccessSignature, getContainer, getCopyState, getMetadata, getName, getParent, getParentNameFromURI, getProperties, getQualifiedStorageUri, getQualifiedUri, getServiceClient, getSnapshotID, getStorageUri, getStreamMinimumReadSizeInBytes, getStreamWriteSizeInBytes, getTransformedAddress, getUri, isSnapshot, openInputStream, openInputStream, parseURIQueryStringAndVerify, releaseLease, releaseLease, renewLease, renewLease, setContainer, setMetadata, setProperties, setSnapshotID, setStorageUri, setStreamMinimumReadSizeInBytes, startCopyFromBlob, startCopyFromBlob, startCopyFromBlob, startCopyFromBlob, updateEtagAndLastModifiedFromResponse, updateLengthFromResponse, uploadFromByteArray, uploadFromByteArray, uploadFromFile, uploadFromFile, uploadMetadata, uploadMetadata, uploadProperties, uploadPropertiespublic CloudPageBlob(URI blobAbsoluteUri) throws StorageException
CloudPageBlob class using the specified absolute URI and storage service
client.blobAbsoluteUri - A java.net.URI object which represents the absolute URI to the blob.StorageException - If a storage service error occurred.public CloudPageBlob(StorageUri blobAbsoluteUri) throws StorageException
CloudPageBlob class using the specified absolute URI and storage service
client.blobAbsoluteUri - A StorageUri object which represents the absolute URI to the blob.StorageException - If a storage service error occurred.public CloudPageBlob(CloudPageBlob otherBlob)
CloudPageBlob class by copying values from another page blob.otherBlob - A CloudPageBlob object which represents the page blob to copy.public CloudPageBlob(URI blobAbsoluteUri, CloudBlobClient client) throws StorageException
CloudPageBlob class using the specified URI and cloud blob client.blobAbsoluteUri - A java.net.URI object which represents the absolute URI to the blob.client - A CloudBlobClient object that specifies the endpoint for the Blob service.StorageException - If a storage service error occurred.public CloudPageBlob(StorageUri blobAbsoluteUri, CloudBlobClient client) throws StorageException
CloudPageBlob class using the specified URI and cloud blob client.blobAbsoluteUri - A StorageUri object which represents the absolute URI to the blob.client - A CloudBlobClient object that specifies the endpoint for the Blob service.StorageException - If a storage service error occurred.public CloudPageBlob(URI blobAbsoluteUri, CloudBlobClient client, CloudBlobContainer container) throws StorageException
CloudPageBlob class using the specified URI, cloud blob client, and cloud
blob container.blobAbsoluteUri - A java.net.URI object which represents the absolute URI to the blob.client - A CloudBlobClient object that specifies the endpoint for the Blob service.container - A CloudBlobContainer object which represents the container to use for the blob.StorageException - If a storage service error occurred.public CloudPageBlob(StorageUri blobAbsoluteUri, CloudBlobClient client, CloudBlobContainer container) throws StorageException
CloudPageBlob class using the specified URI, cloud blob client, and cloud
blob container.blobAbsoluteUri - A StorageUri object which represents the absolute URI to the blob.client - A CloudBlobClient object that specifies the endpoint for the Blob service.container - A CloudBlobContainer object which represents the container to use for the blob.StorageException - If a storage service error occurred.public CloudPageBlob(URI blobAbsoluteUri, String snapshotID, CloudBlobClient client) throws StorageException
CloudPageBlob class using the specified URI, snapshot ID, and cloud blob
client.blobAbsoluteUri - A java.net.URI object which represents the absolute URI to the blob.snapshotID - A String which represents the snapshot version, if applicable.client - A CloudBlobContainer object which represents the container to use for the blob.StorageException - If a storage service error occurred.public CloudPageBlob(StorageUri blobAbsoluteUri, String snapshotID, CloudBlobClient client) throws StorageException
CloudPageBlob class using the specified URI, snapshot ID, and cloud blob
client.blobAbsoluteUri - A StorageUri object which represents the absolute URI to the blob.snapshotID - A String which represents the snapshot version, if applicable.client - A CloudBlobContainer object which represents the container to use for the blob.StorageException - If a storage service error occurred.@DoesServiceRequest public void clearPages(long offset, long length) throws StorageException
Calling clearPages releases the storage space used by the specified pages. Pages that have been
cleared are no longer tracked as part of the page blob, and no longer incur a charge against the storage account.
offset - The offset, in bytes, at which to begin clearing pages. This value must be a multiple of 512.length - The length, in bytes, of the data range to be cleared. This value must be a multiple of 512.StorageException - If a storage service error occurred.@DoesServiceRequest public void clearPages(long offset, long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
Calling clearPages releases the storage space used by the specified pages. Pages that have been
cleared are no longer tracked as part of the page blob, and no longer incur a charge against the storage account.
offset - A long which represents the offset, in bytes, at which to begin clearing pages. This
value must be a multiple of 512.length - A long which represents the length, in bytes, of the data range to be cleared. This value
must be a multiple of 512.accessCondition - An AccessCondition object which 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 which 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 create(long length) throws StorageException
length - A long which represents the size, in bytes, of the page blob.IllegalArgumentException - If the length is not a multiple of 512.StorageException - If a storage service error occurred.@DoesServiceRequest public void create(long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
length - A long which represents the size, in bytes, of the page blob.accessCondition - An AccessCondition object which 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 which 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.IllegalArgumentException - If the length is not a multiple of 512.StorageException - If a storage service error occurred.@DoesServiceRequest public ArrayList<PageRange> downloadPageRanges() throws StorageException
The start and end byte offsets for each page range are inclusive.
ArrayList object which represents the set of page ranges and their starting and ending
byte offsets.StorageException - If a storage service error occurred.@DoesServiceRequest public ArrayList<PageRange> downloadPageRanges(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
accessCondition - An AccessCondition object which 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 which 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.ArrayList object which represents the set of page ranges and their starting and ending
byte offsets.StorageException - If a storage service error occurred.@DoesServiceRequest public BlobOutputStream openWriteExisting() throws StorageException
BlobOutputStream object used to write data to the blob.StorageException - If a storage service error occurred.@DoesServiceRequest public BlobOutputStream openWriteExisting(AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
accessCondition - An AccessCondition object which 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 which 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.BlobOutputStream object used to write data to the blob.StorageException - If a storage service error occurred.@DoesServiceRequest public BlobOutputStream openWriteNew(long length) throws StorageException
length - A long which represents the length, in bytes, of the stream to create. This value must be
a multiple of 512.BlobOutputStream object used to write data to the blob.StorageException - If a storage service error occurred.@DoesServiceRequest public BlobOutputStream openWriteNew(long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
length - A long which represents the length, in bytes, of the stream to create. This value must be
a multiple of 512.accessCondition - An AccessCondition object which 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 which 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.BlobOutputStream object used to write data to the blob.StorageException - If a storage service error occurred.protected void updateSequenceNumberFromResponse(HttpURLConnection request)
public void resize(long size)
throws StorageException
size - A long which represents the size of the page blob, in bytes.StorageException - If a storage service error occurred.public void resize(long size,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
throws StorageException
size - A long which represents the size of the page blob, in bytes.accessCondition - An AccessCondition object which 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 which 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 upload(InputStream sourceStream, long length) throws StorageException, IOException
upload in class CloudBlobsourceStream - An IntputStream object to read from.length - A long which represents the length, in bytes, of the stream data, must be non zero and a
multiple of 512.IOException - If an I/O exception occurred.StorageException - If a storage service error occurred.@DoesServiceRequest public void upload(InputStream sourceStream, long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
upload in class CloudBlobsourceStream - An IntputStream object to read from.length - A long which represents the length, in bytes, of the stream data. This must be great than
zero and a multiple of 512.accessCondition - An AccessCondition object which 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 which 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.IOException - If an I/O exception occurred.StorageException - If a storage service error occurred.@DoesServiceRequest public void uploadPages(InputStream sourceStream, long offset, long length) throws StorageException, IOException
sourceStream - An IntputStream object which represents the input stream to write to the page blob.offset - A long which represents the offset, in number of bytes, at which to begin writing the
data. This value must be a multiple of 512.length - A long which represents the length, in bytes, of the data to write. This value must be a
multiple of 512.IllegalArgumentException - If the offset or length are not multiples of 512, or if the length is greater than 4 MB.IOException - If an I/O exception occurred.StorageException - If a storage service error occurred.@DoesServiceRequest public void uploadPages(InputStream sourceStream, long offset, long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
sourceStream - An IntputStream object which represents the input stream to write to the page blob.offset - A long which represents the offset, in number of bytes, at which to begin writing the
data. This value must be a multiple of
512.length - A long which represents the length, in bytes, of the data to write. This value must be a
multiple of 512.accessCondition - An AccessCondition object which 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 which 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.IllegalArgumentException - If the offset or length are not multiples of 512, or if the length is greater than 4 MB.IOException - If an I/O exception occurred.StorageException - If a storage service error occurred.public void setStreamWriteSizeInBytes(int streamWriteSizeInBytes)
BlobOutputStream.setStreamWriteSizeInBytes in class CloudBlobpageBlobStreamWriteSizeInBytes - An int which represents the maximum number of bytes to buffer when writing to a page blob
stream. This value must be a
multiple of 512 and
less than or equal to 4 MB.IllegalArgumentException - If streamWriteSizeInBytes is less than 512, greater than 4 MB, or not a multiple or 512./**
* 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.
*/