Class GitHubClientEx
- java.lang.Object
-
- org.eclipse.egit.github.core.client.GitHubClient
-
- jetbrains.buildServer.serverSide.oauth.github.GitHubClientSSL
-
- jetbrains.buildServer.serverSide.oauth.github.GitHubClientEx
-
@NotThreadSafe public class GitHubClientEx extends GitHubClientSSL
Extended version of GitHubClient with some information about OAuth scopes
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
METHOD_PATCH
METHOD_PATCH
-
Constructor Summary
Constructors Constructor Description GitHubClientEx()
GitHubClientEx(String hostname)
GitHubClientEx(String hostname, int port, String scheme)
GitHubClientEx(URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HttpURLConnection
createPatch(String uri)
Create a PATCH request connection to the URIString
getApiUri()
List<String>
getLastRequestAcceptedOAuthScopes()
List<String>
getTokenOAuthScopes()
void
patch(String uri)
Patch data to URI<V> V
patch(String uri, Object params, Type type)
Patch data to URIprotected <V> V
sendJson(HttpURLConnection request, Object params, Type type)
Copy-pasted fromGitHubClient
with scope change (private to protected)org.eclipse.egit.github.core.client.GitHubClient
setCredentials(String user, String password)
org.eclipse.egit.github.core.client.GitHubClient
setOAuth2Token(String token)
void
setTrackOAuthInfo(boolean track)
protected org.eclipse.egit.github.core.client.GitHubClient
updateRateLimits(HttpURLConnection request)
-
Methods inherited from class jetbrains.buildServer.serverSide.oauth.github.GitHubClientSSL
createConnection, setTrustStore
-
Methods inherited from class org.eclipse.egit.github.core.client.GitHubClient
configureRequest, configureUri, createClient, createConnection, createDelete, createException, createGet, createPost, createPut, createUri, delete, delete, get, getBody, getRemainingRequests, getRequestLimit, getResponseStream, getStream, getStream, getUser, isEmpty, isError, isOk, parseError, parseJson, parseJson, post, post, postStream, put, put, sendParams, setBufferSize, setHeaderAccept, setSerializeNulls, setUserAgent, toJson
-
-
-
-
Field Detail
-
METHOD_PATCH
@NonNls protected static final String METHOD_PATCH
METHOD_PATCH- See Also:
- Constant Field Values
-
-
Method Detail
-
getTokenOAuthScopes
@Nullable public List<String> getTokenOAuthScopes()
- Returns:
- list of token scopes or null if oauth token not used or last response does not have 'X-OAuth-Scopes' header
-
getLastRequestAcceptedOAuthScopes
@Nullable public List<String> getLastRequestAcceptedOAuthScopes()
- Returns:
- list of required token scopes for last request or null if no token used or last response does not have 'X-Accepted-OAuth-Scopes' header
-
setTrackOAuthInfo
public void setTrackOAuthInfo(boolean track)
-
setCredentials
public org.eclipse.egit.github.core.client.GitHubClient setCredentials(String user, String password)
- Overrides:
setCredentials
in classorg.eclipse.egit.github.core.client.GitHubClient
-
setOAuth2Token
public org.eclipse.egit.github.core.client.GitHubClient setOAuth2Token(String token)
- Overrides:
setOAuth2Token
in classorg.eclipse.egit.github.core.client.GitHubClient
-
updateRateLimits
protected org.eclipse.egit.github.core.client.GitHubClient updateRateLimits(HttpURLConnection request)
- Overrides:
updateRateLimits
in classorg.eclipse.egit.github.core.client.GitHubClient
-
getApiUri
public String getApiUri()
-
patch
public void patch(@NotNull String uri) throws IOException
Patch data to URI- Parameters:
uri
-- Throws:
IOException
-
patch
public <V> V patch(@NotNull String uri, @Nullable Object params, @Nullable Type type) throws IOException
Patch data to URI- Type Parameters:
V
-- Parameters:
uri
-params
-type
-- Returns:
- response
- Throws:
IOException
-
createPatch
protected HttpURLConnection createPatch(@NotNull String uri) throws IOException
Create a PATCH request connection to the URI- Parameters:
uri
-- Returns:
- connection
- Throws:
IOException
-
sendJson
protected <V> V sendJson(@NotNull HttpURLConnection request, @Nullable Object params, @Nullable Type type) throws IOException
Copy-pasted fromGitHubClient
with scope change (private to protected)- Throws:
IOException
-
-