org.kohsuke.github
Class GitHub

java.lang.Object
  extended by org.kohsuke.github.GitHub

public class GitHub
extends Object

Root of the GitHub API.

Author:
Kohsuke Kawaguchi

Method Summary
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.
 GHRepository createRepository(String name, String description, String homepage, boolean isPublic)
          Creates a new repository.
 GHUser getMyself()
          Gets the GHUser that represents yourself.
 GHOrganization getOrganization(String 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

connect

public static GitHub connect()
                      throws IOException
Obtains the credential from "~/.github"

Throws:
IOException

connect

public static GitHub connect(String login,
                             String apiToken)
                      throws IOException
Throws:
IOException

connect

public static GitHub connect(String login,
                             String apiToken,
                             String password)
                      throws IOException
Throws:
IOException

connectAnonymously

public static GitHub connectAnonymously()
Connects to GitHub anonymously. All operations that requires authentication will fail.


getUser

public GHUser getUser(String login)
               throws IOException
Obtains the object that represents the named user.

Throws:
IOException

getUser

protected GHUser getUser(GHUser orig)
                  throws IOException
Interns the given GHUser.

Throws:
IOException

getOrganization

public GHOrganization getOrganization(String name)
                               throws IOException
Throws:
IOException

getMyself

public GHUser getMyself()
                 throws IOException
Gets the GHUser that represents yourself.

Throws:
IOException

createRepository

public GHRepository createRepository(String name,
                                     String description,
                                     String homepage,
                                     boolean isPublic)
                              throws IOException
Creates a new repository.

Returns:
Newly created repository.
Throws:
IOException

isCredentialValid

public boolean isCredentialValid()
                          throws IOException
Ensures that the credential is valid.

Throws:
IOException


Copyright © 2011. All Rights Reserved.