public final class CloudPageBlob extends CloudBlob
blobServiceClient, parent, streamMinimumReadSizeInBytes, streamWriteSizeInBytes
Modifier | 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,
StorageCredentials credentials)
Creates an instance of the
CloudPageBlob class using the specified absolute StorageUri and credentials. |
|
CloudPageBlob(StorageUri blobAbsoluteUri,
String snapshotID,
StorageCredentials credentials)
Creates an instance of the
CloudPageBlob class using the specified absolute StorageUri, snapshot
ID, and credentials. |
protected |
CloudPageBlob(String blobName,
String snapshotID,
CloudBlobContainer container)
Creates an instance of the
CloudPageBlob class using the specified type, name, snapshot ID, and
container. |
|
CloudPageBlob(URI blobAbsoluteUri)
Creates an instance of the
CloudPageBlob class using the specified absolute URI and storage service
client. |
|
CloudPageBlob(URI blobAbsoluteUri,
StorageCredentials credentials)
Creates an instance of the
CloudPageBlob class using the specified absolute URI and credentials. |
|
CloudPageBlob(URI blobAbsoluteUri,
String snapshotID,
StorageCredentials credentials)
Creates an instance of the
CloudPageBlob class using the specified absolute URI, snapshot ID, and
credentials. |
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.
|
void |
create(long length,
PremiumPageBlobTier premiumBlobTier,
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.
|
List<PageRange> |
downloadPageRanges(long offset,
Long length)
Returns a collection of page ranges and their starting and ending byte offsets.
|
List<PageRange> |
downloadPageRanges(long offset,
Long length,
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.
|
List<PageRangeDiff> |
downloadPageRangesDiff(String previousSnapshot)
Gets the collection of page ranges that differ between a specified snapshot and this object.
|
List<PageRangeDiff> |
downloadPageRangesDiff(String previousSnapshot,
Long offset,
Long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Gets the collection of page ranges that differ between a specified snapshot and this object.
|
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.
|
BlobOutputStream |
openWriteNew(long length,
PremiumPageBlobTier premiumBlobTier,
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 . |
String |
startCopy(CloudPageBlob sourceBlob)
Requests the service to start copying a blob's contents, properties, and metadata to a new blob.
|
String |
startCopy(CloudPageBlob sourceBlob,
AccessCondition sourceAccessCondition,
AccessCondition destinationAccessCondition,
BlobRequestOptions options,
OperationContext opContext)
Requests the service to start copying a blob's contents, properties, and metadata to a new blob, using the
specified access conditions, lease ID, request options, and operation context.
|
String |
startCopy(CloudPageBlob sourceBlob,
PremiumPageBlobTier premiumBlobTier,
AccessCondition sourceAccessCondition,
AccessCondition destinationAccessCondition,
BlobRequestOptions options,
OperationContext opContext)
Requests the service to start copying a blob's contents, properties, and metadata to a new blob, using the
specified blob tier, access conditions, lease ID, request options, and operation context.
|
String |
startIncrementalCopy(CloudPageBlob sourceSnapshot)
Requests the service to start an incremental copy of another page blob's contents, properties, and metadata
to this blob.
|
String |
startIncrementalCopy(CloudPageBlob sourceSnapshot,
AccessCondition destinationAccessCondition,
BlobRequestOptions options,
OperationContext opContext)
Requests the service to start copying a blob's contents, properties, and metadata to a new blob, using the
specified access conditions, lease ID, request options, and operation context.
|
String |
startIncrementalCopy(URI sourceSnapshot)
Requests the service to start an incremental copy of another page blob's contents, properties, and metadata
to this blob.
|
String |
startIncrementalCopy(URI sourceSnapshot,
AccessCondition destinationAccessCondition,
BlobRequestOptions options,
OperationContext opContext)
Requests the service to start copying a blob's contents, properties, and metadata to a new blob, using the
specified access conditions, lease ID, request options, and operation context.
|
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 |
upload(InputStream sourceStream,
long length,
PremiumPageBlobTier premiumBlobTier,
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 |
uploadFromByteArray(byte[] buffer,
int offset,
int length,
PremiumPageBlobTier premiumBlobTier,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Uploads a blob from data in a byte array.
|
void |
uploadFromFile(String path,
PremiumPageBlobTier premiumBlobTier,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Uploads a blob from a file.
|
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.
|
void |
uploadPremiumPageBlobTier(PremiumPageBlobTier premiumBlobTier)
Sets the blob tier on a page blob on a premium storage account.
|
void |
uploadPremiumPageBlobTier(PremiumPageBlobTier premiumBlobTier,
BlobRequestOptions options,
OperationContext opContext)
Sets the tier on a page blob on a premium storage account.
|
abortCopy, abortCopy, acquireLease, 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, generateSharedAccessSignature, getContainer, getCopyState, getMetadata, getName, getParent, getParentNameFromURI, getProperties, getQualifiedStorageUri, getQualifiedUri, getServiceClient, getSnapshotID, getSnapshotQualifiedStorageUri, getSnapshotQualifiedUri, getStorageUri, getStreamMinimumReadSizeInBytes, getStreamWriteSizeInBytes, getTransformedAddress, getUri, isSnapshot, openInputStream, openInputStream, releaseLease, releaseLease, renewLease, renewLease, setContainer, setMetadata, setProperties, setSnapshotID, setStorageUri, setStreamMinimumReadSizeInBytes, startCopy, startCopy, startCopy, startCopyImpl, updateEtagAndLastModifiedFromResponse, updateLengthFromResponse, uploadBlobTierImpl, uploadFromByteArray, uploadFromByteArray, uploadFromFile, uploadFromFile, uploadMetadata, uploadMetadata, uploadProperties, uploadProperties
public 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, StorageCredentials credentials) throws StorageException
CloudPageBlob
class using the specified absolute URI and credentials.blobAbsoluteUri
- A java.net.URI
object that represents the absolute URI to the blob.credentials
- A StorageCredentials
object used to authenticate access.StorageException
- If a storage service error occurred.public CloudPageBlob(URI blobAbsoluteUri, String snapshotID, StorageCredentials credentials) throws StorageException
CloudPageBlob
class using the specified absolute URI, snapshot ID, and
credentials.blobAbsoluteUri
- A java.net.URI
object that represents the absolute URI to the blob.snapshotID
- A String
that represents the snapshot version, if applicable.credentials
- A StorageCredentials
object used to authenticate access.StorageException
- If a storage service error occurred.public CloudPageBlob(StorageUri blobAbsoluteUri, StorageCredentials credentials) throws StorageException
CloudPageBlob
class using the specified absolute StorageUri and credentials.blobAbsoluteUri
- A StorageUri
object that represents the absolute URI to the blob.credentials
- A StorageCredentials
object used to authenticate access.StorageException
- If a storage service error occurred.public CloudPageBlob(StorageUri blobAbsoluteUri, String snapshotID, StorageCredentials credentials) throws StorageException
CloudPageBlob
class using the specified absolute StorageUri, snapshot
ID, and credentials.blobAbsoluteUri
- A StorageUri
object that represents the absolute URI to the blob.snapshotID
- A String
that represents the snapshot version, if applicable.credentials
- A StorageCredentials
object used to authenticate access.StorageException
- If a storage service error occurred.protected CloudPageBlob(String blobName, String snapshotID, CloudBlobContainer container) throws URISyntaxException
CloudPageBlob
class using the specified type, name, snapshot ID, and
container.blobName
- Name of the blob.snapshotID
- A String
that represents the snapshot version, if applicable.container
- The reference to the parent container.URISyntaxException
- If the resource URI is invalid.@DoesServiceRequest public final String startCopy(CloudPageBlob sourceBlob) throws StorageException, URISyntaxException
sourceBlob
- A CloudPageBlob
object that represents the source blob to copy.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@DoesServiceRequest public final String startCopy(CloudPageBlob sourceBlob, AccessCondition sourceAccessCondition, AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException
sourceBlob
- A CloudPageBlob
object that represents the source blob to copy.sourceAccessCondition
- An AccessCondition
object that represents the access conditions for the source blob.destinationAccessCondition
- An AccessCondition
object that represents the access conditions for the destination 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 that 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.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@DoesServiceRequest public final String startCopy(CloudPageBlob sourceBlob, PremiumPageBlobTier premiumBlobTier, AccessCondition sourceAccessCondition, AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException
sourceBlob
- A CloudPageBlob
object that represents the source blob to copy.premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the blob.sourceAccessCondition
- An AccessCondition
object that represents the access conditions for the source blob.destinationAccessCondition
- An AccessCondition
object that represents the access conditions for the destination 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 that 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.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@DoesServiceRequest public final String startIncrementalCopy(CloudPageBlob sourceSnapshot) throws StorageException, URISyntaxException
sourceSnapshot
- A CloudPageBlob
object that represents the source blob to copy. Must be a snapshot.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@DoesServiceRequest public final String startIncrementalCopy(URI sourceSnapshot) throws StorageException, URISyntaxException
sourceSnapshot
- A CloudPageBlob
object that represents the source blob to copy. Must be a snapshot.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@DoesServiceRequest public final String startIncrementalCopy(CloudPageBlob sourceSnapshot, AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException
sourceSnapshot
- A CloudPageBlob
object that represents the source blob to copy. Must be a snapshot.destinationAccessCondition
- An AccessCondition
object that represents the access conditions for the destination 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 that 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.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@DoesServiceRequest public final String startIncrementalCopy(URI sourceSnapshot, AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException
sourceSnapshot
- A CloudPageBlob
object that represents the source blob to copy. Must be a snapshot.destinationAccessCondition
- An AccessCondition
object that represents the access conditions for the destination 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 that 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.String
which represents the copy ID associated with the copy operation.StorageException
- If a storage service error occurred.URISyntaxException
@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
create(long, AccessCondition, BlobRequestOptions, OperationContext)
overload with AccessCondition.generateIfNotExistsCondition()
.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
AccessCondition.generateIfNotExistsCondition()
.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 void create(long length, PremiumPageBlobTier premiumBlobTier, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
AccessCondition.generateIfNotExistsCondition()
.length
- A long
which represents the size, in bytes, of the page blob.premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the 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 List<PageRange> downloadPageRanges(long offset, Long length) throws StorageException
offset
- The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of
512.length
- The length of the data range over which to list page ranges, in bytes. Must be a multiple of 512.List
object which represents the set of page ranges and their starting and ending
byte offsets.StorageException
- If a storage service error occurred.@DoesServiceRequest public List<PageRange> downloadPageRanges(long offset, Long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
offset
- The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of
512.length
- The length of the data range over which to list page ranges, in bytes. 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.List
object which represents the set of page ranges and their starting and ending
byte offsets.StorageException
- If a storage service error occurred.@DoesServiceRequest public List<PageRangeDiff> downloadPageRangesDiff(String previousSnapshot) throws StorageException
previousSnapshot
- A string representing the snapshot to use as the starting point for the diff. If this
CloudPageBlob represents a snapshot, the previousSnapshot parameter must be prior to the current
snapshot.List
object containing the set of differing page ranges.StorageException
- If a storage service error occurred.@DoesServiceRequest public List<PageRangeDiff> downloadPageRangesDiff(String previousSnapshot, Long offset, Long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
previousSnapshot
- A string representing the snapshot timestamp to use as the starting point for the diff. If this
CloudPageBlob represents a snapshot, the previousSnapshot parameter must be prior to the current
snapshot.offset
- The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of
512.length
- The length of the data range over which to list page ranges, in bytes. 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.List
object containing the set of differing page ranges.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
To avoid overwriting and instead throw an error, please use the
openWriteNew(long, AccessCondition, BlobRequestOptions, OperationContext)
overload with the appropriate
AccessCondition
.
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
To avoid overwriting and instead throw an error, please pass in an AccessCondition
generated using
AccessCondition.generateIfNotExistsCondition()
.
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.@DoesServiceRequest public BlobOutputStream openWriteNew(long length, PremiumPageBlobTier premiumBlobTier, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException
To avoid overwriting and instead throw an error, please pass in an AccessCondition
generated using
AccessCondition.generateIfNotExistsCondition()
.
length
- A long
which represents the length, in bytes, of the stream to create. This value must be
a multiple of 512.premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the 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.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.public void uploadFromByteArray(byte[] buffer, int offset, int length, PremiumPageBlobTier premiumBlobTier, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
buffer
- A byte
array which represents the data to write to the blob.offset
- A int
which represents the offset of the byte array from which to start the data upload.length
- An int
which represents the number of bytes to upload from the input buffer.premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the blob.accessCondition
- An AccessCondition
object that 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 that 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.IOException
public void uploadFromFile(String path, PremiumPageBlobTier premiumBlobTier, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
path
- A String
which represents the path to the file to be uploaded.premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the blob.accessCondition
- An AccessCondition
object that 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 that 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.IOException
@DoesServiceRequest public void upload(InputStream sourceStream, long length) throws StorageException, IOException
upload
in class CloudBlob
sourceStream
- An InputStream
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 CloudBlob
sourceStream
- An InputStream
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 upload(InputStream sourceStream, long length, PremiumPageBlobTier premiumBlobTier, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
sourceStream
- An InputStream
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.premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the 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.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 InputStream
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 InputStream
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 CloudBlob
streamWriteSizeInBytes
- 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.@DoesServiceRequest public void uploadPremiumPageBlobTier(PremiumPageBlobTier premiumBlobTier) throws StorageException
premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of the blob.StorageException
- If a storage service error occurred.@DoesServiceRequest public void uploadPremiumPageBlobTier(PremiumPageBlobTier premiumBlobTier, BlobRequestOptions options, OperationContext opContext) throws StorageException
premiumBlobTier
- A PremiumPageBlobTier
object which represents the tier of 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.Copyright © 2019. All rights reserved.