-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
106 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/org/jenkinsci/plugins/github_branch_source/OkHttpConnector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.jenkinsci.plugins.github_branch_source; | ||
|
||
import com.squareup.okhttp.OkUrlFactory; | ||
import org.kohsuke.github.HttpConnector; | ||
|
||
import java.io.IOException; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
|
||
/** | ||
* Copy-paste due to class loading issues | ||
* | ||
* @see org.kohsuke.github.extras.OkHttpConnector | ||
*/ | ||
class OkHttpConnector implements HttpConnector { | ||
private final OkUrlFactory urlFactory; | ||
|
||
OkHttpConnector(OkUrlFactory urlFactory) { | ||
this.urlFactory = urlFactory; | ||
} | ||
|
||
@Override | ||
public HttpURLConnection connect(URL url) throws IOException { | ||
return urlFactory.open(url); | ||
} | ||
} | ||
|