3030import org .kohsuke .github .authorization .AuthorizationProvider ;
3131import org .kohsuke .github .authorization .ImmutableAuthorizationProvider ;
3232import org .kohsuke .github .authorization .UserAuthorizationProvider ;
33+ import org .kohsuke .github .connector .GitHubConnector ;
34+ import org .kohsuke .github .internal .GitHubConnectorHttpConnectorAdapter ;
3335import org .kohsuke .github .internal .Previews ;
3436
3537import java .io .*;
@@ -110,7 +112,7 @@ public class GitHub {
110112 * a authorization provider
111113 */
112114 GitHub (String apiUrl ,
113- HttpConnector connector ,
115+ GitHubConnector connector ,
114116 RateLimitHandler rateLimitHandler ,
115117 AbuseLimitHandler abuseLimitHandler ,
116118 GitHubRateLimitChecker rateLimitChecker ,
@@ -129,7 +131,7 @@ public class GitHub {
129131 users = new ConcurrentHashMap <>();
130132 orgs = new ConcurrentHashMap <>();
131133
132- this .client = new GitHubHttpUrlConnectionClient (apiUrl ,
134+ this .client = new GitHubClient (apiUrl ,
133135 connector ,
134136 rateLimitHandler ,
135137 abuseLimitHandler ,
@@ -441,7 +443,7 @@ public static GitHub connectToEnterpriseAnonymously(String apiUrl) throws IOExce
441443 public static GitHub offline () {
442444 try {
443445 return new GitHubBuilder ().withEndpoint ("https://api.github.invalid" )
444- .withConnector (HttpConnector .OFFLINE )
446+ .withConnector (GitHubConnector .OFFLINE )
445447 .build ();
446448 } catch (IOException e ) {
447449 throw new IllegalStateException ("The offline implementation constructor should not connect" , e );
@@ -470,7 +472,10 @@ public boolean isOffline() {
470472 * Gets connector.
471473 *
472474 * @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.
473477 */
478+ @ Deprecated
474479 public HttpConnector getConnector () {
475480 return client .getConnector ();
476481 }
@@ -483,8 +488,8 @@ public HttpConnector getConnector() {
483488 * @deprecated HttpConnector should not be changed. If you find yourself needing to do this, file an issue.
484489 */
485490 @ Deprecated
486- public void setConnector (HttpConnector connector ) {
487- client .setConnector (connector );
491+ public void setConnector (@ Nonnull HttpConnector connector ) {
492+ client .setConnector (GitHubConnectorHttpConnectorAdapter . adapt ( connector ) );
488493 }
489494
490495 /**
0 commit comments