public abstract class LowLevelHttpResponse
extends java.lang.Object
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.
Constructor and Description |
---|
LowLevelHttpResponse() |
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Default implementation does nothing, but subclasses may override to attempt to abort the
connection or release allocated system resources for this connection.
|
abstract java.io.InputStream |
getContent()
Returns the HTTP response content input stream or
null for none. |
abstract java.lang.String |
getContentEncoding()
Returns the content encoding (for example
"gzip" ) or null for none. |
abstract long |
getContentLength()
Returns the content length or
0 for none. |
abstract java.lang.String |
getContentType()
Returns the content type or
null for none. |
abstract int |
getHeaderCount()
Returns the number of HTTP response headers.
|
abstract java.lang.String |
getHeaderName(int index)
Returns the HTTP response header name at the given zero-based index.
|
abstract java.lang.String |
getHeaderValue(int index)
Returns the HTTP response header value at the given zero-based index.
|
abstract java.lang.String |
getReasonPhrase()
Returns the HTTP reason phrase or
null for none. |
abstract int |
getStatusCode()
Returns the response status code or
<=0 for none. |
abstract java.lang.String |
getStatusLine()
Returns the response status line or
null for none. |
public abstract java.io.InputStream getContent() throws java.io.IOException
null
for none.java.io.IOException
- I/O exceptionpublic abstract java.lang.String getContentEncoding() throws java.io.IOException
"gzip"
) or null
for none.java.io.IOException
public abstract long getContentLength() throws java.io.IOException
0
for none.java.io.IOException
public abstract java.lang.String getContentType() throws java.io.IOException
null
for none.java.io.IOException
public abstract java.lang.String getStatusLine() throws java.io.IOException
null
for none.java.io.IOException
public abstract int getStatusCode() throws java.io.IOException
<=0
for none.java.io.IOException
public abstract java.lang.String getReasonPhrase() throws java.io.IOException
null
for none.java.io.IOException
public abstract int getHeaderCount() throws java.io.IOException
Note that multiple headers of the same name need to be supported, in which case each header value is treated as a separate header.
java.io.IOException
public abstract java.lang.String getHeaderName(int index) throws java.io.IOException
java.io.IOException
public abstract java.lang.String getHeaderValue(int index) throws java.io.IOException
java.io.IOException
public void disconnect() throws java.io.IOException
java.io.IOException
- I/O exceptionCopyright © 2011-2018 Google. All Rights Reserved.