Class ApacheHttpResponse
- java.lang.Object
-
- com.google.api.client.http.LowLevelHttpResponse
-
- com.google.api.client.http.apache.v2.ApacheHttpResponse
-
final class ApacheHttpResponse extends LowLevelHttpResponse
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.http.Header[]allHeadersprivate org.apache.http.client.methods.HttpRequestBaserequestprivate org.apache.http.HttpResponseresponse
-
Constructor Summary
Constructors Constructor Description ApacheHttpResponse(org.apache.http.client.methods.HttpRequestBase request, org.apache.http.HttpResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()Aborts execution of the request.java.io.InputStreamgetContent()Returns the HTTP response content input stream ornullfor none.java.lang.StringgetContentEncoding()Returns the content encoding (for example"gzip") ornullfor none.longgetContentLength()Returns the content length or0for none.java.lang.StringgetContentType()Returns the content type ornullfor none.intgetHeaderCount()Returns the number of HTTP response headers.java.lang.StringgetHeaderName(int index)Returns the HTTP response header name at the given zero-based index.java.lang.StringgetHeaderValue(int index)Returns the HTTP response header value at the given zero-based index.java.lang.StringgetHeaderValue(java.lang.String name)java.lang.StringgetReasonPhrase()Returns the HTTP reason phrase ornullfor none.intgetStatusCode()Returns the response status code or<=0for none.java.lang.StringgetStatusLine()Returns the response status line ornullfor none.
-
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
Description copied from class:LowLevelHttpResponseReturns the response status code or<=0for none.- Specified by:
getStatusCodein classLowLevelHttpResponse
-
getContent
public java.io.InputStream getContent() throws java.io.IOExceptionDescription copied from class:LowLevelHttpResponseReturns the HTTP response content input stream ornullfor none.- Specified by:
getContentin classLowLevelHttpResponse- Throws:
java.io.IOException- I/O exception
-
getContentEncoding
public java.lang.String getContentEncoding()
Description copied from class:LowLevelHttpResponseReturns the content encoding (for example"gzip") ornullfor none.- Specified by:
getContentEncodingin classLowLevelHttpResponse
-
getContentLength
public long getContentLength()
Description copied from class:LowLevelHttpResponseReturns the content length or0for none.- Specified by:
getContentLengthin classLowLevelHttpResponse
-
getContentType
public java.lang.String getContentType()
Description copied from class:LowLevelHttpResponseReturns the content type ornullfor none.- Specified by:
getContentTypein classLowLevelHttpResponse
-
getReasonPhrase
public java.lang.String getReasonPhrase()
Description copied from class:LowLevelHttpResponseReturns the HTTP reason phrase ornullfor none.- Specified by:
getReasonPhrasein classLowLevelHttpResponse
-
getStatusLine
public java.lang.String getStatusLine()
Description copied from class:LowLevelHttpResponseReturns the response status line ornullfor none.- Specified by:
getStatusLinein classLowLevelHttpResponse
-
getHeaderValue
public java.lang.String getHeaderValue(java.lang.String name)
-
getHeaderCount
public int getHeaderCount()
Description copied from class:LowLevelHttpResponseReturns 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.
- Specified by:
getHeaderCountin classLowLevelHttpResponse
-
getHeaderName
public java.lang.String getHeaderName(int index)
Description copied from class:LowLevelHttpResponseReturns the HTTP response header name at the given zero-based index.- Specified by:
getHeaderNamein classLowLevelHttpResponse
-
getHeaderValue
public java.lang.String getHeaderValue(int index)
Description copied from class:LowLevelHttpResponseReturns the HTTP response header value at the given zero-based index.- Specified by:
getHeaderValuein classLowLevelHttpResponse
-
disconnect
public void disconnect()
Aborts execution of the request.- Overrides:
disconnectin classLowLevelHttpResponse- Since:
- 1.30
-
-