public class GHRepository extends GHObject
| Modifier and Type | Class and Description |
|---|---|
static class |
GHRepository.Contributor |
created_at, id, updated_at, url| Constructor and Description |
|---|
GHRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCollaborators(java.util.Collection<GHUser> users) |
void |
addCollaborators(GHUser... users) |
GHDeployKey |
addDeployKey(java.lang.String title,
java.lang.String key) |
GHCommitStatus |
createCommitStatus(java.lang.String sha1,
GHCommitState state,
java.lang.String targetUrl,
java.lang.String description) |
GHCommitStatus |
createCommitStatus(java.lang.String sha1,
GHCommitState state,
java.lang.String targetUrl,
java.lang.String description,
java.lang.String context)
Creates a commit status
|
GHContentUpdateResponse |
createContent(byte[] contentBytes,
java.lang.String commitMessage,
java.lang.String path) |
GHContentUpdateResponse |
createContent(byte[] contentBytes,
java.lang.String commitMessage,
java.lang.String path,
java.lang.String branch) |
GHContentUpdateResponse |
createContent(java.lang.String content,
java.lang.String commitMessage,
java.lang.String path) |
GHContentUpdateResponse |
createContent(java.lang.String content,
java.lang.String commitMessage,
java.lang.String path,
java.lang.String branch) |
GHDeploymentBuilder |
createDeployment(java.lang.String ref) |
GHDeploymentStatusBuilder |
createDeployStatus(int deploymentId,
GHDeploymentState ghDeploymentState) |
GHHook |
createHook(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> config,
java.util.Collection<GHEvent> events,
boolean active)
See https://api.github.com/hooks for possible names and their configuration scheme.
|
GHIssueBuilder |
createIssue(java.lang.String title) |
GHLabel |
createLabel(java.lang.String name,
java.lang.String color) |
GHMilestone |
createMilestone(java.lang.String title,
java.lang.String description) |
GHPullRequest |
createPullRequest(java.lang.String title,
java.lang.String head,
java.lang.String base,
java.lang.String body)
Creates a new pull request.
|
GHRef |
createRef(java.lang.String name,
java.lang.String sha)
Creates a named ref, such as tag, branch, etc.
|
GHReleaseBuilder |
createRelease(java.lang.String tag) |
GHHook |
createWebHook(java.net.URL url) |
GHHook |
createWebHook(java.net.URL url,
java.util.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(java.lang.Object obj) |
GHRepository |
fork()
Forks this repository as your repository.
|
GHRepository |
forkTo(GHOrganization org)
Forks this repository into an organization.
|
java.util.Map<java.lang.String,GHBranch> |
getBranches()
Gets branches by their names.
|
java.util.Set<java.lang.String> |
getCollaboratorNames()
Gets the names of the collaborators on this repository.
|
GHPersonSet<GHUser> |
getCollaborators()
Gets the collaborators on this repository.
|
GHCommit |
getCommit(java.lang.String sha1)
Gets a commit object in this repository.
|
GHCompare |
getCompare(GHBranch id1,
GHBranch id2) |
GHCompare |
getCompare(GHCommit id1,
GHCommit id2) |
GHCompare |
getCompare(java.lang.String id1,
java.lang.String id2)
Gets a comparison between 2 points in the repository.
|
java.util.List<GHDeployKey> |
getDeployKeys() |
PagedIterable<GHDeploymentStatus> |
getDeploymentStatuses(int id) |
java.lang.String |
getDescription() |
java.util.List<GHContent> |
getDirectoryContent(java.lang.String path) |
java.util.List<GHContent> |
getDirectoryContent(java.lang.String path,
java.lang.String ref) |
GHContent |
getFileContent(java.lang.String path) |
GHContent |
getFileContent(java.lang.String path,
java.lang.String ref) |
int |
getForks() |
java.lang.String |
getFullName()
Full repository name including the owner or organization.
|
java.lang.String |
getGitTransportUrl()
Gets the git:// URL to this repository, such as "git://github.com/kohsuke/jenkins.git"
This URL is read-only.
|
java.lang.String |
getHomepage() |
GHHook |
getHook(int id) |
java.util.List<GHHook> |
getHooks()
Retrieves the currently configured hooks.
|
GHIssue |
getIssue(int id) |
java.util.List<GHIssue> |
getIssues(GHIssueState state) |
java.util.List<GHIssue> |
getIssues(GHIssueState state,
GHMilestone milestone) |
GHLabel |
getLabel(java.lang.String name) |
java.lang.String |
getLanguage()
Gets the primary programming language.
|
GHCommitStatus |
getLastCommitStatus(java.lang.String sha1)
Gets the last status of this commit, which is what gets shown in the UI.
|
java.lang.String |
getMasterBranch()
Returns the primary branch you'll configure in the "Admin > Options" config page.
|
GHMilestone |
getMilestone(int number) |
java.util.Map<java.lang.Integer,GHMilestone> |
getMilestones()
Deprecated.
|
java.lang.String |
getName()
Short repository name without the owner.
|
int |
getNetworkCount() |
int |
getOpenIssueCount() |
GHUser |
getOwner() |
java.lang.String |
getOwnerName() |
java.util.Set<java.net.URL> |
getPostCommitHooks()
Deprecated.
|
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() |
GHContent |
getReadme()
https://developer.github.com/v3/repos/contents/#get-the-readme
|
GHRef |
getRef(java.lang.String refName)
Retrive a ref of the given type for the current GitHub repository.
|
GHRef[] |
getRefs()
Retrieves all refs for the github repository.
|
GHRef[] |
getRefs(java.lang.String refType)
Retrieves all refs of the given type for the current GitHub repository.
|
java.util.List<GHRelease> |
getReleases()
Deprecated.
use
listReleases() |
int |
getSize() |
java.lang.String |
getSshUrl()
Gets the SSH URL to access this repository, such as git@github.com:rails/rails.git
|
int |
getSubscribersCount() |
GHSubscription |
getSubscription()
Returns the current subscription.
|
java.lang.String |
getSvnUrl()
Gets the Subversion URL to access this repository: https://github.com/rails/rails
|
java.util.Set<GHTeam> |
getTeams()
If this repository belongs to an organization, return a set of teams.
|
GHTree |
getTree(java.lang.String sha)
Retrive a tree of the given type for the current GitHub repository.
|
GHTree |
getTreeRecursive(java.lang.String sha,
int recursive)
Retrieves the tree for the current GitHub repository, recursively as described in here:
https://developer.github.com/v3/git/trees/#get-a-tree-recursively
|
int |
getWatchers() |
java.lang.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<GHUser> |
listCollaborators()
Lists up the collaborators on this repository.
|
PagedIterable<GHCommitComment> |
listCommitComments()
Lists up all the commit comments in this repository.
|
PagedIterable<GHCommit> |
listCommits()
Lists all the commits.
|
PagedIterable<GHCommitStatus> |
listCommitStatuses(java.lang.String sha1)
Lists all the commit statues attached to the given commit, newer ones first.
|
PagedIterable<GHRepository.Contributor> |
listContributors() |
PagedIterable<GHDeployment> |
listDeployments(java.lang.String sha,
java.lang.String ref,
java.lang.String task,
java.lang.String environment) |
PagedIterable<GHEventInfo> |
listEvents()
Lists repository events.
|
PagedIterable<GHIssue> |
listIssues(GHIssueState state)
Lists up all the issues in this repository.
|
PagedIterable<GHLabel> |
listLabels()
Lists labels in this repository.
|
java.util.Map<java.lang.String,java.lang.Long> |
listLanguages()
List languages for the specified repository.
|
PagedIterable<GHMilestone> |
listMilestones(GHIssueState state)
Lists up all the milestones in this repository.
|
GHNotificationStream |
listNotifications()
List all the notifications in a repository for the current user.
|
PagedIterable<GHPullRequest> |
listPullRequests(GHIssueState state)
Retrieves all the pull requests of a particular state.
|
PagedIterable<GHRelease> |
listReleases() |
PagedIterable<GHUser> |
listSubscribers()
Lists all the subscribers (aka watchers.)
https://developer.github.com/v3/activity/watching/
|
PagedIterable<GHTag> |
listTags() |
GHCommitQueryBuilder |
queryCommits()
Search commits by specifying filters through a builder pattern.
|
void |
removeCollaborators(java.util.Collection<GHUser> users) |
void |
removeCollaborators(GHUser... users) |
void |
renameTo(java.lang.String name)
Rename this repository.
|
java.io.Reader |
renderMarkdown(java.lang.String text,
MarkdownMode mode)
Render a Markdown document.
|
void |
setDescription(java.lang.String value) |
void |
setEmailServiceHook(java.lang.String address) |
void |
setHomepage(java.lang.String value) |
GHSubscription |
subscribe(boolean subscribed,
boolean ignored)
Subscribes to this repository to get notifications.
|
java.lang.String |
toString() |
getCreatedAt, getId, getUpdatedAt, getUrlpublic GHDeploymentBuilder createDeployment(java.lang.String ref)
public PagedIterable<GHDeploymentStatus> getDeploymentStatuses(int id)
public PagedIterable<GHDeployment> listDeployments(java.lang.String sha, java.lang.String ref, java.lang.String task, java.lang.String environment)
public GHDeploymentStatusBuilder createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState)
public java.lang.String getDescription()
public java.lang.String getHomepage()
public java.lang.String getGitTransportUrl()
public java.lang.String gitHttpTransportUrl()
public java.lang.String getSvnUrl()
public java.lang.String getSshUrl()
public java.lang.String getName()
public java.lang.String getFullName()
public boolean hasPullAccess()
public boolean hasPushAccess()
public boolean hasAdminAccess()
public java.lang.String getLanguage()
public GHUser getOwner() throws java.io.IOException
java.io.IOExceptionpublic GHIssue getIssue(int id) throws java.io.IOException
java.io.IOExceptionpublic GHIssueBuilder createIssue(java.lang.String title)
public java.util.List<GHIssue> getIssues(GHIssueState state) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<GHIssue> getIssues(GHIssueState state, GHMilestone milestone) throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHIssue> listIssues(GHIssueState state)
public GHReleaseBuilder createRelease(java.lang.String tag)
public GHRef createRef(java.lang.String name, java.lang.String sha) throws java.io.IOException
name - The name of the fully qualified reference (ie: refs/heads/master).
If it doesn't start with 'refs' and have at least two slashes, it will be rejected.sha - The SHA1 value to set this reference tojava.io.IOExceptionpublic java.util.List<GHRelease> getReleases() throws java.io.IOException
listReleases()java.io.IOExceptionpublic PagedIterable<GHRelease> listReleases() throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHTag> listTags() throws java.io.IOException
java.io.IOExceptionpublic java.util.Map<java.lang.String,java.lang.Long> listLanguages()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.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 int getNetworkCount()
public int getSubscribersCount()
public java.util.Date getPushedAt()
public java.lang.String getMasterBranch()
public int getSize()
@WithBridgeMethods(value=java.util.Set.class) public GHPersonSet<GHUser> getCollaborators() throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHUser> listCollaborators() throws java.io.IOException
java.io.IOExceptionpublic java.util.Set<java.lang.String> getCollaboratorNames()
throws java.io.IOException
getCollaborators().java.io.IOExceptionpublic java.util.Set<GHTeam> getTeams() throws java.io.IOException
java.io.IOExceptionpublic void addCollaborators(GHUser... users) throws java.io.IOException
java.io.IOExceptionpublic void addCollaborators(java.util.Collection<GHUser> users) throws java.io.IOException
java.io.IOExceptionpublic void removeCollaborators(GHUser... users) throws java.io.IOException
java.io.IOExceptionpublic void removeCollaborators(java.util.Collection<GHUser> users) throws java.io.IOException
java.io.IOExceptionpublic void setEmailServiceHook(java.lang.String address)
throws java.io.IOException
java.io.IOExceptionpublic void enableIssueTracker(boolean v)
throws java.io.IOException
java.io.IOExceptionpublic void enableWiki(boolean v)
throws java.io.IOException
java.io.IOExceptionpublic void enableDownloads(boolean v)
throws java.io.IOException
java.io.IOExceptionpublic void renameTo(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic void setDescription(java.lang.String value)
throws java.io.IOException
java.io.IOExceptionpublic void setHomepage(java.lang.String value)
throws java.io.IOException
java.io.IOExceptionpublic void delete()
throws java.io.IOException
java.io.IOExceptionpublic GHRepository fork() throws java.io.IOException
java.io.IOExceptionpublic GHRepository forkTo(GHOrganization org) throws java.io.IOException
java.io.IOExceptionpublic GHPullRequest getPullRequest(int i) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<GHPullRequest> getPullRequests(GHIssueState state) throws java.io.IOException
java.io.IOExceptionlistPullRequests(GHIssueState)public PagedIterable<GHPullRequest> listPullRequests(GHIssueState state)
public GHPullRequest createPullRequest(java.lang.String title, java.lang.String head, java.lang.String base, java.lang.String body) throws java.io.IOException
title - Required. The title of the pull request.head - Required. The name of the branch where your changes are implemented.
For cross-repository pull requests in the same network,
namespace head with a user like this: username:branch.base - Required. The name of the branch you want your changes pulled into.
This should be an existing branch on the current repository.body - The contents of the pull request. This is the markdown description
of a pull request.java.io.IOExceptionpublic java.util.List<GHHook> getHooks() throws java.io.IOException
java.io.IOExceptionpublic GHHook getHook(int id) throws java.io.IOException
java.io.IOExceptionpublic GHCompare getCompare(java.lang.String id1, java.lang.String id2) throws java.io.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.java.io.IOException - on failure communicating with GitHubpublic GHCompare getCompare(GHCommit id1, GHCommit id2) throws java.io.IOException
java.io.IOExceptionpublic GHCompare getCompare(GHBranch id1, GHBranch id2) throws java.io.IOException
java.io.IOExceptionpublic GHRef[] getRefs() throws java.io.IOException
java.io.IOException - on failure communicating with GitHubpublic GHRef[] getRefs(java.lang.String refType) throws java.io.IOException
refType - the type of reg to search for e.g. tags or commitsjava.io.IOException - on failure communicating with GitHub, potentially due to an invalid ref type being requestedpublic GHRef getRef(java.lang.String refName) throws java.io.IOException
refName - eg: heads/branchjava.io.IOException - on failure communicating with GitHub, potentially due to an
invalid ref type being requestedpublic GHTree getTree(java.lang.String sha) throws java.io.IOException
sha - - sha number or branch name ex: "master"java.io.IOException - on failure communicating with GitHub, potentially due to an
invalid tree type being requestedpublic GHTree getTreeRecursive(java.lang.String sha, int recursive) throws java.io.IOException
sha - - sha number or branch name ex: "master"recursive - use 1java.io.IOException - on failure communicating with GitHub, potentially due to an
invalid tree type being requestedpublic GHCommit getCommit(java.lang.String sha1) throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHCommit> listCommits()
public GHCommitQueryBuilder queryCommits()
public PagedIterable<GHCommitComment> listCommitComments()
public PagedIterable<GHCommitStatus> listCommitStatuses(java.lang.String sha1) throws java.io.IOException
java.io.IOExceptionpublic GHCommitStatus getLastCommitStatus(java.lang.String sha1) throws java.io.IOException
java.io.IOExceptionpublic GHCommitStatus createCommitStatus(java.lang.String sha1, GHCommitState state, java.lang.String targetUrl, java.lang.String description, java.lang.String context) throws java.io.IOException
targetUrl - Optional parameter that points to the URL that has more details.description - Optional short description.context - Optinal commit status context.java.io.IOExceptionpublic GHCommitStatus createCommitStatus(java.lang.String sha1, GHCommitState state, java.lang.String targetUrl, java.lang.String description) throws java.io.IOException
java.io.IOException#createCommitStatus(String, GHCommitState,String,String,String) createCommitStatus}public PagedIterable<GHEventInfo> listEvents() throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHLabel> listLabels() throws java.io.IOException
java.io.IOExceptionpublic GHLabel getLabel(java.lang.String name) throws java.io.IOException
java.io.IOExceptionpublic GHLabel createLabel(java.lang.String name, java.lang.String color) throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHUser> listSubscribers()
public GHHook createHook(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> config, java.util.Collection<GHEvent> events, boolean active) throws java.io.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.java.io.IOExceptionpublic GHHook createWebHook(java.net.URL url, java.util.Collection<GHEvent> events) throws java.io.IOException
java.io.IOExceptionpublic GHHook createWebHook(java.net.URL url) throws java.io.IOException
java.io.IOExceptionpublic java.util.Set<java.net.URL> getPostCommitHooks()
public java.util.Map<java.lang.String,GHBranch> getBranches() throws java.io.IOException
java.io.IOExceptionpublic java.util.Map<java.lang.Integer,GHMilestone> getMilestones() throws java.io.IOException
listMilestones(GHIssueState)java.io.IOExceptionpublic PagedIterable<GHMilestone> listMilestones(GHIssueState state)
public GHMilestone getMilestone(int number) throws java.io.IOException
java.io.IOExceptionpublic GHContent getFileContent(java.lang.String path) throws java.io.IOException
java.io.IOExceptionpublic GHContent getFileContent(java.lang.String path, java.lang.String ref) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<GHContent> getDirectoryContent(java.lang.String path) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<GHContent> getDirectoryContent(java.lang.String path, java.lang.String ref) throws java.io.IOException
java.io.IOExceptionpublic GHContent getReadme() throws java.io.IOException
java.io.IOExceptionpublic GHContentUpdateResponse createContent(java.lang.String content, java.lang.String commitMessage, java.lang.String path) throws java.io.IOException
java.io.IOExceptionpublic GHContentUpdateResponse createContent(java.lang.String content, java.lang.String commitMessage, java.lang.String path, java.lang.String branch) throws java.io.IOException
java.io.IOExceptionpublic GHContentUpdateResponse createContent(byte[] contentBytes, java.lang.String commitMessage, java.lang.String path) throws java.io.IOException
java.io.IOExceptionpublic GHContentUpdateResponse createContent(byte[] contentBytes, java.lang.String commitMessage, java.lang.String path, java.lang.String branch) throws java.io.IOException
java.io.IOExceptionpublic GHMilestone createMilestone(java.lang.String title, java.lang.String description) throws java.io.IOException
java.io.IOExceptionpublic GHDeployKey addDeployKey(java.lang.String title, java.lang.String key) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<GHDeployKey> getDeployKeys() throws java.io.IOException
java.io.IOExceptionpublic GHSubscription subscribe(boolean subscribed, boolean ignored) throws java.io.IOException
java.io.IOExceptionpublic GHSubscription getSubscription() throws java.io.IOException
java.io.IOExceptionpublic PagedIterable<GHRepository.Contributor> listContributors() throws java.io.IOException
java.io.IOExceptionpublic java.io.Reader renderMarkdown(java.lang.String text,
MarkdownMode mode)
throws java.io.IOException
java.io.IOExceptionGitHub.renderMarkdown(String)public GHNotificationStream listNotifications()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2015. All Rights Reserved.