Spring Social GitHub

org.springframework.social.github.api.impl
Class RepoTemplate

java.lang.Object
  extended by org.springframework.social.github.api.impl.RepoTemplate
All Implemented Interfaces:
RepoOperations

public class RepoTemplate
extends java.lang.Object
implements RepoOperations

Repository template implementation.

Author:
Willie Wheeler (willie.wheeler@gmail.com)

Constructor Summary
RepoTemplate(org.springframework.web.client.RestTemplate restTemplate, boolean isAuthorizedForUser)
           
 
Method Summary
protected  java.lang.String buildUri(java.lang.String path)
           
 java.util.List<GitHubUser> getCollaborators(java.lang.String user, java.lang.String repo)
          Public operation to return a list of collaborators for the given repository.
 java.util.List<GitHubCommit> getCommits(java.lang.String user, java.lang.String repo)
          Public operation to return a list of commits for the given repository.
 GitHubDownload getDownload(java.lang.String user, java.lang.String repo, java.lang.Long id)
          Public operation to return a single download.
 java.util.List<GitHubDownload> getDownloads(java.lang.String user, java.lang.String repo)
          Public operation to return a list of downloads for the given repository.
 java.util.List<GitHubRepo> getForks(java.lang.String user, java.lang.String repo)
          Public operation to return the forks for the given repository.
 java.util.List<GitHubHook> getHooks(java.lang.String user, java.lang.String repo)
          Authorized operation to return a list of hooks for the given repository.
 GitHubRepo getRepo(java.lang.String user, java.lang.String repo)
          Public operation to return a repo.
 java.util.List<GitHubUser> getWatchers(java.lang.String user, java.lang.String repo)
          Public operation to return a list of watchers for the given repository.
protected  void requireAuthorization()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepoTemplate

public RepoTemplate(org.springframework.web.client.RestTemplate restTemplate,
                    boolean isAuthorizedForUser)
Parameters:
restTemplate -
isAuthorizedForUser -
Method Detail

getRepo

public GitHubRepo getRepo(java.lang.String user,
                          java.lang.String repo)
Description copied from interface: RepoOperations
Public operation to return a repo.

Specified by:
getRepo in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repo
Returns:
repo

getCollaborators

public java.util.List<GitHubUser> getCollaborators(java.lang.String user,
                                                   java.lang.String repo)
Description copied from interface: RepoOperations
Public operation to return a list of collaborators for the given repository.

Specified by:
getCollaborators in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
Returns:
list of collaborators

getCommits

public java.util.List<GitHubCommit> getCommits(java.lang.String user,
                                               java.lang.String repo)
Description copied from interface: RepoOperations
Public operation to return a list of commits for the given repository.

Specified by:
getCommits in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
Returns:
list of commits

getDownloads

public java.util.List<GitHubDownload> getDownloads(java.lang.String user,
                                                   java.lang.String repo)
Description copied from interface: RepoOperations
Public operation to return a list of downloads for the given repository.

Specified by:
getDownloads in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
Returns:
list of downloads

getDownload

public GitHubDownload getDownload(java.lang.String user,
                                  java.lang.String repo,
                                  java.lang.Long id)
Description copied from interface: RepoOperations
Public operation to return a single download.

Specified by:
getDownload in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
id - download ID
Returns:
download

getForks

public java.util.List<GitHubRepo> getForks(java.lang.String user,
                                           java.lang.String repo)
Description copied from interface: RepoOperations
Public operation to return the forks for the given repository.

Specified by:
getForks in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
Returns:
list of repository forks

getWatchers

public java.util.List<GitHubUser> getWatchers(java.lang.String user,
                                              java.lang.String repo)
Description copied from interface: RepoOperations
Public operation to return a list of watchers for the given repository.

Specified by:
getWatchers in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
Returns:
list of watchers

getHooks

public java.util.List<GitHubHook> getHooks(java.lang.String user,
                                           java.lang.String repo)
Description copied from interface: RepoOperations
Authorized operation to return a list of hooks for the given repository.

Specified by:
getHooks in interface RepoOperations
Parameters:
user - GitHub user
repo - GitHub repository
Returns:
list of hooks

requireAuthorization

protected void requireAuthorization()

buildUri

protected java.lang.String buildUri(java.lang.String path)

Spring Social GitHub