Class RepoTemplate
- java.lang.Object
-
- org.springframework.social.github.api.impl.RepoTemplate
-
- All Implemented Interfaces:
RepoOperations
public class RepoTemplate extends Object implements RepoOperations
Repository template implementation.
- Author:
- Willie Wheeler (willie.wheeler@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description RepoTemplate(org.springframework.web.client.RestTemplate restTemplate, boolean isAuthorizedForUser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringbuildUri(String path)List<GitHubUser>getCollaborators(String user, String repo)Public operation to return a list of collaborators for the given repository.List<GitHubCommit>getCommits(String user, String repo)Public operation to return a list of commits for the given repository.GitHubDownloadgetDownload(String user, String repo, Long id)Public operation to return a single download.List<GitHubDownload>getDownloads(String user, String repo)Public operation to return a list of downloads for the given repository.List<GitHubRepo>getForks(String user, String repo)Public operation to return the forks for the given repository.List<GitHubHook>getHooks(String user, String repo)Authorized operation to return a list of hooks for the given repository.GitHubRepogetRepo(String user, String repo)Public operation to return a repo.List<GitHubUser>getWatchers(String user, String repo)Public operation to return a list of watchers for the given repository.protected voidrequireAuthorization()
-
-
-
Method Detail
-
getRepo
public GitHubRepo getRepo(String user, String repo)
Description copied from interface:RepoOperationsPublic operation to return a repo.- Specified by:
getRepoin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repo- Returns:
- repo
-
getCollaborators
public List<GitHubUser> getCollaborators(String user, String repo)
Description copied from interface:RepoOperationsPublic operation to return a list of collaborators for the given repository.- Specified by:
getCollaboratorsin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repository- Returns:
- list of collaborators
-
getCommits
public List<GitHubCommit> getCommits(String user, String repo)
Description copied from interface:RepoOperationsPublic operation to return a list of commits for the given repository.- Specified by:
getCommitsin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repository- Returns:
- list of commits
-
getDownloads
public List<GitHubDownload> getDownloads(String user, String repo)
Description copied from interface:RepoOperationsPublic operation to return a list of downloads for the given repository.- Specified by:
getDownloadsin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repository- Returns:
- list of downloads
-
getDownload
public GitHubDownload getDownload(String user, String repo, Long id)
Description copied from interface:RepoOperationsPublic operation to return a single download.- Specified by:
getDownloadin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repositoryid- download ID- Returns:
- download
-
getForks
public List<GitHubRepo> getForks(String user, String repo)
Description copied from interface:RepoOperationsPublic operation to return the forks for the given repository.- Specified by:
getForksin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repository- Returns:
- list of repository forks
-
getWatchers
public List<GitHubUser> getWatchers(String user, String repo)
Description copied from interface:RepoOperationsPublic operation to return a list of watchers for the given repository.- Specified by:
getWatchersin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repository- Returns:
- list of watchers
-
getHooks
public List<GitHubHook> getHooks(String user, String repo)
Description copied from interface:RepoOperationsAuthorized operation to return a list of hooks for the given repository.- Specified by:
getHooksin interfaceRepoOperations- Parameters:
user- GitHub userrepo- GitHub repository- Returns:
- list of hooks
-
requireAuthorization
protected void requireAuthorization()
-
-