public static class

ResumableHttpFileUploader.ResponseMessage

extends Object
java.lang.Object
   ↳ com.google.gdata.client.uploader.ResumableHttpFileUploader.ResponseMessage

Class Overview

The response message returned by the upload task when it has finished uploading the last chunk. The response message instance will hold the expected Content-Length header value and the 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.

Summary

Fields
private final int contentLength
private final InputStream inputStream
Public Constructors
ResumableHttpFileUploader.ResponseMessage(int contentLength, InputStream inputStream)
Public Methods
int getContentLength()
Returns the value of the Content-Length header of the HTTP response.
InputStream getInputStream()
Returns the last request's connection's input stream to read the response body from.
String receiveMessage(long timeoutMs)
Attempts to receive the entire outstanding response message body and returns it as a string.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private final int contentLength

private final InputStream inputStream

Public Constructors

public ResumableHttpFileUploader.ResponseMessage (int contentLength, InputStream inputStream)

Parameters
contentLength
inputStream

Public Methods

public int getContentLength ()

Returns the value of the Content-Length header of the HTTP response.

Returns
  • the size of the HTTP response body in bytes.

public InputStream getInputStream ()

Returns the last request's connection's input stream to read the response body from.

Returns
  • input stream of the most recent HTTP connection.

public String receiveMessage (long timeoutMs)

Attempts to receive the entire outstanding response message body and returns it as a string.

Parameters
timeoutMs The maximum time to wait for the message to be received.
Returns
  • the full message body as a string.
Throws
InterruptedException if the task gets interrupted.
ExecutionException if a IOException is thrown while reading from the input stream.
TimeoutException if the entire message couldn't be received in the allotted timeout.