public class DefaultHttpResponse extends Object implements HttpResponse
| Constructor and Description |
|---|
DefaultHttpResponse(String bucket,
String key,
int status,
Map<String,String> headers,
byte[] body,
InputStream stream,
org.apache.http.HttpResponse httpResponse,
org.apache.http.client.methods.HttpRequestBase httpMethod) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases the underlying the HTTP connection when the response is streamed
|
byte[] |
getBody()
The HTTP response body or null if isStreamed()
|
String |
getBodyAsString() |
String |
getBucket()
The target object's bucket
|
Map<String,String> |
getHttpHeaders()
The HTTP response headers.
|
org.apache.http.client.methods.HttpRequestBase |
getHttpMethod()
Get the original, underlying http request base method executed to form this repsonse
|
org.apache.http.HttpResponse |
getHttpResponse() |
String |
getKey()
The target object's key or null if bucket is target
|
int |
getStatusCode()
Resulting status code from the HTTP request.
|
InputStream |
getStream()
The HTTP response body as an input stream if isStreamed(); null otherwise
|
boolean |
isError()
Whether the HTTP request returned a 4xx or 5xx response
|
boolean |
isStreamed()
Whether the response body is available as an input stream
|
boolean |
isSuccess()
Whether the HTTP response is considered a success.
|
public String getBucket()
HttpResponsegetBucket in interface HttpResponsepublic String getKey()
HttpResponsegetKey in interface HttpResponsepublic int getStatusCode()
HttpResponsegetStatusCode in interface HttpResponsepublic Map<String,String> getHttpHeaders()
HttpResponsegetHttpHeaders in interface HttpResponsepublic byte[] getBody()
HttpResponsegetBody in interface HttpResponsepublic String getBodyAsString()
getBodyAsString in interface HttpResponsepublic InputStream getStream()
HttpResponsegetStream in interface HttpResponsepublic boolean isStreamed()
HttpResponseisStreamed in interface HttpResponsepublic org.apache.http.client.methods.HttpRequestBase getHttpMethod()
getHttpMethod in interface HttpResponsepublic boolean isSuccess()
HttpResponseisSuccess in interface HttpResponsepublic boolean isError()
HttpResponseisError in interface HttpResponsepublic void close()
HttpResponseclose in interface HttpResponsepublic org.apache.http.HttpResponse getHttpResponse()
getHttpResponse in interface HttpResponseHttpResponse returned by http clientCopyright © 2014. All Rights Reserved.