Package com.microsoft.azure.storage.blob
Class DownloadResponse
- java.lang.Object
-
- com.microsoft.azure.storage.blob.DownloadResponse
-
public final class DownloadResponse extends Object
DownloadResponse
wraps the protocol-layer response fromBlobURL.download(BlobRange, BlobAccessConditions, boolean, com.microsoft.rest.v2.Context)
to automatically retry failed reads from the body as appropriate. If the download is interrupted, theDownloadResponse
will make a request to resume the download from where it left off, allowing the user to consume the data as one continuous stream, for any interruptions are hidden. The retry behavior is defined by the options passed to thebody(ReliableDownloadOptions)
. The download will also lock on the blob's etag to ensure consistency.Note that the retries performed as a part of this reader are composed with those of any retries in an
HttpPipeline
used in conjunction with this reader. That is, if this object issues a request to resume a download, an underlying pipeline may issue several retries as a part of that request. Furthermore, this reader only retries on network errors; timeouts and unexpected status codes are not retried. Therefore, the behavior of this reader is entirely independent of and in no way coupled to anHttpPipeline
's retry mechanism.
-
-
Constructor Summary
Constructors Constructor Description DownloadResponse(com.microsoft.rest.v2.RestResponse<BlobDownloadHeaders,io.reactivex.Flowable<ByteBuffer>> response, com.microsoft.azure.storage.blob.HTTPGetterInfo info, io.reactivex.functions.Function<com.microsoft.azure.storage.blob.HTTPGetterInfo,io.reactivex.Single<DownloadResponse>> getter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.Flowable<ByteBuffer>
body(ReliableDownloadOptions options)
Returns the response body which has been modified to enable reliably reading data if desired (ifoptions.maxRetryRequests > 0
.BlobDownloadHeaders
headers()
Map<String,String>
rawHeaders()
com.microsoft.rest.v2.RestResponse<BlobDownloadHeaders,io.reactivex.Flowable<ByteBuffer>>
rawResponse()
int
statusCode()
-
-
-
Constructor Detail
-
DownloadResponse
public DownloadResponse(com.microsoft.rest.v2.RestResponse<BlobDownloadHeaders,io.reactivex.Flowable<ByteBuffer>> response, com.microsoft.azure.storage.blob.HTTPGetterInfo info, io.reactivex.functions.Function<com.microsoft.azure.storage.blob.HTTPGetterInfo,io.reactivex.Single<DownloadResponse>> getter)
-
-
Method Detail
-
body
public io.reactivex.Flowable<ByteBuffer> body(ReliableDownloadOptions options)
Returns the response body which has been modified to enable reliably reading data if desired (ifoptions.maxRetryRequests > 0
. If retries are enabled, if a connection fails while reading, the stream will make additional requests to reestablish a connection and continue reading.- Parameters:
options
-ReliableDownloadOptions
- Returns:
- A
Flowable
which emits the data asByteBuffer
s.
-
statusCode
public int statusCode()
-
headers
public BlobDownloadHeaders headers()
-
rawResponse
public com.microsoft.rest.v2.RestResponse<BlobDownloadHeaders,io.reactivex.Flowable<ByteBuffer>> rawResponse()
-
-