Spring Social GitHub

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

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

public class GistTemplate
extends java.lang.Object
implements GistOperations

Gist template implementation.

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

Constructor Summary
GistTemplate(org.springframework.web.client.RestTemplate restTemplate, boolean isAuthorizedForUser)
           
 
Method Summary
protected  java.lang.String buildUri(java.lang.String path)
           
 GitHubGist getGist(java.lang.String id)
          Returns the gist with the given ID.
 GitHubComment getGistComment(java.lang.Long id)
          Public operation to return a gist comment.
 java.util.List<GitHubComment> getGistComments(java.lang.String id)
          Public operation to return the comments on a given gist.
 java.util.List<GitHubGist> getGists()
           If authenticated, this method returns the current user's gists.
 java.util.List<GitHubGist> getPublicGists()
          Public operation to return all public gists.
 java.util.List<GitHubGist> getStarredGists()
          Returns the authenticated user's starred gists.
 java.util.List<GitHubGist> getUserGists(java.lang.String user)
          Public operation to return the given user's public gists.
protected  void requireAuthorization()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GistTemplate

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

getUserGists

public java.util.List<GitHubGist> getUserGists(java.lang.String user)
Description copied from interface: GistOperations
Public operation to return the given user's public gists.

Specified by:
getUserGists in interface GistOperations
Parameters:
user - GitHub user
Returns:
list of user's gists

getGists

public java.util.List<GitHubGist> getGists()
Description copied from interface: GistOperations

If authenticated, this method returns the current user's gists. Otherwise it returns all public gists.

Specified by:
getGists in interface GistOperations
Returns:
current user's gists, or else all public gists

getPublicGists

public java.util.List<GitHubGist> getPublicGists()
Description copied from interface: GistOperations
Public operation to return all public gists.

Specified by:
getPublicGists in interface GistOperations
Returns:
all public gists

getStarredGists

public java.util.List<GitHubGist> getStarredGists()
Description copied from interface: GistOperations
Returns the authenticated user's starred gists.

Specified by:
getStarredGists in interface GistOperations
Returns:
authenticated user's starred gists

getGist

public GitHubGist getGist(java.lang.String id)
Description copied from interface: GistOperations
Returns the gist with the given ID.

Specified by:
getGist in interface GistOperations
Parameters:
id - gist ID
Returns:
gist

getGistComments

public java.util.List<GitHubComment> getGistComments(java.lang.String id)
Description copied from interface: GistOperations
Public operation to return the comments on a given gist.

Specified by:
getGistComments in interface GistOperations
Parameters:
id - gist ID
Returns:
gist comments

getGistComment

public GitHubComment getGistComment(java.lang.Long id)
Description copied from interface: GistOperations
Public operation to return a gist comment.

Specified by:
getGistComment in interface GistOperations
Parameters:
id - comment ID
Returns:
comment

requireAuthorization

protected void requireAuthorization()

buildUri

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

Spring Social GitHub