public class GitHub extends Object
| Modifier and Type | Method and Description |
|---|---|
static GitHub |
connect()
Obtains the credential from "~/.github"
|
static GitHub |
connect(String login,
String apiToken) |
static GitHub |
connect(String login,
String apiToken,
String password) |
static GitHub |
connectAnonymously()
Connects to GitHub anonymously.
|
static GitHub |
connectUsingOAuth(String accessToken) |
static GitHub |
connectUsingOAuth(String githubServer,
String accessToken) |
GHRepository |
createRepository(String name,
String description,
String homepage,
boolean isPublic)
Creates a new repository.
|
List<GHEventInfo> |
getEvents()
Public events visible to you.
|
Map<String,GHOrganization> |
getMyOrganizations() |
GHMyself |
getMyself()
Gets the
GHUser that represents yourself. |
GHOrganization |
getOrganization(String name) |
GHRateLimit |
getRateLimit()
Gets the current rate limit.
|
GHRepository |
getRepository(String name)
Gets the repository object from 'user/reponame' string that GitHub calls as "repository name"
|
protected GHUser |
getUser(GHUser orig)
Interns the given
GHUser. |
GHUser |
getUser(String login)
Obtains the object that represents the named user.
|
boolean |
isCredentialValid()
Ensures that the credential is valid.
|
<T extends GHEventPayload> |
parseEventPayload(Reader r,
Class<T> type)
Parses the GitHub event object.
|
public static GitHub connect() throws IOException
IOExceptionpublic static GitHub connect(String login, String apiToken) throws IOException
IOExceptionpublic static GitHub connect(String login, String apiToken, String password) throws IOException
IOExceptionpublic static GitHub connectUsingOAuth(String accessToken) throws IOException
IOExceptionpublic static GitHub connectUsingOAuth(String githubServer, String accessToken) throws IOException
IOExceptionpublic static GitHub connectAnonymously()
public GHRateLimit getRateLimit() throws IOException
IOException@WithBridgeMethods(value=GHUser.class) public GHMyself getMyself() throws IOException
GHUser that represents yourself.IOExceptionpublic GHUser getUser(String login) throws IOException
IOExceptionprotected GHUser getUser(GHUser orig) throws IOException
GHUser.IOExceptionpublic GHOrganization getOrganization(String name) throws IOException
IOExceptionpublic GHRepository getRepository(String name) throws IOException
IOExceptionGHRepository.getName()public Map<String,GHOrganization> getMyOrganizations() throws IOException
IOExceptionpublic List<GHEventInfo> getEvents() throws IOException
IOExceptionpublic <T extends GHEventPayload> T parseEventPayload(Reader r, Class<T> type) throws IOException
IOExceptionpublic GHRepository createRepository(String name, String description, String homepage, boolean isPublic) throws IOException
IOExceptionpublic boolean isCredentialValid()
throws IOException
IOExceptionCopyright © 2012. All Rights Reserved.