public class GHRepository extends GHObject
| Modifier and Type | Class and Description |
|---|---|
static class |
GHRepository.Contributor
The type Contributor.
|
static class |
GHRepository.ForkSort
Sort orders for listing forks
|
created_at, id, responseHeaderFields, updated_at, url| Constructor and Description |
|---|
GHRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCollaborators(Collection<GHUser> users)
Add collaborators.
|
void |
addCollaborators(GHUser... users)
Add collaborators.
|
GHDeployKey |
addDeployKey(String title,
String key)
Add deploy key gh deploy key.
|
void |
allowMergeCommit(boolean value)
Allow merge commit.
|
void |
allowRebaseMerge(boolean value)
Allow rebase merge.
|
void |
allowSquashMerge(boolean value)
Allow squash merge.
|
void |
archive()
Will archive and this repository as read-only.
|
GHBlobBuilder |
createBlob()
Create blob gh blob builder.
|
GHCommitBuilder |
createCommit()
Create commit gh commit builder.
|
GHCommitStatus |
createCommitStatus(String sha1,
GHCommitState state,
String targetUrl,
String description)
Create commit status gh commit status.
|
GHCommitStatus |
createCommitStatus(String sha1,
GHCommitState state,
String targetUrl,
String description,
String context)
Creates a commit status
|
GHContentBuilder |
createContent()
Creates a new content, or update an existing content.
|
GHContentUpdateResponse |
createContent(byte[] contentBytes,
String commitMessage,
String path)
Deprecated.
|
GHContentUpdateResponse |
createContent(byte[] contentBytes,
String commitMessage,
String path,
String branch)
Deprecated.
|
GHContentUpdateResponse |
createContent(String content,
String commitMessage,
String path)
Deprecated.
|
GHContentUpdateResponse |
createContent(String content,
String commitMessage,
String path,
String branch)
Deprecated.
|
GHDeploymentBuilder |
createDeployment(String ref)
Create deployment gh deployment builder.
|
GHDeploymentStatusBuilder |
createDeployStatus(int deploymentId,
GHDeploymentState ghDeploymentState)
Deprecated.
Use
getDeployment(deploymentId).createStatus(ghDeploymentState) |
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)
Create issue gh issue builder.
|
GHLabel |
createLabel(String name,
String color)
Create label gh label.
|
GHLabel |
createLabel(String name,
String color,
String description)
Description is still in preview.
|
GHMilestone |
createMilestone(String title,
String description)
Create milestone gh milestone.
|
GHProject |
createProject(String name,
String body)
Create a project for this repository.
|
GHPullRequest |
createPullRequest(String title,
String head,
String base,
String body)
Creates a new pull request.
|
GHPullRequest |
createPullRequest(String title,
String head,
String base,
String body,
boolean maintainerCanModify)
Creates a new pull request.
|
GHPullRequest |
createPullRequest(String title,
String head,
String base,
String body,
boolean maintainerCanModify,
boolean draft)
Creates a new pull request.
|
GHRef |
createRef(String name,
String sha)
Creates a named ref, such as tag, branch, etc.
|
GHReleaseBuilder |
createRelease(String tag)
Create release gh release builder.
|
GHTagObject |
createTag(String tag,
String message,
String object,
String type)
Create a tag.
|
GHTreeBuilder |
createTree()
Create tree gh tree builder.
|
GHHook |
createWebHook(URL url)
Create web hook gh hook.
|
GHHook |
createWebHook(URL url,
Collection<GHEvent> events)
Create web hook gh hook.
|
void |
delete()
Deletes this repository.
|
void |
enableDownloads(boolean v)
Enable downloads.
|
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.
|
GHBlob |
getBlob(String blobSha)
Obtains the metadata & the content of a blob.
|
GHBranch |
getBranch(String name)
Gets branch.
|
Map<String,GHBranch> |
getBranches()
Gets branches by their names.
|
GHRepositoryCloneTraffic |
getCloneTraffic()
|
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)
Gets compare.
|
GHCompare |
getCompare(GHCommit id1,
GHCommit id2)
Gets compare.
|
GHCompare |
getCompare(String id1,
String id2)
Gets a comparison between 2 points in the repository.
|
String |
getDefaultBranch()
Returns the primary branch you'll configure in the "Admin > Options" config page.
|
List<GHDeployKey> |
getDeployKeys()
Gets deploy keys.
|
GHDeployment |
getDeployment(long id)
Obtains a single
GHDeployment by its ID. |
PagedIterable<GHDeploymentStatus> |
getDeploymentStatuses(int id)
Deprecated.
Use
getDeployment(id).listStatuses() |
String |
getDescription()
Gets description.
|
List<GHContent> |
getDirectoryContent(String path)
Gets directory content.
|
List<GHContent> |
getDirectoryContent(String path,
String ref)
Gets directory content.
|
GHContent |
getFileContent(String path)
Gets file content.
|
GHContent |
getFileContent(String path,
String ref)
Gets file content.
|
int |
getForks()
Returns the number of all forks of this repository.
|
String |
getFullName()
Full repository name including the owner or organization.
|
String |
getGitTransportUrl()
Gets the git:// URL to this repository, such as "git://github.com/kohsuke/jenkins.git" This URL is read-only.
|
String |
getHomepage()
Gets homepage.
|
GHHook |
getHook(int id)
Gets hook.
|
List<GHHook> |
getHooks()
Retrieves the currently configured hooks.
|
URL |
getHtmlUrl()
Gets html url.
|
String |
getHttpTransportUrl()
Gets the HTTPS URL to this repository, such as "https://github.com/kohsuke/jenkins.git" This URL is read-only.
|
GHIssue |
getIssue(int id)
Gets issue.
|
GHIssueEvent |
getIssueEvent(long id)
Get a single issue event.
|
List<GHIssue> |
getIssues(GHIssueState state)
Gets issues.
|
List<GHIssue> |
getIssues(GHIssueState state,
GHMilestone milestone)
Gets issues.
|
GHLabel |
getLabel(String name)
Gets label.
|
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.
|
GHRelease |
getLatestRelease()
Gets latest release.
|
GHLicense |
getLicense()
Gets the basic license details for the repository.
|
GHContent |
getLicenseContent()
Retrieves the contents of the repository's license file - makes an additional API call
|
String |
getMasterBranch()
Deprecated.
Renamed to
getDefaultBranch() |
GHMilestone |
getMilestone(int number)
Gets milestone.
|
Map<Integer,GHMilestone> |
getMilestones()
Deprecated.
|
String |
getMirrorUrl()
Gets the Mirror URL to access this repository: https://github.com/apache/tomee mirrored from
git://git.apache.org/tomee.git
|
String |
getName()
Short repository name without the owner.
|
int |
getNetworkCount()
Deprecated.
This no longer exists in the official API documentation. Use
getForks() |
int |
getOpenIssueCount()
Gets open issue count.
|
GHUser |
getOwner()
Gets owner.
|
String |
getOwnerName()
Gets owner name.
|
GHRepository |
getParent()
Forked repositories have a 'parent' attribute that specifies the repository this repository is directly forked
from.
|
GHPermissionType |
getPermission(GHUser u)
Obtain permission for a given user in this repository.
|
GHPermissionType |
getPermission(String user)
Obtain permission for a given user in this repository.
|
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()
Gets pushed at.
|
GHContent |
getReadme()
https://developer.github.com/v3/repos/contents/#get-the-readme
|
GHRef |
getRef(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(String refType)
Retrieves all refs of the given type for the current GitHub repository.
|
GHRelease |
getRelease(long id)
Gets release.
|
GHRelease |
getReleaseByTagName(String tag)
Gets release by tag name.
|
List<GHRelease> |
getReleases()
Deprecated.
use
listReleases() |
int |
getSize()
Gets size.
|
GHRepository |
getSource()
Forked repositories have a 'source' attribute that specifies the ultimate source of the forking chain.
|
String |
getSshUrl()
Gets the SSH URL to access this repository, such as git@github.com:rails/rails.git
|
int |
getStargazersCount()
Gets stargazers count.
|
GHRepositoryStatistics |
getStatistics()
Returns the statistics for this repository.
|
int |
getSubscribersCount()
Gets subscribers count.
|
GHSubscription |
getSubscription()
Returns the current subscription.
|
String |
getSvnUrl()
Gets the Subversion URL to access this repository: https://github.com/rails/rails
|
GHTagObject |
getTagObject(String sha)
Returns the annotated tag object.
|
Set<GHTeam> |
getTeams()
If this repository belongs to an organization, return a set of teams.
|
GHTree |
getTree(String sha)
Retrive a tree of the given type for the current GitHub repository.
|
GHTree |
getTreeRecursive(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
|
GHRepositoryViewTraffic |
getViewTraffic()
|
int |
getWatchers()
Gets watchers.
|
String |
gitHttpTransportUrl()
Deprecated.
Typo of
getHttpTransportUrl() |
boolean |
hasAdminAccess()
Has admin access boolean.
|
boolean |
hasAssignee(GHUser u)
Checks if the given user is an assignee for this repository.
|
boolean |
hasDownloads()
Has downloads boolean.
|
int |
hashCode() |
boolean |
hasIssues()
Has issues boolean.
|
boolean |
hasPages()
Has pages boolean.
|
boolean |
hasPullAccess()
Has pull access boolean.
|
boolean |
hasPushAccess()
Has push access boolean.
|
boolean |
hasWiki()
Has wiki boolean.
|
boolean |
isAllowMergeCommit()
Is allow merge commit boolean.
|
boolean |
isAllowRebaseMerge()
Is allow rebase merge boolean.
|
boolean |
isAllowSquashMerge()
Is allow squash merge boolean.
|
boolean |
isArchived()
Is archived boolean.
|
boolean |
isFork()
Is fork boolean.
|
boolean |
isPrivate()
Is private boolean.
|
PagedIterable<GHUser> |
listAssignees()
Lists all
the
available assignees to which issues may be assigned.
|
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(String sha1)
/** Lists all the commit statues attached to the given commit, newer ones first.
|
PagedIterable<GHRepository.Contributor> |
listContributors()
List contributors paged iterable.
|
PagedIterable<GHDeployment> |
listDeployments(String sha,
String ref,
String task,
String environment)
List deployments paged iterable.
|
PagedIterable<GHEventInfo> |
listEvents()
Lists repository events.
|
PagedIterable<GHRepository> |
listForks()
Lists all the direct forks of this repository, sorted by github api default, currently
ForkSort.NEWEST*. |
PagedIterable<GHRepository> |
listForks(GHRepository.ForkSort sort)
Lists all the direct forks of this repository, sorted by the given sort order.
|
PagedIterable<GHInvitation> |
listInvitations()
Lists all the invitations.
|
PagedIterable<GHIssueEvent> |
listIssueEvents()
Get all issue events for this repository.
|
PagedIterable<GHIssue> |
listIssues(GHIssueState state)
Lists up all the issues in this repository.
|
PagedIterable<GHLabel> |
listLabels()
Lists labels in this repository.
|
Map<String,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<GHProject> |
listProjects()
Returns open projects for this repository.
|
PagedIterable<GHProject> |
listProjects(GHProject.ProjectStateFilter status)
Returns the projects for this repository.
|
PagedIterable<GHPullRequest> |
listPullRequests(GHIssueState state)
Deprecated.
|
PagedIterable<GHRef> |
listRefs()
Retrieves all refs for the github repository.
|
PagedIterable<GHRef> |
listRefs(String refType)
Retrieves all refs of the given type for the current GitHub repository.
|
PagedIterable<GHRelease> |
listReleases()
List releases paged iterable.
|
PagedIterable<GHUser> |
listStargazers()
Lists all the users who have starred this repo based on the old version of the API.
|
PagedIterable<GHStargazer> |
listStargazers2()
Lists all the users who have starred this repo based on new version of the API, having extended information like
the time when the repository was starred.
|
PagedIterable<GHUser> |
listSubscribers()
Lists all the subscribers (aka watchers.)
|
PagedIterable<GHTag> |
listTags()
List tags paged iterable.
|
List<String> |
listTopics()
Return the topics for this repository.
|
GHCommitQueryBuilder |
queryCommits()
Search commits by specifying filters through a builder pattern.
|
GHPullRequestQueryBuilder |
queryPullRequests()
Retrieves pull requests.
|
InputStream |
readBlob(String blobSha)
Reads the content of a blob as a stream for better efficiency.
|
void |
removeCollaborators(Collection<GHUser> users)
Remove collaborators.
|
void |
removeCollaborators(GHUser... users)
Remove collaborators.
|
void |
renameTo(String name)
Rename this repository.
|
Reader |
renderMarkdown(String text,
MarkdownMode mode)
Render a Markdown document.
|
void |
setDefaultBranch(String value)
Sets default branch.
|
void |
setDescription(String value)
Sets description.
|
void |
setEmailServiceHook(String address)
Sets email service hook.
|
void |
setHomepage(String value)
Sets homepage.
|
void |
setPrivate(boolean value)
Sets private.
|
void |
setTopics(List<String> topics)
Set the topics for this repository.
|
GHSubscription |
subscribe(boolean subscribed,
boolean ignored)
Subscribes to this repository to get notifications.
|
getCreatedAt, getId, getResponseHeaderFields, getUpdatedAt, getUrl, toStringpublic GHDeploymentBuilder createDeployment(String ref)
ref - the refpublic PagedIterable<GHDeploymentStatus> getDeploymentStatuses(int id) throws IOException
getDeployment(id).listStatuses()id - the idIOException - the io exceptionpublic PagedIterable<GHDeployment> listDeployments(String sha, String ref, String task, String environment)
sha - the sharef - the reftask - the taskenvironment - the environmentpublic GHDeployment getDeployment(long id) throws IOException
GHDeployment by its ID.id - the idIOException - the io exceptionpublic GHDeploymentStatusBuilder createDeployStatus(int deploymentId, GHDeploymentState ghDeploymentState) throws IOException
getDeployment(deploymentId).createStatus(ghDeploymentState)deploymentId - the deployment idghDeploymentState - the gh deployment stateIOException - the io exceptionpublic String getDescription()
public String getHomepage()
public String getGitTransportUrl()
public String getHttpTransportUrl()
public String gitHttpTransportUrl()
getHttpTransportUrl()public String getSvnUrl()
public String getMirrorUrl()
public String getSshUrl()
public URL getHtmlUrl()
GHObjectgetHtmlUrl in class GHObjectpublic String getName()
public String getFullName()
public boolean hasPullAccess()
public boolean hasPushAccess()
public boolean hasAdminAccess()
public String getLanguage()
public GHUser getOwner() throws IOException
IOException - the io exceptionpublic GHIssue getIssue(int id) throws IOException
id - the idIOException - the io exceptionpublic GHIssueBuilder createIssue(String title)
title - the titlepublic List<GHIssue> getIssues(GHIssueState state) throws IOException
state - the stateIOException - the io exceptionpublic List<GHIssue> getIssues(GHIssueState state, GHMilestone milestone) throws IOException
state - the statemilestone - the milestoneIOException - the io exceptionpublic PagedIterable<GHIssue> listIssues(GHIssueState state)
state - the statepublic GHReleaseBuilder createRelease(String tag)
tag - the tagpublic GHRef createRef(String name, String sha) throws 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 toIOException - the io exceptionpublic List<GHRelease> getReleases() throws IOException
listReleases()IOException - the io exceptionpublic GHRelease getRelease(long id) throws IOException
id - the idIOException - the io exceptionpublic GHRelease getReleaseByTagName(String tag) throws IOException
tag - the tagIOException - the io exceptionpublic GHRelease getLatestRelease() throws IOException
IOException - the io exceptionpublic PagedIterable<GHRelease> listReleases() throws IOException
IOException - the io exceptionpublic PagedIterable<GHTag> listTags() throws IOException
IOException - the io exceptionpublic Map<String,Long> listLanguages() throws IOException
IOException - the io exceptionpublic String getOwnerName()
public boolean hasIssues()
public boolean hasWiki()
public boolean isFork()
public boolean isArchived()
public boolean isAllowSquashMerge()
public boolean isAllowMergeCommit()
public boolean isAllowRebaseMerge()
public int getForks()
public int getStargazersCount()
public boolean isPrivate()
public boolean hasDownloads()
public boolean hasPages()
public int getWatchers()
public int getOpenIssueCount()
public int getNetworkCount()
getForks()public int getSubscribersCount()
public Date getPushedAt()
public String getDefaultBranch()
public String getMasterBranch()
getDefaultBranch()public int getSize()
@WithBridgeMethods(value=java.util.Set.class) public GHPersonSet<GHUser> getCollaborators() throws IOException
IOException - the io exceptionpublic PagedIterable<GHUser> listCollaborators() throws IOException
IOException - the io exceptionpublic PagedIterable<GHUser> listAssignees() throws IOException
IOException - the io exceptionpublic boolean hasAssignee(GHUser u) throws IOException
u - the uIOException - the io exceptionpublic Set<String> getCollaboratorNames() throws IOException
getCollaborators().IOException - the io exceptionpublic GHPermissionType getPermission(String user) throws IOException
user - a GHPerson.getLogin()IOException - the io exceptionpublic GHPermissionType getPermission(GHUser u) throws IOException
u - the uIOException - the io exceptionpublic Set<GHTeam> getTeams() throws IOException
IOException - the io exceptionpublic void addCollaborators(GHUser... users) throws IOException
users - the usersIOException - the io exceptionpublic void addCollaborators(Collection<GHUser> users) throws IOException
users - the usersIOException - the io exceptionpublic void removeCollaborators(GHUser... users) throws IOException
users - the usersIOException - the io exceptionpublic void removeCollaborators(Collection<GHUser> users) throws IOException
users - the usersIOException - the io exceptionpublic void setEmailServiceHook(String address) throws IOException
address - the addressIOException - the io exceptionpublic void enableIssueTracker(boolean v)
throws IOException
v - the vIOException - the io exceptionpublic void enableWiki(boolean v)
throws IOException
v - the vIOException - the io exceptionpublic void enableDownloads(boolean v)
throws IOException
v - the vIOException - the io exceptionpublic void renameTo(String name) throws IOException
name - the nameIOException - the io exceptionpublic void setDescription(String value) throws IOException
value - the valueIOException - the io exceptionpublic void setHomepage(String value) throws IOException
value - the valueIOException - the io exceptionpublic void setDefaultBranch(String value) throws IOException
value - the valueIOException - the io exceptionpublic void setPrivate(boolean value)
throws IOException
value - the valueIOException - the io exceptionpublic void allowSquashMerge(boolean value)
throws IOException
value - the valueIOException - the io exceptionpublic void allowMergeCommit(boolean value)
throws IOException
value - the valueIOException - the io exceptionpublic void allowRebaseMerge(boolean value)
throws IOException
value - the valueIOException - the io exceptionpublic void delete()
throws IOException
IOException - the io exceptionpublic void archive()
throws IOException
When you try to do any operation that modifies a read-only repository, it returns the response:
org.kohsuke.github.HttpException: {
"message":"Repository was archived so is read-only.",
"documentation_url":"https://developer.github.com/v3/repos/#edit"
}
IOException - In case of any networking error or error from the server.public PagedIterable<GHRepository> listForks()
ForkSort.NEWEST*.public PagedIterable<GHRepository> listForks(GHRepository.ForkSort sort)
sort - the sort order. If null, defaults to github api default, currently ForkSort.NEWEST.public GHRepository fork() throws IOException
IOException - the io exceptionpublic GHRepository forkTo(GHOrganization org) throws IOException
org - the orgIOException - the io exceptionpublic GHPullRequest getPullRequest(int i) throws IOException
i - theIOException - the io exceptionpublic List<GHPullRequest> getPullRequests(GHIssueState state) throws IOException
state - the stateIOException - the io exception#listPullRequests(GHIssueState)public PagedIterable<GHPullRequest> listPullRequests(GHIssueState state)
queryPullRequests()state - the statepublic GHPullRequestQueryBuilder queryPullRequests()
public GHPullRequest createPullRequest(String title, String head, String base, String body) throws 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.IOException - the io exceptionpublic GHPullRequest createPullRequest(String title, String head, String base, String body, boolean maintainerCanModify) throws 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.maintainerCanModify - Indicates whether maintainers can modify the pull request.IOException - the io exceptionpublic GHPullRequest createPullRequest(String title, String head, String base, String body, boolean maintainerCanModify, boolean draft) throws 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.maintainerCanModify - Indicates whether maintainers can modify the pull request.draft - Indicates whether to create a draft pull request or not.IOException - the io exceptionpublic List<GHHook> getHooks() throws IOException
IOException - the io exceptionpublic GHHook getHook(int id) throws IOException
id - the idIOException - the io exceptionpublic GHCompare getCompare(String id1, String id2) throws IOException
git log id1...id2 against a local repository.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
id1 - the id 1id2 - the id 2IOException - the io exceptionpublic GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException
id1 - the id 1id2 - the id 2IOException - the io exceptionpublic GHRef[] getRefs() throws IOException
IOException - on failure communicating with GitHubpublic PagedIterable<GHRef> listRefs() throws IOException
IOException - on failure communicating with GitHub, potentially due to an invalid ref type being requestedpublic 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 PagedIterable<GHRef> listRefs(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 GHRef getRef(String refName) throws IOException
refName - eg: heads/branchIOException - on failure communicating with GitHub, potentially due to an invalid ref type being requestedpublic GHTagObject getTagObject(String sha) throws IOException
GHRef.getObject() has a
GHRef.GHObject.getType() of tag.sha - the sha of the tag objectIOException - the io exceptionpublic GHTree getTree(String sha) throws IOException
sha - sha number or branch name ex: "master"IOException - on failure communicating with GitHub, potentially due to an invalid tree type being requestedpublic GHTreeBuilder createTree()
public GHTree getTreeRecursive(String sha, int recursive) throws IOException
sha - sha number or branch name ex: "master"recursive - use 1IOException - on failure communicating with GitHub, potentially due to an invalid tree type being requestedpublic GHBlob getBlob(String blobSha) throws IOException
This method retrieves the whole content in memory, so beware when you are dealing with large BLOB.
blobSha - the blob shaIOException - the io exception#readBlob(String)public GHBlobBuilder createBlob()
public InputStream readBlob(String blobSha) throws IOException
blobSha - the blob shaIOException - the io exception#getBlob(String)public GHCommit getCommit(String sha1) throws IOException
sha1 - the sha 1IOException - the io exceptionpublic GHCommitBuilder createCommit()
public PagedIterable<GHCommit> listCommits()
public GHCommitQueryBuilder queryCommits()
public PagedIterable<GHCommitComment> listCommitComments()
public GHLicense getLicense() throws IOException
IOException - as usual but also if you don't use the preview connectorpublic GHContent getLicenseContent() throws IOException
IOException - as usual but also if you don't use the preview connectorpublic PagedIterable<GHCommitStatus> listCommitStatuses(String sha1) throws IOException
sha1 - the sha 1IOException - the io exceptionpublic GHCommitStatus getLastCommitStatus(String sha1) throws IOException
sha1 - the sha 1IOException - the io exceptionpublic GHCommitStatus createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description, String context) throws IOException
sha1 - the sha 1state - the statetargetUrl - Optional parameter that points to the URL that has more details.description - Optional short description.context - Optinal commit status context.IOException - the io exceptionpublic GHCommitStatus createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description) throws IOException
sha1 - the sha 1state - the statetargetUrl - the target urldescription - the descriptionIOException - the io exception#createCommitStatus(String,
GHCommitState,String,String,String)public PagedIterable<GHEventInfo> listEvents() throws IOException
IOException - the io exceptionpublic PagedIterable<GHLabel> listLabels() throws IOException
https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
IOException - the io exceptionpublic GHLabel getLabel(String name) throws IOException
name - the nameIOException - the io exceptionpublic GHLabel createLabel(String name, String color) throws IOException
name - the namecolor - the colorIOException - the io exceptionpublic GHLabel createLabel(String name, String color, String description) throws IOException
name - the namecolor - the colordescription - the descriptionIOException - the io exceptionpublic PagedIterable<GHInvitation> listInvitations()
public PagedIterable<GHUser> listSubscribers()
https://developer.github.com/v3/activity/watching/
public PagedIterable<GHUser> listStargazers()
listStargazers2()public PagedIterable<GHStargazer> listStargazers2()
listStargazers()public 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.active - the activeIOException - the io exceptionpublic GHHook createWebHook(URL url, Collection<GHEvent> events) throws IOException
url - the urlevents - the eventsIOException - the io exceptionpublic GHHook createWebHook(URL url) throws IOException
url - the urlIOException - the io exceptionpublic Set<URL> getPostCommitHooks()
getHooks() and createHook(String, Map, Collection, boolean)public Map<String,GHBranch> getBranches() throws IOException
IOException - the io exceptionpublic GHBranch getBranch(String name) throws IOException
name - the nameIOException - the io exceptionpublic Map<Integer,GHMilestone> getMilestones() throws IOException
listMilestones(GHIssueState)IOException - the io exceptionpublic PagedIterable<GHMilestone> listMilestones(GHIssueState state)
state - the statepublic GHMilestone getMilestone(int number) throws IOException
number - the numberIOException - the io exceptionpublic GHContent getFileContent(String path) throws IOException
path - the pathIOException - the io exceptionpublic GHContent getFileContent(String path, String ref) throws IOException
path - the pathref - the refIOException - the io exceptionpublic List<GHContent> getDirectoryContent(String path) throws IOException
path - the pathIOException - the io exceptionpublic List<GHContent> getDirectoryContent(String path, String ref) throws IOException
path - the pathref - the refIOException - the io exceptionpublic GHContent getReadme() throws IOException
IOException - the io exceptionpublic GHContentBuilder createContent()
@Deprecated public GHContentUpdateResponse createContent(String content, String commitMessage, String path) throws IOException
createContent().content - the contentcommitMessage - the commit messagepath - the pathIOException - the io exception@Deprecated public GHContentUpdateResponse createContent(String content, String commitMessage, String path, String branch) throws IOException
createContent().content - the contentcommitMessage - the commit messagepath - the pathbranch - the branchIOException - the io exception@Deprecated public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path) throws IOException
createContent().contentBytes - the content bytescommitMessage - the commit messagepath - the pathIOException - the io exception@Deprecated public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path, String branch) throws IOException
createContent().contentBytes - the content bytescommitMessage - the commit messagepath - the pathbranch - the branchIOException - the io exceptionpublic GHMilestone createMilestone(String title, String description) throws IOException
title - the titledescription - the descriptionIOException - the io exceptionpublic GHDeployKey addDeployKey(String title, String key) throws IOException
title - the titlekey - the keyIOException - the io exceptionpublic List<GHDeployKey> getDeployKeys() throws IOException
IOException - the io exceptionpublic GHRepository getSource() throws IOException
GHRepository that points to the root repository where this repository is forked (indirectly or
directly) from. Otherwise null.IOException - the io exception#getParent()public GHRepository getParent() throws IOException
getParent() until it returns null, that is getSource().GHRepository that points to the repository where this repository is forked directly from.
Otherwise null.IOException - the io exception#getSource()public GHSubscription subscribe(boolean subscribed, boolean ignored) throws IOException
subscribed - the subscribedignored - the ignoredIOException - the io exceptionpublic GHSubscription getSubscription() throws IOException
IOException - the io exceptionpublic PagedIterable<GHRepository.Contributor> listContributors() throws IOException
IOException - the io exceptionpublic GHRepositoryStatistics getStatistics()
public GHProject createProject(String name, String body) throws IOException
name - the namebody - the bodyIOException - the io exceptionpublic PagedIterable<GHProject> listProjects(GHProject.ProjectStateFilter status) throws IOException
status - The status filter (all, open or closed).IOException - the io exceptionpublic PagedIterable<GHProject> listProjects() throws IOException
IOException - the io exceptionpublic Reader renderMarkdown(String text, MarkdownMode mode) throws IOException
In GFM mode, issue numbers and user mentions are linked accordingly.
text - the textmode - the modeIOException - the io exceptionGitHub#renderMarkdown(String)public GHNotificationStream listNotifications()
public GHRepositoryViewTraffic getViewTraffic() throws IOException
IOException - the io exceptionpublic GHRepositoryCloneTraffic getCloneTraffic() throws IOException
IOException - the io exceptionpublic PagedIterable<GHIssueEvent> listIssueEvents() throws IOException
IOException - the io exceptionpublic GHIssueEvent getIssueEvent(long id) throws IOException
id - the idIOException - the io exceptionpublic List<String> listTopics() throws IOException
IOException - the io exceptionpublic void setTopics(List<String> topics) throws IOException
topics - the topicsIOException - the io exceptionpublic GHTagObject createTag(String tag, String message, String object, String type) throws IOException
tag - The tag's name.message - The tag message.object - The SHA of the git object this is tagging.type - The type of the object we're tagging: "commit", "tree" or "blob".IOException - The IO exception.Copyright © 2020. All rights reserved.