Skip to content

Commit

Permalink
Merge pull request #103 from rtyley/okhttp-2.0.0
Browse files Browse the repository at this point in the history
Update to OkHttp 2.0.0, which has a new OkUrlFactory
  • Loading branch information
kohsuke committed Jul 3, 2014
2 parents d2c9095 + 0a37ac9 commit 62d9b92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp</artifactId>
<version>1.5.3</version>
<artifactId>okhttp-urlconnection</artifactId>
<version>2.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/kohsuke/github/extras/OkHttpConnector.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.kohsuke.github.extras;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
import org.kohsuke.github.HttpConnector;

import java.io.IOException;
Expand All @@ -19,13 +20,13 @@
* @author Kohsuke Kawaguchi
*/
public class OkHttpConnector implements HttpConnector {
private final OkHttpClient client;
private final OkUrlFactory urlFactory;

public OkHttpConnector(OkHttpClient client) {
this.client = client;
public OkHttpConnector(OkUrlFactory urlFactory) {
this.urlFactory = urlFactory;
}

public HttpURLConnection connect(URL url) throws IOException {
return client.open(url);
return urlFactory.open(url);
}
}

0 comments on commit 62d9b92

Please sign in to comment.