Package com.atlassian.bamboo.plugins.git
Class GitHubAccessor
- java.lang.Object
-
- com.atlassian.bamboo.plugins.git.GitHubAccessor
-
public class GitHubAccessor extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GitHubAccessor.GitHubException
protected static class
GitHubAccessor.HttpResponse
-
Constructor Summary
Constructors Constructor Description GitHubAccessor(String username, String password)
Deprecated.since 9.1GitHubAccessor(String username, String password, String apiBaseUrl)
-
Method Summary
-
-
-
Method Detail
-
getAccessibleRepositories
public Iterable<String> getAccessibleRepositories() throws IOException, GitHubAccessor.GitHubException
-
getAccessibleRepositoriesAndBranches
public Map<String,Iterable<String>> getAccessibleRepositoriesAndBranches() throws IOException, GitHubAccessor.GitHubException
-
getBranches
public Iterable<String> getBranches(String userRepo) throws IOException, GitHubAccessor.GitHubException
-
getUserOrganisations
public Iterable<String> getUserOrganisations() throws IOException, GitHubAccessor.GitHubException
-
getUserRepositories
public Iterable<String> getUserRepositories() throws IOException, GitHubAccessor.GitHubException
-
getOrganisationRepositories
public Iterable<String> getOrganisationRepositories(String org) throws IOException, GitHubAccessor.GitHubException
-
commentOnCommit
public boolean commentOnCommit(String commitId, VcsRepositoryData repositoryData, String message) throws RepositoryException
- Throws:
RepositoryException
-
getPullRequests
public List<GithubPullRequestDto> getPullRequests(VcsRepositoryData repositoryData) throws IOException, GitHubAccessor.GitHubException
-
getCommits
public List<String> getCommits(String repo) throws IOException, GitHubAccessor.GitHubException
-
getCommentIds
public List<String> getCommentIds(String repo, String commitId) throws IOException, GitHubAccessor.GitHubException
-
deleteComment
public void deleteComment(String repo, String commentId) throws IOException
- Throws:
IOException
-
getStringFromUrl
protected GitHubAccessor.HttpResponse getStringFromUrl(String url) throws IOException
Get a string from a given URL.- Parameters:
url
- url to GET from.- Returns:
- a Pair of String (response body) and a map of response headers.
- Throws:
IOException
- if a problem occurred in the IO layer.
-
post
protected GitHubAccessor.HttpResponse post(@NotNull @NotNull String url, @NotNull @NotNull String payload, @Nullable @Nullable com.google.common.collect.Multimap<String,String> headers) throws IOException
- Throws:
IOException
-
delete
protected GitHubAccessor.HttpResponse delete(@NotNull @NotNull String url, @Nullable @Nullable com.google.common.collect.Multimap<String,String> headers) throws IOException
- Throws:
IOException
-
-