source: josm/trunk/src/oauth/signpost/basic/HttpURLConnectionResponseAdapter.java@ 4231

Last change on this file since 4231 was 4231, checked in by stoecker, 13 years ago

add signpost and metadata extractor code to repository directly

File size: 788 bytes
Line 
1package oauth.signpost.basic;
2
3import java.io.IOException;
4import java.io.InputStream;
5import java.net.HttpURLConnection;
6
7import oauth.signpost.http.HttpResponse;
8
9public class HttpURLConnectionResponseAdapter implements HttpResponse {
10
11 private HttpURLConnection connection;
12
13 public HttpURLConnectionResponseAdapter(HttpURLConnection connection) {
14 this.connection = connection;
15 }
16
17 public InputStream getContent() throws IOException {
18 return connection.getInputStream();
19 }
20
21 public int getStatusCode() throws IOException {
22 return connection.getResponseCode();
23 }
24
25 public String getReasonPhrase() throws Exception {
26 return connection.getResponseMessage();
27 }
28
29 public Object unwrap() {
30 return connection;
31 }
32}
Note: See TracBrowser for help on using the repository browser.