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 StringMETHOD_PATCHMETHOD_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 HttpURLConnectioncreatePatch(String uri)Create a PATCH request connection to the URIStringgetApiUri()List<String>getLastRequestAcceptedOAuthScopes()List<String>getTokenOAuthScopes()voidpatch(String uri)Patch data to URI<V> Vpatch(String uri, Object params, Type type)Patch data to URIprotected <V> VsendJson(HttpURLConnection request, Object params, Type type)Copy-pasted fromGitHubClientwith scope change (private to protected)org.eclipse.egit.github.core.client.GitHubClientsetCredentials(String user, String password)org.eclipse.egit.github.core.client.GitHubClientsetOAuth2Token(String token)voidsetTrackOAuthInfo(boolean track)protected org.eclipse.egit.github.core.client.GitHubClientupdateRateLimits(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:
setCredentialsin classorg.eclipse.egit.github.core.client.GitHubClient
-
setOAuth2Token
public org.eclipse.egit.github.core.client.GitHubClient setOAuth2Token(String token)
- Overrides:
setOAuth2Tokenin classorg.eclipse.egit.github.core.client.GitHubClient
-
updateRateLimits
protected org.eclipse.egit.github.core.client.GitHubClient updateRateLimits(HttpURLConnection request)
- Overrides:
updateRateLimitsin classorg.eclipse.egit.github.core.client.GitHubClient
-
getApiUri
public String getApiUri()
-
patch
public void patch(@NotNull String uri) throws IOExceptionPatch data to URI- Parameters:
uri-- Throws:
IOException
-
patch
public <V> V patch(@NotNull String uri, @Nullable Object params, @Nullable Type type) throws IOExceptionPatch 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 IOExceptionCopy-pasted fromGitHubClientwith scope change (private to protected)- Throws:
IOException
-
-