org.kohsuke.github
Class GHRepository

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

public class GHRepository
extends java.lang.Object

A repository on GitHub.

Author:
Kohsuke Kawaguchi

Constructor Summary
GHRepository()
           
 
Method Summary
 void addCollaborators(java.util.Collection<GHUser> users)
           
 void addCollaborators(GHUser... users)
           
 void delete()
          Deletes this repository.
 void enableIssueTracker(boolean v)
          Enables or disables the issue tracker for this repository.
 void enableWiki(boolean v)
          Enables or disables Wiki for this repository.
 boolean equals(java.lang.Object obj)
           
 GHRepository fork()
          Forks this repository as your repository.
 GHRepository forkTo(GHOrganization org)
          Forks this repository into an organization.
 java.util.Set<java.lang.String> getCollaboratorNames()
          Gets the names of the collaborators on this repository.
 java.util.Set<GHUser> getCollaborators()
          Gets the collaborators on this repository.
 java.util.Date getCreatedAt()
           
 java.lang.String getDescription()
           
 int getForks()
           
 java.lang.String getHomepage()
           
 java.util.List<GHIssue> getIssues(GHIssueState state)
           
 java.lang.String getName()
           
 int getOpenIssueCount()
           
 GHUser getOwner()
           
protected  java.lang.String getOwnerName()
           
 java.util.Set<java.net.URL> getPostCommitHooks()
          Returns a set that represents the post-commit hook URLs.
 GHPullRequest getPullRequest(int i)
          Retrieves a specified pull request.
 java.util.List<GHPullRequest> getPullRequests(GHIssueState state)
          Retrieves all the pull requests of a particular state.
 java.util.Date getPushedAt()
           
 java.util.Set<GHTeam> getTeams()
          If this repository belongs to an organization, return a set of teams.
 java.lang.String getUrl()
          URL of this repository, like 'http://github.com/kohsuke/hudson'
 int getWatchers()
           
 boolean hasDownloads()
           
 int hashCode()
           
 boolean hasIssues()
           
 boolean hasWiki()
           
 boolean isFork()
           
 boolean isPrivate()
           
 void removeCollaborators(java.util.Collection<GHUser> users)
           
 void removeCollaborators(GHUser... users)
           
 void renameTo(java.lang.String newName)
          Rename this repository.
 void setEmailServiceHook(java.lang.String address)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GHRepository

public GHRepository()
Method Detail

getDescription

public java.lang.String getDescription()

getHomepage

public java.lang.String getHomepage()

getUrl

public java.lang.String getUrl()
URL of this repository, like 'http://github.com/kohsuke/hudson'


getName

public java.lang.String getName()

getOwner

public GHUser getOwner()
                throws java.io.IOException
Throws:
java.io.IOException

getIssues

public java.util.List<GHIssue> getIssues(GHIssueState state)
                                  throws java.io.IOException
Throws:
java.io.IOException

getOwnerName

protected java.lang.String getOwnerName()

hasIssues

public boolean hasIssues()

hasWiki

public boolean hasWiki()

isFork

public boolean isFork()

getForks

public int getForks()

isPrivate

public boolean isPrivate()

hasDownloads

public boolean hasDownloads()

getWatchers

public int getWatchers()

getOpenIssueCount

public int getOpenIssueCount()

getPushedAt

public java.util.Date getPushedAt()

getCreatedAt

public java.util.Date getCreatedAt()

getCollaborators

public java.util.Set<GHUser> getCollaborators()
                                       throws java.io.IOException
Gets the collaborators on this repository. This set always appear to include the owner.

Throws:
java.io.IOException

getCollaboratorNames

public java.util.Set<java.lang.String> getCollaboratorNames()
                                                     throws java.io.IOException
Gets the names of the collaborators on this repository. This method deviates from the principle of this library but it works a lot faster than getCollaborators().

Throws:
java.io.IOException

getTeams

public java.util.Set<GHTeam> getTeams()
                               throws java.io.IOException
If this repository belongs to an organization, return a set of teams.

Throws:
java.io.IOException

addCollaborators

public void addCollaborators(GHUser... users)
                      throws java.io.IOException
Throws:
java.io.IOException

addCollaborators

public void addCollaborators(java.util.Collection<GHUser> users)
                      throws java.io.IOException
Throws:
java.io.IOException

removeCollaborators

public void removeCollaborators(GHUser... users)
                         throws java.io.IOException
Throws:
java.io.IOException

removeCollaborators

public void removeCollaborators(java.util.Collection<GHUser> users)
                         throws java.io.IOException
Throws:
java.io.IOException

setEmailServiceHook

public void setEmailServiceHook(java.lang.String address)
                         throws java.io.IOException
Throws:
java.io.IOException

enableIssueTracker

public void enableIssueTracker(boolean v)
                        throws java.io.IOException
Enables or disables the issue tracker for this repository.

Throws:
java.io.IOException

enableWiki

public void enableWiki(boolean v)
                throws java.io.IOException
Enables or disables Wiki for this repository.

Throws:
java.io.IOException

delete

public void delete()
            throws java.io.IOException
Deletes this repository.

Throws:
java.io.IOException

fork

public GHRepository fork()
                  throws java.io.IOException
Forks this repository as your repository.

Returns:
Newly forked repository that belong to you.
Throws:
java.io.IOException

forkTo

public GHRepository forkTo(GHOrganization org)
                    throws java.io.IOException
Forks this repository into an organization.

Returns:
Newly forked repository that belong to you.
Throws:
java.io.IOException

renameTo

public void renameTo(java.lang.String newName)
              throws java.io.IOException
Rename this repository.

Throws:
java.io.IOException

getPullRequest

public GHPullRequest getPullRequest(int i)
                             throws java.io.IOException
Retrieves a specified pull request.

Throws:
java.io.IOException

getPullRequests

public java.util.List<GHPullRequest> getPullRequests(GHIssueState state)
                                              throws java.io.IOException
Retrieves all the pull requests of a particular state.

Throws:
java.io.IOException

getPostCommitHooks

public java.util.Set<java.net.URL> getPostCommitHooks()
Returns a set that represents the post-commit hook URLs. The returned set is live, and changes made to them are reflected to GitHub.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2011. All Rights Reserved.