public class GHRepository extends Object
| Constructor and Description |
|---|
GHRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCollaborators(Collection<GHUser> users) |
void |
addCollaborators(GHUser... users) |
GHCommitStatus |
createCommitStatus(String sha1,
GHCommitState state,
String targetUrl,
String description)
Creates a commit status
|
GHContentUpdateResponse |
createContent(String content,
String commitMessage,
String path) |
GHContentUpdateResponse |
createContent(String content,
String commitMessage,
String path,
String branch) |
GHHook |
createHook(String name,
Map<String,String> config,
Collection<GHEvent> events,
boolean active)
See https://api.github.com/hooks for possible names and their configuration scheme.
|
GHIssueBuilder |
createIssue(String title) |
GHMilestone |
createMilestone(String title,
String description) |
GHReleaseBuilder |
createRelease(String tag) |
GHHook |
createWebHook(URL url) |
GHHook |
createWebHook(URL url,
Collection<GHEvent> events) |
void |
delete()
Deletes this repository.
|
void |
enableDownloads(boolean v) |
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(Object obj) |
GHRepository |
fork()
Forks this repository as your repository.
|
GHRepository |
forkTo(GHOrganization org)
Forks this repository into an organization.
|
Map<String,GHBranch> |
getBranches()
Gets branches by their names.
|
Set<String> |
getCollaboratorNames()
Gets the names of the collaborators on this repository.
|
GHPersonSet<GHUser> |
getCollaborators()
Gets the collaborators on this repository.
|
GHCommit |
getCommit(String sha1)
Gets a commit object in this repository.
|
GHCompare |
getCompare(GHBranch id1,
GHBranch id2) |
GHCompare |
getCompare(GHCommit id1,
GHCommit id2) |
GHCompare |
getCompare(String id1,
String id2)
Gets a comparison between 2 points in the repository.
|
Date |
getCreatedAt() |
String |
getDescription() |
List<GHContent> |
getDirectoryContent(String path) |
List<GHContent> |
getDirectoryContent(String path,
String ref) |
GHContent |
getFileContent(String path) |
GHContent |
getFileContent(String path,
String ref) |
int |
getForks() |
String |
getGitTransportUrl()
Gets the git:// URL to this repository, such as "git://github.com/kohsuke/jenkins.git"
This URL is read-only.
|
String |
getHomepage() |
GHHook |
getHook(int id) |
List<GHHook> |
getHooks()
Retrieves the currently configured hooks.
|
GHIssue |
getIssue(int id) |
List<GHIssue> |
getIssues(GHIssueState state) |
String |
getLanguage()
Gets the primary programming language.
|
GHCommitStatus |
getLastCommitStatus(String sha1)
Gets the last status of this commit, which is what gets shown in the UI.
|
String |
getMasterBranch()
Returns the primary branch you'll configure in the "Admin > Options" config page.
|
GHMilestone |
getMilestone(int number) |
Map<Integer,GHMilestone> |
getMilestones()
Deprecated.
|
String |
getName()
Short repository name without the owner.
|
int |
getOpenIssueCount() |
GHUser |
getOwner() |
protected String |
getOwnerName() |
Set<URL> |
getPostCommitHooks()
Deprecated.
|
GHPullRequest |
getPullRequest(int i)
Retrieves a specified pull request.
|
List<GHPullRequest> |
getPullRequests(GHIssueState state)
Retrieves all the pull requests of a particular state.
|
Date |
getPushedAt() |
GHContent |
getReadme() |
GHRef[] |
getRefs()
Retrieves all refs for the github repository.
|
GHRef[] |
getRefs(String refType)
Retrienved all refs of the given type for the current GitHub repository.
|
List<GHRelease> |
getReleases() |
int |
getSize() |
Set<GHTeam> |
getTeams()
If this repository belongs to an organization, return a set of teams.
|
String |
getUrl()
URL of this repository, like 'http://github.com/kohsuke/jenkins'
|
int |
getWatchers() |
String |
gitHttpTransportUrl()
Gets the HTTPS URL to this repository, such as "https://github.com/kohsuke/jenkins.git"
This URL is read-only.
|
boolean |
hasAdminAccess() |
boolean |
hasDownloads() |
int |
hashCode() |
boolean |
hasIssues() |
boolean |
hasPullAccess() |
boolean |
hasPushAccess() |
boolean |
hasWiki() |
boolean |
isFork() |
boolean |
isPrivate() |
PagedIterable<GHCommitComment> |
listCommitComments()
Lists up all the commit comments in this repository.
|
PagedIterable<GHCommit> |
listCommits()
Lists all the commits.
|
PagedIterable<GHCommitStatus> |
listCommitStatuses(String sha1)
Lists all the commit statues attached to the given commit, newer ones first.
|
PagedIterable<GHEventInfo> |
listEvents()
Lists repository events.
|
PagedIterable<GHIssue> |
listIssues(GHIssueState state)
Lists up all the issues in this repository.
|
PagedIterable<GHMilestone> |
listMilestones(GHIssueState state)
Lists up all the milestones in this repository.
|
PagedIterable<GHPullRequest> |
listPullRequests(GHIssueState state)
Retrieves all the pull requests of a particular state.
|
void |
removeCollaborators(Collection<GHUser> users) |
void |
removeCollaborators(GHUser... users) |
void |
renameTo(String name)
Rename this repository.
|
void |
setDescription(String value) |
void |
setEmailServiceHook(String address) |
void |
setHomepage(String value) |
String |
toString() |
public String getDescription()
public String getHomepage()
public String getUrl()
public String getGitTransportUrl()
public String gitHttpTransportUrl()
public String getName()
public boolean hasPullAccess()
public boolean hasPushAccess()
public boolean hasAdminAccess()
public String getLanguage()
public GHUser getOwner() throws IOException
IOExceptionpublic GHIssue getIssue(int id) throws IOException
IOExceptionpublic GHIssueBuilder createIssue(String title)
public List<GHIssue> getIssues(GHIssueState state) throws IOException
IOExceptionpublic PagedIterable<GHIssue> listIssues(GHIssueState state)
public GHReleaseBuilder createRelease(String tag)
public List<GHRelease> getReleases() throws IOException
IOExceptionprotected String getOwnerName()
public boolean hasIssues()
public boolean hasWiki()
public boolean isFork()
public int getForks()
public boolean isPrivate()
public boolean hasDownloads()
public int getWatchers()
public int getOpenIssueCount()
public Date getPushedAt()
public Date getCreatedAt()
public String getMasterBranch()
public int getSize()
@WithBridgeMethods(value=java.util.Set.class) public GHPersonSet<GHUser> getCollaborators() throws IOException
IOExceptionpublic Set<String> getCollaboratorNames() throws IOException
getCollaborators().IOExceptionpublic Set<GHTeam> getTeams() throws IOException
IOExceptionpublic void addCollaborators(GHUser... users) throws IOException
IOExceptionpublic void addCollaborators(Collection<GHUser> users) throws IOException
IOExceptionpublic void removeCollaborators(GHUser... users) throws IOException
IOExceptionpublic void removeCollaborators(Collection<GHUser> users) throws IOException
IOExceptionpublic void setEmailServiceHook(String address) throws IOException
IOExceptionpublic void enableIssueTracker(boolean v)
throws IOException
IOExceptionpublic void enableWiki(boolean v)
throws IOException
IOExceptionpublic void enableDownloads(boolean v)
throws IOException
IOExceptionpublic void renameTo(String name) throws IOException
IOExceptionpublic void setDescription(String value) throws IOException
IOExceptionpublic void setHomepage(String value) throws IOException
IOExceptionpublic void delete()
throws IOException
IOExceptionpublic GHRepository fork() throws IOException
IOExceptionpublic GHRepository forkTo(GHOrganization org) throws IOException
IOExceptionpublic GHPullRequest getPullRequest(int i) throws IOException
IOExceptionpublic List<GHPullRequest> getPullRequests(GHIssueState state) throws IOException
IOExceptionlistPullRequests(GHIssueState)public PagedIterable<GHPullRequest> listPullRequests(GHIssueState state)
public List<GHHook> getHooks() throws IOException
IOExceptionpublic GHHook getHook(int id) throws IOException
IOExceptionpublic GHCompare getCompare(String id1, String id2) throws IOException
id1 - an identifier for the first point to compare from, this can be a sha1 ID (for a commit, tag etc) or a direct tag nameid2 - an identifier for the second point to compare to. Can be the same as the first point.IOException - on failure communicating with GitHubpublic GHCompare getCompare(GHCommit id1, GHCommit id2) throws IOException
IOExceptionpublic GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException
IOExceptionpublic GHRef[] getRefs() throws IOException
IOException - on failure communicating with GitHubpublic GHRef[] getRefs(String refType) throws IOException
refType - the type of reg to search for e.g. tags or commitsIOException - on failure communicating with GitHub, potentially due to an invalid ref type being requestedpublic GHCommit getCommit(String sha1) throws IOException
IOExceptionpublic PagedIterable<GHCommit> listCommits()
public PagedIterable<GHCommitComment> listCommitComments()
public PagedIterable<GHCommitStatus> listCommitStatuses(String sha1) throws IOException
IOExceptionpublic GHCommitStatus getLastCommitStatus(String sha1) throws IOException
IOExceptionpublic GHCommitStatus createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description) throws IOException
targetUrl - Optional parameter that points to the URL that has more details.description - Optional short description.IOExceptionpublic PagedIterable<GHEventInfo> listEvents() throws IOException
IOExceptionpublic GHHook createHook(String name, Map<String,String> config, Collection<GHEvent> events, boolean active) throws IOException
name - Type of the hook to be created. See https://api.github.com/hooks for possible names.config - The configuration hash.events - Can be null. Types of events to hook into.IOExceptionpublic GHHook createWebHook(URL url, Collection<GHEvent> events) throws IOException
IOExceptionpublic GHHook createWebHook(URL url) throws IOException
IOExceptionpublic Set<URL> getPostCommitHooks()
public Map<String,GHBranch> getBranches() throws IOException
IOExceptionpublic Map<Integer,GHMilestone> getMilestones() throws IOException
listMilestones(GHIssueState)IOExceptionpublic PagedIterable<GHMilestone> listMilestones(GHIssueState state)
public GHMilestone getMilestone(int number) throws IOException
IOExceptionpublic GHContent getFileContent(String path) throws IOException
IOExceptionpublic GHContent getFileContent(String path, String ref) throws IOException
IOExceptionpublic List<GHContent> getDirectoryContent(String path) throws IOException
IOExceptionpublic List<GHContent> getDirectoryContent(String path, String ref) throws IOException
IOExceptionpublic GHContentUpdateResponse createContent(String content, String commitMessage, String path) throws IOException
IOExceptionpublic GHContentUpdateResponse createContent(String content, String commitMessage, String path, String branch) throws IOException
IOExceptionpublic GHMilestone createMilestone(String title, String description) throws IOException
IOExceptionCopyright © 2014. All rights reserved.