| 1 |
package oauth.signpost.commonshttp; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import java.io.InputStream; |
| 5 |
|
| 6 |
|
| 7 |
public class HttpResponseAdapter implements oauth.signpost.http.HttpResponse { |
| 8 |
|
| 9 |
private org.apache.http.HttpResponse response; |
| 10 |
|
| 11 |
public HttpResponseAdapter(org.apache.http.HttpResponse response) { |
| 12 |
this.response = response; |
| 13 |
} |
| 14 |
|
| 15 |
public InputStream getContent() throws IOException { |
| 16 |
return response.getEntity().getContent(); |
| 17 |
} |
| 18 |
|
| 19 |
public int getStatusCode() throws IOException { |
| 20 |
return response.getStatusLine().getStatusCode(); |
| 21 |
} |
| 22 |
|
| 23 |
public String getReasonPhrase() throws Exception { |
| 24 |
return response.getStatusLine().getReasonPhrase(); |
| 25 |
} |
| 26 |
|
| 27 |
public Object unwrap() { |
| 28 |
return response; |
| 29 |
} |
| 30 |
} |