30
30
import org .kohsuke .github .authorization .AuthorizationProvider ;
31
31
import org .kohsuke .github .authorization .ImmutableAuthorizationProvider ;
32
32
import org .kohsuke .github .authorization .UserAuthorizationProvider ;
33
+ import org .kohsuke .github .connector .GitHubConnector ;
34
+ import org .kohsuke .github .internal .GitHubConnectorHttpConnectorAdapter ;
33
35
import org .kohsuke .github .internal .Previews ;
34
36
35
37
import java .io .*;
@@ -110,7 +112,7 @@ public class GitHub {
110
112
* a authorization provider
111
113
*/
112
114
GitHub (String apiUrl ,
113
- HttpConnector connector ,
115
+ GitHubConnector connector ,
114
116
RateLimitHandler rateLimitHandler ,
115
117
AbuseLimitHandler abuseLimitHandler ,
116
118
GitHubRateLimitChecker rateLimitChecker ,
@@ -129,7 +131,7 @@ public class GitHub {
129
131
users = new ConcurrentHashMap <>();
130
132
orgs = new ConcurrentHashMap <>();
131
133
132
- this .client = new GitHubHttpUrlConnectionClient (apiUrl ,
134
+ this .client = new GitHubClient (apiUrl ,
133
135
connector ,
134
136
rateLimitHandler ,
135
137
abuseLimitHandler ,
@@ -441,7 +443,7 @@ public static GitHub connectToEnterpriseAnonymously(String apiUrl) throws IOExce
441
443
public static GitHub offline () {
442
444
try {
443
445
return new GitHubBuilder ().withEndpoint ("https://api.github.invalid" )
444
- .withConnector (HttpConnector .OFFLINE )
446
+ .withConnector (GitHubConnector .OFFLINE )
445
447
.build ();
446
448
} catch (IOException e ) {
447
449
throw new IllegalStateException ("The offline implementation constructor should not connect" , e );
@@ -470,7 +472,10 @@ public boolean isOffline() {
470
472
* Gets connector.
471
473
*
472
474
* @return the connector
475
+ * @deprecated HttpConnector has been replaced by GitHubConnector which is generally not useful outside of this
476
+ * library. If you are using this method, file an issue describing your use case.
473
477
*/
478
+ @ Deprecated
474
479
public HttpConnector getConnector () {
475
480
return client .getConnector ();
476
481
}
@@ -483,8 +488,8 @@ public HttpConnector getConnector() {
483
488
* @deprecated HttpConnector should not be changed. If you find yourself needing to do this, file an issue.
484
489
*/
485
490
@ Deprecated
486
- public void setConnector (HttpConnector connector ) {
487
- client .setConnector (connector );
491
+ public void setConnector (@ Nonnull HttpConnector connector ) {
492
+ client .setConnector (GitHubConnectorHttpConnectorAdapter . adapt ( connector ) );
488
493
}
489
494
490
495
/**
0 commit comments