Class EncryptedBlobAsyncClient
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 getAppendBlobAsyncClient
, getBlockBlobAsyncClient
, 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.BlobAsyncClient
BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE, BLOB_DEFAULT_NUMBER_OF_BUFFERS
Fields inherited from class com.azure.storage.blob.specialized.BlobAsyncClientBase
accountName, azureBlobStorage, blobName, containerName, encryptionScope, serviceVersion
-
Method Summary
Modifier and TypeMethodDescriptiondownload()
Deprecated.Reads the entire blob.downloadContentWithResponse
(DownloadRetryOptions options, BlobRequestConditions requestConditions) Reads a range of bytes from a blob.Reads the entire blob.downloadStreamWithResponse
(BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5) Reads a range of bytes from a blob.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.Downloads the entire blob into a file specified by the path.downloadToFileWithResponse
(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean rangeGetContentMd5) Downloads the entire blob into a file specified by the path.downloadToFileWithResponse
(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean rangeGetContentMd5, Set<OpenOption> openOptions) Downloads the entire blob into a file specified by the path.downloadWithResponse
(BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5) Deprecated.getCustomerProvidedKeyAsyncClient
(CustomerProvidedKey customerProvidedKey) Creates a newEncryptedBlobAsyncClient
with the specifiedcustomerProvidedKey
.getEncryptionScopeAsyncClient
(String encryptionScope) Creates a newEncryptedBlobAsyncClient
with the specifiedencryptionScope
.Unsupported.queryWithResponse
(BlobQueryOptions queryOptions) Unsupported.upload
(Flux<ByteBuffer> data, ParallelTransferOptions parallelTransferOptions) Creates a new block blob.upload
(Flux<ByteBuffer> data, ParallelTransferOptions parallelTransferOptions, boolean overwrite) Creates a new block blob, or updates the content of an existing block blob.uploadFromFile
(String filePath) Creates a new block blob with the content of the specified file.uploadFromFile
(String filePath, boolean overwrite) Creates a new block blob, or updates the content of an existing block blob, with the content of the specified file.uploadFromFile
(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates a new block blob, or updates the content of an existing block blob, with the content of the specified file.Creates a new block blob, or updates the content of an existing block blob, with the content of the specified file.Creates a new block blob, or updates the content of an existing block blob.uploadWithResponse
(Flux<ByteBuffer> data, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates a new block blob, or updates the content of an existing block blob.Methods inherited from class com.azure.storage.blob.BlobAsyncClient
getAppendBlobAsyncClient, getBlockBlobAsyncClient, getPageBlobAsyncClient, getSnapshotClient, getVersionClient, upload, upload, uploadFileResourceSupplier
Methods inherited from class com.azure.storage.blob.specialized.BlobAsyncClientBase
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, getContainerAsyncClient, getContainerName, getCustomerProvidedKey, getEncryptionScope, 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
-
getEncryptionScopeAsyncClient
Creates a newEncryptedBlobAsyncClient
with the specifiedencryptionScope
.- Overrides:
getEncryptionScopeAsyncClient
in classBlobAsyncClient
- Parameters:
encryptionScope
- the encryption scope for the blob, passnull
to use no encryption scope.- Returns:
- a
EncryptedBlobAsyncClient
with the specifiedencryptionScope
.
-
getCustomerProvidedKeyAsyncClient
public EncryptedBlobAsyncClient getCustomerProvidedKeyAsyncClient(CustomerProvidedKey customerProvidedKey) Creates a newEncryptedBlobAsyncClient
with the specifiedcustomerProvidedKey
.- Overrides:
getCustomerProvidedKeyAsyncClient
in classBlobAsyncClient
- Parameters:
customerProvidedKey
- theCustomerProvidedKey
for the blob, passnull
to use no customer provided key.- Returns:
- a
EncryptedBlobAsyncClient
with the specifiedcustomerProvidedKey
.
-
upload
public Mono<BlockBlobItem> upload(Flux<ByteBuffer> data, ParallelTransferOptions parallelTransferOptions) Creates a new block blob. By default, this method will not overwrite an existing blob.Updating an existing block blob overwrites any existing blob metadata. Partial updates are not supported with this method; the content of the existing blob is overwritten with the new content. To perform a partial update of block blob's, use
stageBlock
andBlockBlobAsyncClient.commitBlockList(List)
on a regular blob client. For more information, see the Azure Docs for Put Block and the Azure Docs for Put Block List.The data passed need not support multiple subscriptions/be replayable as is required in other upload methods when retries are enabled, and the length of the data need not be known in advance. Therefore, this method should support uploading any arbitrary data source, including network streams. This behavior is possible because this method will perform some internal buffering as configured by the blockSize and numBuffers parameters, so while this method may offer additional convenience, it will not be as performant as other options, which should be preferred when possible.
Typically, the greater the number of buffers used, the greater the possible parallelism when transferring the data. Larger buffers means we will have to stage fewer blocks and therefore require fewer IO operations. The trade-offs between these values are context-dependent, so some experimentation may be required to optimize inputs for a given scenario.
Code Samples
ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions() .setBlockSizeLong(blockSize) .setMaxConcurrency(maxConcurrency); client.upload(data, parallelTransferOptions).subscribe(response -> System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(response.getContentMd5())));
- Overrides:
upload
in classBlobAsyncClient
- Parameters:
data
- The data to write to the blob. Unlike other upload methods, this method does not require that theFlux
be replayable. In other words, it does not have to support multiple subscribers and is not expected to produce the same values across subscriptions.parallelTransferOptions
-ParallelTransferOptions
used to configure buffered uploading.- Returns:
- A reactive response containing the information of the uploaded block blob.
-
upload
public Mono<BlockBlobItem> upload(Flux<ByteBuffer> data, ParallelTransferOptions parallelTransferOptions, boolean overwrite) Creates a new block blob, or updates the content of an existing block blob.Updating an existing block blob overwrites any existing blob metadata. Partial updates are not supported with this method; the content of the existing blob is overwritten with the new content. To perform a partial update of block blob's, use
stageBlock
andBlockBlobAsyncClient.commitBlockList(List)
on a regular blob client. For more information, see the Azure Docs for Put Block and the Azure Docs for Put Block List.The data passed need not support multiple subscriptions/be replayable as is required in other upload methods when retries are enabled, and the length of the data need not be known in advance. Therefore, this method should support uploading any arbitrary data source, including network streams. This behavior is possible because this method will perform some internal buffering as configured by the blockSize and numBuffers parameters, so while this method may offer additional convenience, it will not be as performant as other options, which should be preferred when possible.
Typically, the greater the number of buffers used, the greater the possible parallelism when transferring the data. Larger buffers means we will have to stage fewer blocks and therefore require fewer IO operations. The trade-offs between these values are context-dependent, so some experimentation may be required to optimize inputs for a given scenario.
Code Samples
ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions() .setBlockSizeLong(blockSize) .setMaxConcurrency(maxConcurrency); boolean overwrite = false; // Default behavior client.upload(data, parallelTransferOptions, overwrite).subscribe(response -> System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(response.getContentMd5())));
- Overrides:
upload
in classBlobAsyncClient
- Parameters:
data
- The data to write to the blob. Unlike other upload methods, this method does not require that theFlux
be replayable. In other words, it does not have to support multiple subscribers and is not expected to produce the same values across subscriptions.parallelTransferOptions
-ParallelTransferOptions
used to configure buffered uploading.overwrite
- Whether to overwrite if the blob exists.- Returns:
- A reactive response containing the information of the uploaded block blob.
-
uploadWithResponse
public Mono<Response<BlockBlobItem>> uploadWithResponse(Flux<ByteBuffer> data, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates a new block blob, or updates the content of an existing block blob. Updating an existing block blob overwrites any existing blob metadata. Partial updates are not supported with this method; the content of the existing blob is overwritten with the new content. To perform a partial update of a block blob's, usestageBlock
andBlockBlobAsyncClient.commitBlockList(List)
, which this method uses internally. For more information, see the Azure Docs for Put Block and the Azure Docs for Put Block List.The data passed need not support multiple subscriptions/be replayable as is required in other upload methods when retries are enabled, and the length of the data need not be known in advance. Therefore, this method should support uploading any arbitrary data source, including network streams. This behavior is possible because this method will perform some internal buffering as configured by the blockSize and numBuffers parameters, so while this method may offer additional convenience, it will not be as performant as other options, which should be preferred when possible.
Typically, the greater the number of buffers used, the greater the possible parallelism when transferring the data. Larger buffers means we will have to stage fewer blocks and therefore require fewer IO operations. The trade-offs between these values are context-dependent, so some experimentation may be required to optimize inputs for a given scenario.
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)); ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions() .setBlockSizeLong(blockSize) .setMaxConcurrency(maxConcurrency); client.uploadWithResponse(data, parallelTransferOptions, headers, metadata, AccessTier.HOT, requestConditions) .subscribe(response -> System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(response.getValue().getContentMd5())));
- Overrides:
uploadWithResponse
in classBlobAsyncClient
- Parameters:
data
- The data to write to the blob. Unlike other upload methods, this method does not require that theFlux
be replayable. In other words, it does not have to support multiple subscribers and is not expected to produce the same values across subscriptions.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 reactive response containing the information of the uploaded block blob.
-
uploadWithResponse
Creates a new block blob, or updates the content of an existing block blob. Updating an existing block blob overwrites any existing blob metadata. Partial updates are not supported with this method; the content of the existing blob is overwritten with the new content. To perform a partial update of a block blob's, usestageBlock
andBlockBlobAsyncClient.commitBlockList(List)
, which this method uses internally. For more information, see the Azure Docs for Put Block and the Azure Docs for Put Block List.The data passed need not support multiple subscriptions/be replayable as is required in other upload methods when retries are enabled, and the length of the data need not be known in advance. Therefore, this method should support uploading any arbitrary data source, including network streams. This behavior is possible because this method will perform some internal buffering as configured by the blockSize and numBuffers parameters, so while this method may offer additional convenience, it will not be as performant as other options, which should be preferred when possible.
Typically, the greater the number of buffers used, the greater the possible parallelism when transferring the data. Larger buffers means we will have to stage fewer blocks and therefore require fewer IO operations. The trade-offs between these values are context-dependent, so some experimentation may be required to optimize inputs for a given scenario.
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)); ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions() .setBlockSizeLong(blockSize) .setMaxConcurrency(maxConcurrency); client.uploadWithResponse(new BlobParallelUploadOptions(data) .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata) .setTags(tags).setTier(AccessTier.HOT).setRequestConditions(requestConditions)) .subscribe(response -> System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(response.getValue().getContentMd5())));
Flux
be replayable. In other words, it does not have to support multiple subscribers and is not expected to produce the same values across subscriptions.- Overrides:
uploadWithResponse
in classBlobAsyncClient
- Parameters:
options
-BlobParallelUploadOptions
- Returns:
- A reactive response containing the information of the uploaded block blob.
-
uploadFromFile
Creates a new block blob with the content of the specified file. By default, this method will not overwrite existing dataCode Samples
client.uploadFromFile(filePath) .doOnError(throwable -> System.err.printf("Failed to upload from file %s%n", throwable.getMessage())) .subscribe(completion -> System.out.println("Upload from file succeeded"));
- Overrides:
uploadFromFile
in classBlobAsyncClient
- Parameters:
filePath
- Path to the upload file- Returns:
- An empty response
-
uploadFromFile
Creates a new block blob, or updates the content of an existing block blob, with the content of the specified file.Code Samples
boolean overwrite = false; // Default behavior client.uploadFromFile(filePath, overwrite) .doOnError(throwable -> System.err.printf("Failed to upload from file %s%n", throwable.getMessage())) .subscribe(completion -> System.out.println("Upload from file succeeded"));
- Overrides:
uploadFromFile
in classBlobAsyncClient
- Parameters:
filePath
- Path to the upload fileoverwrite
- Whether to overwrite should the blob exist.- Returns:
- An empty response
-
uploadFromFile
public Mono<Void> uploadFromFile(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions) Creates a new block blob, or updates the content of an existing block blob, with the content of the specified file.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)); ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions() .setBlockSizeLong(blockSize); client.uploadFromFile(filePath, parallelTransferOptions, headers, metadata, AccessTier.HOT, requestConditions) .doOnError(throwable -> System.err.printf("Failed to upload from file %s%n", throwable.getMessage())) .subscribe(completion -> System.out.println("Upload from file succeeded"));
- Overrides:
uploadFromFile
in classBlobAsyncClient
- Parameters:
filePath
- Path to the upload fileparallelTransferOptions
-ParallelTransferOptions
to use to upload from file.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:
- An empty response
- Throws:
IllegalArgumentException
- IfblockSize
is less than 0 or greater than 4000 MBUncheckedIOException
- If an I/O error occurs
-
uploadFromFileWithResponse
Creates a new block blob, or updates the content of an existing block blob, with the content of the specified file.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)); ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions() .setBlockSizeLong(blockSize); client.uploadFromFileWithResponse(new BlobUploadFromFileOptions(filePath) .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata).setTags(tags) .setTier(AccessTier.HOT).setRequestConditions(requestConditions)) .doOnError(throwable -> System.err.printf("Failed to upload from file %s%n", throwable.getMessage())) .subscribe(completion -> System.out.println("Upload from file succeeded"));
- Overrides:
uploadFromFileWithResponse
in classBlobAsyncClient
- Parameters:
options
-BlobUploadFromFileOptions
- Returns:
- A reactive response containing the information of the uploaded block blob.
- Throws:
IllegalArgumentException
- IfblockSize
is less than 0 or greater than 4000 MBUncheckedIOException
- If an I/O error occurs
-
download
Deprecated.Description copied from class:BlobAsyncClientBase
Reads the entire blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
ByteArrayOutputStream downloadData = new ByteArrayOutputStream(); client.download().subscribe(piece -> { try { downloadData.write(piece.array()); } catch (IOException ex) { throw new UncheckedIOException(ex); } });
For more information, see the Azure Docs
This method will be deprecated in the future. Use
BlobAsyncClientBase.downloadStream()
instead.- Overrides:
download
in classBlobAsyncClientBase
- Returns:
- A reactive response containing the blob data.
-
downloadStream
Description copied from class:BlobAsyncClientBase
Reads the entire blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
ByteArrayOutputStream downloadData = new ByteArrayOutputStream(); client.downloadStream().subscribe(piece -> { try { downloadData.write(piece.array()); } catch (IOException ex) { throw new UncheckedIOException(ex); } });
For more information, see the Azure Docs
- Overrides:
downloadStream
in classBlobAsyncClientBase
- Returns:
- A reactive response containing the blob data.
-
downloadContent
Description copied from class:BlobAsyncClientBase
Reads the entire blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
client.downloadContent().subscribe(data -> { System.out.printf("Downloaded %s", data.toString()); });
For more information, see the Azure Docs
This method supports downloads up to 2GB of data. Use
BlobAsyncClientBase.downloadStream()
to download larger blobs.- Overrides:
downloadContent
in classBlobAsyncClientBase
- Returns:
- A reactive response containing the blob data.
-
downloadWithResponse
@Deprecated public Mono<BlobDownloadAsyncResponse> downloadWithResponse(BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5) Deprecated.Description copied from class:BlobAsyncClientBase
Reads a range of bytes from a blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
BlobRange range = new BlobRange(1024, (long) 2048); DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); client.downloadWithResponse(range, options, null, false).subscribe(response -> { ByteArrayOutputStream downloadData = new ByteArrayOutputStream(); response.getValue().subscribe(piece -> { try { downloadData.write(piece.array()); } catch (IOException ex) { throw new UncheckedIOException(ex); } }); });
For more information, see the Azure Docs
This method will be deprecated in the future. Use
BlobAsyncClientBase.downloadStreamWithResponse(BlobRange, DownloadRetryOptions, BlobRequestConditions, boolean)
instead.- Overrides:
downloadWithResponse
in classBlobAsyncClientBase
- Parameters:
range
-BlobRange
options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
getRangeContentMd5
- Whether the contentMD5 for the specified blob range should be returned.- Returns:
- A reactive response containing the blob data.
-
downloadStreamWithResponse
public Mono<BlobDownloadAsyncResponse> downloadStreamWithResponse(BlobRange range, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean getRangeContentMd5) Description copied from class:BlobAsyncClientBase
Reads a range of bytes from a blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
BlobRange range = new BlobRange(1024, (long) 2048); DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); client.downloadStreamWithResponse(range, options, null, false).subscribe(response -> { ByteArrayOutputStream downloadData = new ByteArrayOutputStream(); response.getValue().subscribe(piece -> { try { downloadData.write(piece.array()); } catch (IOException ex) { throw new UncheckedIOException(ex); } }); });
For more information, see the Azure Docs
- Overrides:
downloadStreamWithResponse
in classBlobAsyncClientBase
- Parameters:
range
-BlobRange
options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
getRangeContentMd5
- Whether the contentMD5 for the specified blob range should be returned.- Returns:
- A reactive response containing the blob data.
-
downloadContentWithResponse
public Mono<BlobDownloadContentAsyncResponse> downloadContentWithResponse(DownloadRetryOptions options, BlobRequestConditions requestConditions) Description copied from class:BlobAsyncClientBase
Reads a range of bytes from a blob. Uploading data must be done from theBlockBlobClient
,PageBlobClient
, orAppendBlobClient
.Code Samples
DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5); client.downloadContentWithResponse(options, null).subscribe(response -> { BinaryData content = response.getValue(); System.out.println(content.toString()); });
For more information, see the Azure Docs
This method supports downloads up to 2GB of data. Use
BlobAsyncClientBase.downloadStreamWithResponse(BlobRange, DownloadRetryOptions, BlobRequestConditions, boolean)
to download larger blobs.- Overrides:
downloadContentWithResponse
in classBlobAsyncClientBase
- Parameters:
options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
- Returns:
- A reactive response containing the blob data.
-
downloadToFile
Description copied from class:BlobAsyncClientBase
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).subscribe(response -> System.out.println("Completed download to file"));
For more information, see the Azure Docs
- Overrides:
downloadToFile
in classBlobAsyncClientBase
- Parameters:
filePath
- AString
representing the filePath where the downloaded data will be written.- Returns:
- A reactive response containing the blob properties and metadata.
-
downloadToFile
Description copied from class:BlobAsyncClientBase
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).subscribe(response -> System.out.println("Completed download to file"));
For more information, see the Azure Docs
- Overrides:
downloadToFile
in classBlobAsyncClientBase
- Parameters:
filePath
- AString
representing the filePath where the downloaded data will be written.overwrite
- Whether to overwrite the file, should the file exist.- Returns:
- A reactive response containing the blob properties and metadata.
-
downloadToFileWithResponse
public Mono<Response<BlobProperties>> downloadToFileWithResponse(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean rangeGetContentMd5) Description copied from class:BlobAsyncClientBase
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, null, options, null, false) .subscribe(response -> System.out.println("Completed download to file"));
For more information, see the Azure Docs
- Overrides:
downloadToFileWithResponse
in classBlobAsyncClientBase
- 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.options
-DownloadRetryOptions
requestConditions
-BlobRequestConditions
rangeGetContentMd5
- Whether the contentMD5 for the specified blob range should be returned.- Returns:
- A reactive response containing the blob properties and metadata.
-
downloadToFileWithResponse
public Mono<Response<BlobProperties>> downloadToFileWithResponse(String filePath, BlobRange range, ParallelTransferOptions parallelTransferOptions, DownloadRetryOptions options, BlobRequestConditions requestConditions, boolean rangeGetContentMd5, Set<OpenOption> openOptions) Description copied from class:BlobAsyncClientBase
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, null, downloadRetryOptions, null, false, openOptions) .subscribe(response -> System.out.println("Completed download to file"));
For more information, see the Azure Docs
- Overrides:
downloadToFileWithResponse
in classBlobAsyncClientBase
- 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.options
-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.- Returns:
- A reactive response containing the blob properties and metadata.
-
downloadToFileWithResponse
Description copied from class:BlobAsyncClientBase
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)))) .subscribe(response -> System.out.println("Completed download to file"));
For more information, see the Azure Docs
- Overrides:
downloadToFileWithResponse
in classBlobAsyncClientBase
- Parameters:
options
-BlobDownloadToFileOptions
- Returns:
- A reactive response containing the blob properties and metadata.
-
query
Unsupported. Cannot query data encrypted on client side.- Overrides:
query
in classBlobAsyncClientBase
- Parameters:
expression
- The query expression.- Returns:
- A reactive response containing the queried data.
-
queryWithResponse
Unsupported. Cannot query data encrypted on client side.- Overrides:
queryWithResponse
in classBlobAsyncClientBase
- Parameters:
queryOptions
-The query options
.- Returns:
- A reactive response containing the queried data.
-