Class LowLevelHttpResponse
java.lang.Object
com.google.api.client.http.LowLevelHttpResponse
- Direct Known Subclasses:
Apache5HttpResponse, ApacheHttpResponse, ApacheHttpResponse, MockLowLevelHttpResponse, NetHttpResponse
Low-level HTTP response.
This allows providing a different implementation of the HTTP response that is more compatible with the Java environment used.
Implementation has no fields and therefore thread-safe, but sub-classes are not necessarily thread-safe.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDefault implementation does nothing, but subclasses may override to attempt to abort the connection or release allocated system resources for this connection.abstract InputStreamReturns the HTTP response content input stream ornullfor none.abstract StringReturns the content encoding (for example"gzip") ornullfor none.abstract longReturns the content length or0for none.abstract StringReturns the content type ornullfor none.abstract intReturns the number of HTTP response headers.abstract StringgetHeaderName(int index) Returns the HTTP response header name at the given zero-based index.abstract StringgetHeaderValue(int index) Returns the HTTP response header value at the given zero-based index.abstract StringReturns the HTTP reason phrase ornullfor none.abstract intReturns the response status code or<=0for none.abstract StringReturns the response status line ornullfor none.
-
Constructor Details
-
LowLevelHttpResponse
public LowLevelHttpResponse()
-
-
Method Details
-
getContent
Returns the HTTP response content input stream ornullfor none.- Throws:
IOException- I/O exception
-
getContentEncoding
Returns the content encoding (for example"gzip") ornullfor none.- Throws:
IOException
-
getContentLength
Returns the content length or0for none.- Throws:
IOException
-
getContentType
Returns the content type ornullfor none.- Throws:
IOException
-
getStatusLine
Returns the response status line ornullfor none.- Throws:
IOException
-
getStatusCode
Returns the response status code or<=0for none.- Throws:
IOException
-
getReasonPhrase
Returns the HTTP reason phrase ornullfor none.- Throws:
IOException
-
getHeaderCount
Returns the number of HTTP response headers.Note that multiple headers of the same name need to be supported, in which case each header value is treated as a separate header.
- Throws:
IOException
-
getHeaderName
Returns the HTTP response header name at the given zero-based index.- Throws:
IOException
-
getHeaderValue
Returns the HTTP response header value at the given zero-based index.- Throws:
IOException
-
disconnect
Default implementation does nothing, but subclasses may override to attempt to abort the connection or release allocated system resources for this connection.- Throws:
IOException- I/O exception- Since:
- 1.4
-