Class EncryptedBlobClient
Please refer to the Azure Docs For Client-Side Encryption for more information.
This client is instantiated through EncryptedBlobClientBuilder
For operations on a specific blob type (i.e. append, block, or page) use
getAppendBlobClient
, getBlockBlobClient
, or getPageBlobAsyncClient
to construct a client that
allows blob specific operations. Note, these types do not support client-side encryption, though decryption is
possible in case the associated block/page/append blob contains encrypted data.
Please refer to the Azure Docs for more information.
-
Field Summary
Fields inherited from class com.azure.storage.blob.BlobClient
BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE, BLOB_DEFAULT_NUMBER_OF_BUFFERS, BLOB_DEFAULT_UPLOAD_BLOCK_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
download
(OutputStream stream) Deprecated.Downloads the entire blob.downloadContentWithResponse
(DownloadRetryOptions options, BlobRequestConditions requestConditions, Duration timeout, Context context) Downloads a range of bytes from a blob into an output stream.void
downloadStream
(OutputStream stream) Downloads the entire blob into an output stream.downloadStreamWithResponse
(OutputStream stream, BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5, Duration timeout, Context context) Downloads a range of bytes from a blob into an output stream.downloadToFile
(String filePath) Downloads the entire blob into a file specified by the path.downloadToFile
(String filePath, boolean overwrite) Downloads the entire blob into a file specified by the path.downloadToFileWithResponse
(BlobDownloadToFileOptions options, Duration timeout, Context context) Downloads the entire blob into a file specified by the path.downloadToFileWithResponse
(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions downloadRetryOptions, BlobRequestConditions requestConditions, boolean rangeGetContentMd5, Duration timeout, Context context) Downloads the entire blob into a file specified by the path.downloadToFileWithResponse
(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions downloadRetryOptions, BlobRequestConditions requestConditions, boolean rangeGetContentMd5, Set<OpenOption> openOptions, Duration timeout, Context context) Downloads the entire blob into a file specified by the path.downloadWithResponse
(OutputStream stream, BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5, Duration timeout, Context context) Deprecated.Unsupported.Creates and opens an output stream to write data to the block blob.getBlobOutputStream
(boolean overwrite) Creates and opens an output stream to write data to the block blob.getBlobOutputStream
(ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates and opens an output stream to write data to the block blob.Creates and opens an output stream to write data to the block blob.Unsupported.getCustomerProvidedKeyClient
(CustomerProvidedKey customerProvidedKey) Creates a newEncryptedBlobClient
with the specifiedcustomerProvidedKey
.getEncryptionScopeClient
(String encryptionScope) Creates a newEncryptedBlobClient
with the specifiedencryptionScope
.Unsupported.Opens a blob input stream to download the blob.openInputStream
(BlobRange range, BlobRequestConditions requestConditions) Opens a blob input stream to download the specified range of the blob.openInputStream
(BlobInputStreamOptions options) Opens a blob input stream to download the specified range of the blob.openInputStream
(BlobInputStreamOptions options, Context context) Opens a blob input stream to download the specified range of the blob.openQueryInputStream
(String expression) Unsupported.openQueryInputStreamWithResponse
(BlobQueryOptions queryOptions) Unsupported.void
query
(OutputStream stream, String expression) Unsupported.queryWithResponse
(BlobQueryOptions queryOptions, Duration timeout, Context context) Unsupported.void
uploadFromFile
(String filePath) Creates a new block blob, or updates the content of an existing block blob.void
uploadFromFile
(String filePath, boolean overwrite) Creates a new block blob, or updates the content of an existing block blob.void
uploadFromFile
(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions, Duration timeout) Creates a new block blob, or updates the content of an existing block blob.uploadFromFileWithResponse
(BlobUploadFromFileOptions options, Duration timeout, Context context) Creates a new block blob, or updates the content of an existing block blob.Methods inherited from class com.azure.storage.blob.BlobClient
getSnapshotClient, getVersionClient, upload, upload, upload, upload, uploadWithResponse, uploadWithResponse, uploadWithResponse
Methods inherited from class com.azure.storage.blob.specialized.BlobClientBase
abortCopyFromUrl, abortCopyFromUrlWithResponse, beginCopy, beginCopy, beginCopy, copyFromUrl, copyFromUrlWithResponse, copyFromUrlWithResponse, createSnapshot, createSnapshotWithResponse, delete, deleteIfExists, deleteIfExistsWithResponse, deleteImmutabilityPolicy, deleteImmutabilityPolicyWithResponse, deleteWithResponse, exists, existsWithResponse, generateSas, generateSas, generateUserDelegationSas, generateUserDelegationSas, getAccountInfo, getAccountInfoWithResponse, getAccountName, getAccountUrl, getBlobName, getBlobUrl, getContainerClient, getContainerName, getCustomerProvidedKey, getHttpPipeline, getProperties, getPropertiesWithResponse, getServiceVersion, getSnapshotId, getTags, getTagsWithResponse, getVersionId, isSnapshot, setAccessTier, setAccessTierWithResponse, setAccessTierWithResponse, setHttpHeaders, setHttpHeadersWithResponse, setImmutabilityPolicy, setImmutabilityPolicyWithResponse, setLegalHold, setLegalHoldWithResponse, setMetadata, setMetadataWithResponse, setTags, setTagsWithResponse, undelete, undeleteWithResponse
-
Method Details
-
getEncryptionScopeClient
Creates a newEncryptedBlobClient
with the specifiedencryptionScope
.- Overrides:
getEncryptionScopeClient
in classBlobClient
- Parameters:
encryptionScope
- the encryption scope for the blob, passnull
to use no encryption scope.- Returns:
- a
EncryptedBlobClient
with the specifiedencryptionScope
.
-
getCustomerProvidedKeyClient
Creates a newEncryptedBlobClient
with the specifiedcustomerProvidedKey
.- Overrides:
getCustomerProvidedKeyClient
in classBlobClient
- Parameters:
customerProvidedKey
- theCustomerProvidedKey
for the blob, passnull
to use no customer provided key.- Returns:
- a
EncryptedBlobClient
with the specifiedcustomerProvidedKey
.
-
getBlobOutputStream
Creates and opens an output stream to write data to the block blob.Note: We recommend you call write with reasonably sized buffers, you can do so by wrapping the BlobOutputStream obtained below with a
BufferedOutputStream
.- Returns:
- A
BlobOutputStream
object used to write data to the blob. - Throws:
BlobStorageException
- If a storage service error occurred.
-
getBlobOutputStream
Creates and opens an output stream to write data to the block blob.Note: We recommend you call write with reasonably sized buffers, you can do so by wrapping the BlobOutputStream obtained below with a
BufferedOutputStream
.- Parameters:
overwrite
- Whether to overwrite, should data exist on the blob.- Returns:
- A
BlobOutputStream
object used to write data to the blob. - Throws:
BlobStorageException
- If a storage service error occurred.
-
getBlobOutputStream
public BlobOutputStream getBlobOutputStream(ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates and opens an output stream to write data to the block blob. If the blob already exists on the service, it will be overwritten.To avoid overwriting, pass "*" to
BlobRequestConditions.setIfNoneMatch(String)
.Note: We recommend you call write with reasonably sized buffers, you can do so by wrapping the BlobOutputStream obtained below with a
BufferedOutputStream
.- Parameters:
parallelTransferOptions
-ParallelTransferOptions
used to configure buffered uploading.headers
-BlobHttpHeaders
metadata
- Metadata to associate with the blob. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.tier
-AccessTier
for the destination blob.requestConditions
-BlobRequestConditions
- Returns:
- A
BlobOutputStream
object used to write data to the blob. - Throws:
BlobStorageException
- If a storage service error occurred.
-
getBlobOutputStream
Creates and opens an output stream to write data to the block blob. If the blob already exists on the service, it will be overwritten.To avoid overwriting, pass "*" to
BlobRequestConditions.setIfNoneMatch(String)
.Note: We recommend you call write with reasonably sized buffers, you can do so by wrapping the BlobOutputStream obtained below with a
BufferedOutputStream
.- Parameters:
options
-BlockBlobOutputStreamOptions
- Returns:
- A
BlobOutputStream
object used to write data to the blob. - Throws:
BlobStorageException
- If a storage service error occurred.
-
uploadFromFile
Creates a new block blob, or updates the content of an existing block blob.Code Samples
try { client.uploadFromFile(filePath); System.out.println("Upload from file succeeded"); } catch (UncheckedIOException ex) { System.err.printf("Failed to upload from file %s%n", ex.getMessage()); }
- Overrides:
uploadFromFile
in classBlobClient
- Parameters:
filePath
- Path of the file to upload
-
uploadFromFile
Creates a new block blob, or updates the content of an existing block blob.Code Samples
try { boolean overwrite = false; // Default value client.uploadFromFile(filePath, overwrite); System.out.println("Upload from file succeeded"); } catch (UncheckedIOException ex) { System.err.printf("Failed to upload from file %s%n", ex.getMessage()); }
- Overrides:
uploadFromFile
in classBlobClient
- Parameters:
filePath
- Path of the file to uploadoverwrite
- Whether to overwrite should data already exist on the blob
-
uploadFromFile
public void uploadFromFile(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions, Duration timeout) throws UncheckedIOExceptionCreates a new block blob, or updates the content of an existing block blob.Code Samples
BlobHttpHeaders headers = new BlobHttpHeaders() .setContentMd5("data".getBytes(StandardCharsets.UTF_8)) .setContentLanguage("en-US") .setContentType("binary"); Map<String, String> metadata = new HashMap<>(Collections.singletonMap("metadata", "value")); BlobRequestConditions requestConditions = new BlobRequestConditions() .setLeaseId(leaseId) .setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3)); long blockSize = 100 * 1024 * 1024; // 100 MB; ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions().setBlockSizeLong(blockSize); try { client.uploadFromFile(filePath, parallelTransferOptions, headers, metadata, AccessTier.HOT, requestConditions, timeout); System.out.println("Upload from file succeeded"); } catch (UncheckedIOException ex) { System.err.printf("Failed to upload from file %s%n", ex.getMessage()); }
- Overrides:
uploadFromFile
in classBlobClient
- Parameters:
filePath
- Path of the file to uploadparallelTransferOptions
-ParallelTransferOptions
to use to upload from file. Number of parallel transfers parameter is ignored.headers
-BlobHttpHeaders
metadata
- Metadata to associate with the blob. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.tier
-AccessTier
for the uploaded blobrequestConditions
-BlobRequestConditions
timeout
- An optional timeout value beyond which aRuntimeException
will be raised.- Throws:
UncheckedIOException
- If an I/O error occurs
-
uploadFromFileWithResponse
public Response<BlockBlobItem> uploadFromFileWithResponse(BlobUploadFromFileOptions options, Duration timeout, Context context) throws UncheckedIOException Creates a new block blob, or updates the content of an existing block blob.Code Samples
BlobHttpHeaders headers = new BlobHttpHeaders() .setContentMd5("data".getBytes(StandardCharsets.UTF_8)) .setContentLanguage("en-US") .setContentType("binary"); Map<String, String> metadata = new HashMap<>(Collections.singletonMap("metadata", "value")); Map<String, String> tags = new HashMap<>(Collections.singletonMap("tag", "value")); BlobRequestConditions requestConditions = new BlobRequestConditions() .setLeaseId(leaseId) .setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3)); long blockSize = 100 * 1024 * 1024; // 100 MB; ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions().setBlockSizeLong(blockSize); try { client.uploadFromFileWithResponse(new BlobUploadFromFileOptions(filePath) .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata) .setTags(tags).setTier(AccessTier.HOT).setRequestConditions(requestConditions), timeout, Context.NONE); System.out.println("Upload from file succeeded"); } catch (UncheckedIOException ex) { System.err.printf("Failed to upload from file %s%n", ex.getMessage()); }
- Overrides:
uploadFromFileWithResponse
in classBlobClient
- Parameters:
options
-BlobUploadFromFileOptions
timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- Information about the uploaded block blob.
- Throws:
UncheckedIOException
- If an I/O error occurs
-
downloadToFile
Description copied from class:BlobClientBase
Downloads the entire blob into a file specified by the path.The file will be created and must not exist, if the file already exists a
FileAlreadyExistsException
will be thrown.Code Samples
client.downloadToFile(file); System.out.println("Completed download to file");
For more information, see the Azure Docs
- Overrides:
downloadToFile
in classBlobClientBase
- Parameters:
filePath
- AString
representing the filePath where the downloaded data will be written.- Returns:
- The blob properties and metadata.
-
downloadToFile
Description copied from class:BlobClientBase
Downloads the entire blob into a file specified by the path.If overwrite is set to false, the file will be created and must not exist, if the file already exists a
FileAlreadyExistsException
will be thrown.Code Samples
boolean overwrite = false; // Default value client.downloadToFile(file, overwrite); System.out.println("Completed download to file");
For more information, see the Azure Docs
- Overrides:
downloadToFile
in classBlobClientBase
- Parameters:
filePath
- AString
representing the filePath where the downloaded data will be written.overwrite
- Whether to overwrite the file, should the file exist.- Returns:
- The blob properties and metadata.
-
downloadToFileWithResponse
public Response<BlobProperties> downloadToFileWithResponse(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions downloadRetryOptions, BlobRequestConditions requestConditions, boolean rangeGetContentMd5, Duration timeout, Context context) Description copied from class:BlobClientBase
Downloads the entire blob into a file specified by the path.The file will be created and must not exist, if the file already exists a
FileAlreadyExistsException
will be thrown.Code Samples
BlobRange range = new BlobRange(1024, 2048L); DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); client.downloadToFileWithResponse(file, range, new ParallelTransferOptions().setBlockSizeLong(4L * Constants.MB), options, null, false, timeout, new Context(key2, value2)); System.out.println("Completed download to file");
For more information, see the Azure Docs
- Overrides:
downloadToFileWithResponse
in classBlobClientBase
- Parameters:
filePath
- AString
representing the filePath where the downloaded data will be written.range
-BlobRange
parallelTransferOptions
-ParallelTransferOptions
to use to download to file. Number of parallel transfers parameter is ignored.downloadRetryOptions
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
rangeGetContentMd5
- Whether the contentMD5 for the specified blob range should be returned.timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing the blob properties and metadata.
-
downloadToFileWithResponse
public Response<BlobProperties> downloadToFileWithResponse(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions downloadRetryOptions, BlobRequestConditions requestConditions, boolean rangeGetContentMd5, Set<OpenOption> openOptions, Duration timeout, Context context) Description copied from class:BlobClientBase
Downloads the entire blob into a file specified by the path.By default the file will be created and must not exist, if the file already exists a
FileAlreadyExistsException
will be thrown. To override this behavior, provide appropriateOpenOptions
Code Samples
BlobRange blobRange = new BlobRange(1024, 2048L); DownloadRetryOptions downloadRetryOptions = new DownloadRetryOptions().setMaxRetryRequests(5); Set<OpenOption> openOptions = new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE, StandardOpenOption.READ)); // Default options client.downloadToFileWithResponse(file, blobRange, new ParallelTransferOptions().setBlockSizeLong(4L * Constants.MB), downloadRetryOptions, null, false, openOptions, timeout, new Context(key2, value2)); System.out.println("Completed download to file");
For more information, see the Azure Docs
- Overrides:
downloadToFileWithResponse
in classBlobClientBase
- Parameters:
filePath
- AString
representing the filePath where the downloaded data will be written.range
-BlobRange
parallelTransferOptions
-ParallelTransferOptions
to use to download to file. Number of parallel transfers parameter is ignored.downloadRetryOptions
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
rangeGetContentMd5
- Whether the contentMD5 for the specified blob range should be returned.openOptions
-OpenOptions
to use to configure how to open or create the file.timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing the blob properties and metadata.
-
downloadToFileWithResponse
public Response<BlobProperties> downloadToFileWithResponse(BlobDownloadToFileOptions options, Duration timeout, Context context) Description copied from class:BlobClientBase
Downloads the entire blob into a file specified by the path.By default the file will be created and must not exist, if the file already exists a
FileAlreadyExistsException
will be thrown. To override this behavior, provide appropriateOpenOptions
Code Samples
client.downloadToFileWithResponse(new BlobDownloadToFileOptions(file) .setRange(new BlobRange(1024, 2018L)) .setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5)) .setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE, StandardOpenOption.READ))), timeout, new Context(key2, value2)); System.out.println("Completed download to file");
For more information, see the Azure Docs
- Overrides:
downloadToFileWithResponse
in classBlobClientBase
- Parameters:
options
-BlobDownloadToFileOptions
timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing the blob properties and metadata.
-
openInputStream
Description copied from class:BlobClientBase
Opens a blob input stream to download the blob.- Overrides:
openInputStream
in classBlobClientBase
- Returns:
- An
InputStream
object that represents the stream to use for reading from the blob.
-
openInputStream
Description copied from class:BlobClientBase
Opens a blob input stream to download the specified range of the blob.- Overrides:
openInputStream
in classBlobClientBase
- Parameters:
range
-BlobRange
requestConditions
- AnBlobRequestConditions
object that represents the access conditions for the blob.- Returns:
- An
InputStream
object that represents the stream to use for reading from the blob.
-
openInputStream
Description copied from class:BlobClientBase
Opens a blob input stream to download the specified range of the blob.- Overrides:
openInputStream
in classBlobClientBase
- Parameters:
options
-BlobInputStreamOptions
- Returns:
- An
InputStream
object that represents the stream to use for reading from the blob.
-
openInputStream
Description copied from class:BlobClientBase
Opens a blob input stream to download the specified range of the blob.- Overrides:
openInputStream
in classBlobClientBase
- Parameters:
options
-BlobInputStreamOptions
context
-Context
- Returns:
- An
InputStream
object that represents the stream to use for reading from the blob.
-
download
Deprecated.Description copied from class:BlobClientBase
Downloads the entire blob into an output stream. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
client.download(new ByteArrayOutputStream()); System.out.println("Download completed.");
For more information, see the Azure Docs
This method will be deprecated in the future. Use
BlobClientBase.downloadStream(OutputStream)
instead.- Overrides:
download
in classBlobClientBase
- Parameters:
stream
- A non-nullOutputStream
instance where the downloaded data will be written.
-
downloadStream
Description copied from class:BlobClientBase
Downloads the entire blob into an output stream. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
client.downloadStream(new ByteArrayOutputStream()); System.out.println("Download completed.");
For more information, see the Azure Docs
- Overrides:
downloadStream
in classBlobClientBase
- Parameters:
stream
- A non-nullOutputStream
instance where the downloaded data will be written.
-
downloadContent
Description copied from class:BlobClientBase
Downloads the entire blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
BinaryData data = client.downloadContent(); System.out.printf("Downloaded %s", data.toString());
For more information, see the Azure Docs
This method supports downloads up to 2GB of data. Use
BlobClientBase.downloadStream(OutputStream)
to download larger blobs.- Overrides:
downloadContent
in classBlobClientBase
- Returns:
- The content of the blob.
-
downloadWithResponse
@Deprecated public BlobDownloadResponse downloadWithResponse(OutputStream stream, BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5, Duration timeout, Context context) Deprecated.Description copied from class:BlobClientBase
Downloads a range of bytes from a blob into an output stream. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
BlobRange range = new BlobRange(1024, 2048L); DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); System.out.printf("Download completed with status %d%n", client.downloadWithResponse(new ByteArrayOutputStream(), range, options, null, false, timeout, new Context(key2, value2)).getStatusCode());
For more information, see the Azure Docs
This method will be deprecated in the future. Use
BlobClientBase.downloadStreamWithResponse(OutputStream, BlobRange, DownloadRetryOptions, BlobRequestConditions, boolean, Duration, Context)
instead.- Overrides:
downloadWithResponse
in classBlobClientBase
- Parameters:
stream
- A non-nullOutputStream
instance where the downloaded data will be written.range
-BlobRange
options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
getRangeContentMd5
- Whether the contentMD5 for the specified blob range should be returned.timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing status code and HTTP headers.
-
downloadStreamWithResponse
public BlobDownloadResponse downloadStreamWithResponse(OutputStream stream, BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5, Duration timeout, Context context) Description copied from class:BlobClientBase
Downloads a range of bytes from a blob into an output stream. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
BlobRange range = new BlobRange(1024, 2048L); DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); System.out.printf("Download completed with status %d%n", client.downloadStreamWithResponse(new ByteArrayOutputStream(), range, options, null, false, timeout, new Context(key2, value2)).getStatusCode());
For more information, see the Azure Docs
- Overrides:
downloadStreamWithResponse
in classBlobClientBase
- Parameters:
stream
- A non-nullOutputStream
instance where the downloaded data will be written.range
-BlobRange
options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
getRangeContentMd5
- Whether the contentMD5 for the specified blob range should be returned.timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing status code and HTTP headers.
-
downloadContentWithResponse
public BlobDownloadContentResponse downloadContentWithResponse(DownloadRetryOptions options, BlobRequestConditions requestConditions, Duration timeout, Context context) Description copied from class:BlobClientBase
Downloads a range of bytes from a blob into an output stream. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); BlobDownloadContentResponse contentResponse = client.downloadContentWithResponse(options, null, timeout, new Context(key2, value2)); BinaryData content = contentResponse.getValue(); System.out.printf("Download completed with status %d and content%s%n", contentResponse.getStatusCode(), content.toString());
For more information, see the Azure Docs
This method supports downloads up to 2GB of data. Use
BlobClientBase.downloadStreamWithResponse(OutputStream, BlobRange, DownloadRetryOptions, BlobRequestConditions, boolean, Duration, Context)
to download larger blobs.- Overrides:
downloadContentWithResponse
in classBlobClientBase
- Parameters:
options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing status code and HTTP headers.
-
getAppendBlobClient
Unsupported.- Overrides:
getAppendBlobClient
in classBlobClient
- Returns:
- A
AppendBlobClient
associated with this blob.
-
getBlockBlobClient
Unsupported.- Overrides:
getBlockBlobClient
in classBlobClient
- Returns:
- A
BlockBlobClient
associated with this blob.
-
getPageBlobClient
Unsupported.- Overrides:
getPageBlobClient
in classBlobClient
- Returns:
- A
PageBlobClient
associated with this blob.
-
openQueryInputStream
Unsupported. Cannot query data encrypted on client side.- Overrides:
openQueryInputStream
in classBlobClientBase
- Parameters:
expression
- The query expression.- Returns:
- An
InputStream
object that represents the stream to use for reading the query response.
-
openQueryInputStreamWithResponse
Unsupported. Cannot query data encrypted on client side.- Overrides:
openQueryInputStreamWithResponse
in classBlobClientBase
- Parameters:
queryOptions
-The query options
.- Returns:
- A response containing status code and HTTP headers including an
InputStream
object that represents the stream to use for reading the query response.
-
query
Unsupported. Cannot query data encrypted on client side.- Overrides:
query
in classBlobClientBase
- Parameters:
stream
- A non-nullOutputStream
instance where the downloaded data will be written.expression
- The query expression.
-
queryWithResponse
public BlobQueryResponse queryWithResponse(BlobQueryOptions queryOptions, Duration timeout, Context context) Unsupported. Cannot query data encrypted on client side.- Overrides:
queryWithResponse
in classBlobClientBase
- Parameters:
queryOptions
-The query options
.timeout
- An optional timeout value beyond which aRuntimeException
will be raised.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A response containing status code and HTTP headers.
-