public final class CloudAppendBlob extends CloudBlob
| Constructor and Description |
|---|
CloudAppendBlob(CloudAppendBlob otherBlob)
Creates an instance of the
CloudAppendBlob class by copying values from another append blob. |
CloudAppendBlob(StorageUri blobAbsoluteUri)
Creates an instance of the
CloudAppendBlob class using the specified absolute URI and storage service
client. |
CloudAppendBlob(StorageUri blobAbsoluteUri,
StorageCredentials credentials)
Creates an instance of the
CloudAppendBlob class using the specified absolute StorageUri
and credentials. |
CloudAppendBlob(StorageUri blobAbsoluteUri,
String snapshotID,
StorageCredentials credentials)
Creates an instance of the
CloudAppendBlob class using the specified absolute StorageUri, snapshot
ID, and credentials. |
CloudAppendBlob(URI blobAbsoluteUri)
Creates an instance of the
CloudAppendBlob class using the specified absolute URI and storage service
client. |
CloudAppendBlob(URI blobAbsoluteUri,
StorageCredentials credentials)
Creates an instance of the
CloudAppendBlob class using the specified absolute URI and credentials. |
CloudAppendBlob(URI blobAbsoluteUri,
String snapshotID,
StorageCredentials credentials)
Creates an instance of the
CloudAppendBlob class using the specified absolute URI, snapshot ID, and
credentials. |
| Modifier and Type | Method and Description |
|---|---|
void |
append(InputStream sourceStream,
long length)
Appends a stream to an append blob.
|
void |
append(InputStream sourceStream,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Appends a stream to an append blob.
|
Long |
appendBlock(InputStream sourceStream,
long length)
Commits a new block of data to the end of the blob.
|
Long |
appendBlock(InputStream sourceStream,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Commits a new block of data to the end of the blob.
|
void |
appendFromByteArray(byte[] buffer,
int offset,
int length)
Appends the contents of a byte array to an append blob.This API should be used strictly in a single writer
scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks which
does not work in a multiple writer scenario.
|
void |
appendFromByteArray(byte[] buffer,
int offset,
int length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Appends the contents of a byte array to an append blob.This API should be used strictly in a single writer
scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks which
does not work in a multiple writer scenario.
|
void |
appendFromFile(String path)
Appends a file to an append blob.
|
void |
appendFromFile(String path,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Appends a file to an append blob.
|
void |
appendText(String content)
Appends a string of text to an append blob using the platform's default encoding.
|
void |
appendText(String content,
String charsetName,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Appends a string of text to an append blob using the specified encoding.
|
void |
createOrReplace()
Creates an empty append blob.
|
void |
createOrReplace(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Creates an append blob using the specified request options and operation context.
|
BlobOutputStream |
openWriteExisting()
Opens an output stream object to write data to the append blob.
|
BlobOutputStream |
openWriteExisting(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Opens an output stream object to write data to the append blob, using the specified lease ID, request options and
operation context.
|
BlobOutputStream |
openWriteNew()
Opens an output stream object to write data to the append blob.
|
BlobOutputStream |
openWriteNew(AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Opens an output stream object to write data to the append blob, using the specified lease ID, request options and
operation context.
|
void |
setStreamWriteSizeInBytes(int streamWriteSizeInBytes)
Sets the number of bytes to buffer when writing to a
BlobOutputStream. |
String |
startCopy(CloudAppendBlob sourceBlob)
Requests the service to start copying a append blob's contents, properties, and metadata to a new append blob.
|
String |
startCopy(CloudAppendBlob sourceBlob,
AccessCondition sourceAccessCondition,
AccessCondition destinationAccessCondition,
BlobRequestOptions options,
OperationContext opContext)
Requests the service to start copying a append blob's contents, properties, and metadata to a new append blob,
using the specified access conditions, lease ID, request options, and operation context.
|
void |
upload(InputStream sourceStream,
long length)
Uploads the source stream data to the append blob.
|
void |
upload(InputStream sourceStream,
long length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
Uploads the source stream data to the append blob using the specified lease ID, request options, and operation
context.
|
abortCopy, abortCopy, acquireLease, acquireLease, acquireLease, breakLease, breakLease, changeLease, changeLease, createSnapshot, createSnapshot, createSnapshot, delete, delete, deleteIfExists, deleteIfExists, download, download, downloadAccountInfo, downloadAccountInfo, downloadAttributes, downloadAttributes, downloadRange, downloadRange, downloadRangeToByteArray, downloadRangeToByteArray, downloadToByteArray, downloadToByteArray, downloadToFile, downloadToFile, exists, exists, generateSharedAccessSignature, generateSharedAccessSignature, generateSharedAccessSignature, getContainer, getCopyState, getMetadata, getName, getParent, getProperties, getQualifiedStorageUri, getQualifiedUri, getServiceClient, getSnapshotID, getSnapshotQualifiedStorageUri, getSnapshotQualifiedUri, getStorageUri, getStreamMinimumReadSizeInBytes, getStreamWriteSizeInBytes, getUri, isSnapshot, openInputStream, openInputStream, releaseLease, releaseLease, renewLease, renewLease, setMetadata, setStreamMinimumReadSizeInBytes, startCopy, startCopy, undelete, undelete, uploadFromByteArray, uploadFromByteArray, uploadFromFile, uploadFromFile, uploadMetadata, uploadMetadata, uploadProperties, uploadPropertiespublic CloudAppendBlob(URI blobAbsoluteUri) throws StorageException
CloudAppendBlob 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 CloudAppendBlob(StorageUri blobAbsoluteUri) throws StorageException
CloudAppendBlob 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 CloudAppendBlob(CloudAppendBlob otherBlob)
CloudAppendBlob class by copying values from another append blob.otherBlob - A CloudAppendBlob object which represents the append blob to copy.public CloudAppendBlob(URI blobAbsoluteUri, StorageCredentials credentials) throws StorageException
CloudAppendBlob 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 CloudAppendBlob(URI blobAbsoluteUri, String snapshotID, StorageCredentials credentials) throws StorageException
CloudAppendBlob 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 CloudAppendBlob(StorageUri blobAbsoluteUri, StorageCredentials credentials) throws StorageException
CloudAppendBlob 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 CloudAppendBlob(StorageUri blobAbsoluteUri, String snapshotID, StorageCredentials credentials) throws StorageException
CloudAppendBlob 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.@DoesServiceRequest public final String startCopy(CloudAppendBlob sourceBlob) throws StorageException, URISyntaxException
sourceBlob - A CloudAppendBlob 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(CloudAppendBlob sourceBlob, AccessCondition sourceAccessCondition, AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException
sourceBlob - A CloudAppendBlob 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 void createOrReplace() throws StorageException
To avoid overwriting and instead throw an error, please use the
createOrReplace(AccessCondition, BlobRequestOptions, OperationContext) overload with the appropriate
AccessCondition.
StorageException - If a storage service error occurred.@DoesServiceRequest public void createOrReplace(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().
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 Long appendBlock(InputStream sourceStream, long length) throws IOException, StorageException
sourceStream - An InputStream object that represents the input stream to write to the append blob.length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.IOException - If an I/O exception occurred.StorageException - If a storage service error occurred.@DoesServiceRequest public Long appendBlock(InputStream sourceStream, long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
sourceStream - An InputStream object that represents the input stream to write to the Append blob.length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.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 append(InputStream sourceStream, long length) throws StorageException, IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
sourceStream - A InputStream object providing the blob content to append.length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.StorageException - If a storage service error occurred.IOException - If an I/O exception occurred.@DoesServiceRequest public void append(InputStream sourceStream, long length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
sourceStream - A InputStream object providing the blob content to append.length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.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.IOException - If an I/O exception occurred.public void appendFromByteArray(byte[] buffer,
int offset,
int length)
throws StorageException,
IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
buffer - A byte array which represents the data to append 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.StorageException - If a storage service error occurred.IOException - If an I/O exception occurred.public void appendFromByteArray(byte[] buffer,
int offset,
int length,
AccessCondition accessCondition,
BlobRequestOptions options,
OperationContext opContext)
throws StorageException,
IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
buffer - A byte array which represents the data to append 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.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 - If an I/O exception occurred.public void appendFromFile(String path) throws StorageException, IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
path - A String which represents the path to the file to be appended.StorageException - If a storage service error occurred.IOException - If an I/O exception occurred.public void appendFromFile(String path, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
path - A String which represents the path to the file to be appended.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 - If an I/O exception occurred.public void appendText(String content) throws StorageException, IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
content - A String which represents the content that will be appended to the blob.StorageException - If a storage service error occurred.IOException - If an I/O exception occurred.public void appendText(String content, String charsetName, AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
content - A String which represents the content that will be appended to the blob.charsetName - A String which represents the name of the charset to use to encode the content.
If null, the platform's default encoding is used.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 - If an I/O exception occurred.@DoesServiceRequest public BlobOutputStream openWriteExisting() throws StorageException
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
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
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
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() throws StorageException
To avoid overwriting and instead throw an error, please use the
openWriteNew(AccessCondition, BlobRequestOptions, OperationContext) overload with the appropriate
AccessCondition.
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
BlobOutputStream object used to write data to the blob.StorageException - If a storage service error occurred.@DoesServiceRequest public BlobOutputStream openWriteNew(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().
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
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 void upload(InputStream sourceStream, long length) throws StorageException, IOException
If you want to append data to an already existing blob, please see appendBlock(InputStream, long).
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
upload in class CloudBlobsourceStream - An InputStream object to read from.length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.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
If you want to append data to an already existing blob, please see appendBlock(InputStream, long).
If you are doing writes in a single writer scenario, please look at
BlobRequestOptions.setAbsorbConditionalErrorsOnRetry(Boolean) and see if setting this flag
to true is acceptable for you.
upload in class CloudBlobsourceStream - An InputStream object to read from.length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.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.public void setStreamWriteSizeInBytes(int streamWriteSizeInBytes)
BlobOutputStream.setStreamWriteSizeInBytes in class CloudBlobstreamWriteSizeInBytes - An int which represents the maximum block size, in bytes, for writing to an append blob
while using a BlobOutputStream object, ranging from 16 KB to 4 MB, inclusive.IllegalArgumentException - If streamWriteSizeInBytes is less than 16 KB or greater than 4 MB.Copyright © 2018. All Rights Reserved.