public static class ResumableHttpFileUploader.ResponseMessage
extends java.lang.Object
InputStream
returned
by the HTTP connection. Note that the input stream might not be ready yet
to read from when the upload task is finished. The connection might still
be receiving the message body.Constructor and Description |
---|
ResumableHttpFileUploader.ResponseMessage(int contentLength,
java.io.InputStream inputStream) |
Modifier and Type | Method and Description |
---|---|
int |
getContentLength()
Returns the value of the Content-Length header of the HTTP response.
|
java.io.InputStream |
getInputStream()
Returns the last request's connection's input stream to read the response
body from.
|
java.lang.String |
receiveMessage(long timeoutMs)
Attempts to receive the entire outstanding response message body and
returns it as a string.
|
public ResumableHttpFileUploader.ResponseMessage(int contentLength, java.io.InputStream inputStream)
public int getContentLength()
public java.io.InputStream getInputStream()
public java.lang.String receiveMessage(long timeoutMs) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
timeoutMs
- the maximum time to wait for the message to be received.java.lang.InterruptedException
- if the task gets interrupted.java.util.concurrent.ExecutionException
- if a IOException
is thrown while
reading from the input stream.java.util.concurrent.TimeoutException
- if the entire message couldn't be received in
the allotted timeout.