Package com.google.api.client.http
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 TypeMethodDescriptionvoid
Default implementation does nothing, but subclasses may override to attempt to abort the connection or release allocated system resources for this connection.abstract InputStream
Returns the HTTP response content input stream ornull
for none.abstract String
Returns the content encoding (for example"gzip"
) ornull
for none.abstract long
Returns the content length or0
for none.abstract String
Returns the content type ornull
for none.abstract int
Returns the number of HTTP response headers.abstract String
getHeaderName
(int index) Returns the HTTP response header name at the given zero-based index.abstract String
getHeaderValue
(int index) Returns the HTTP response header value at the given zero-based index.abstract String
Returns the HTTP reason phrase ornull
for none.abstract int
Returns the response status code or<=0
for none.abstract String
Returns the response status line ornull
for none.
-
Constructor Details
-
LowLevelHttpResponse
public LowLevelHttpResponse()
-
-
Method Details
-
getContent
Returns the HTTP response content input stream ornull
for none.- Throws:
IOException
- I/O exception
-
getContentEncoding
Returns the content encoding (for example"gzip"
) ornull
for none.- Throws:
IOException
-
getContentLength
Returns the content length or0
for none.- Throws:
IOException
-
getContentType
Returns the content type ornull
for none.- Throws:
IOException
-
getStatusLine
Returns the response status line ornull
for none.- Throws:
IOException
-
getStatusCode
Returns the response status code or<=0
for none.- Throws:
IOException
-
getReasonPhrase
Returns the HTTP reason phrase ornull
for 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
-