Class GistTemplate
- java.lang.Object
-
- org.springframework.social.github.api.impl.GistTemplate
-
- All Implemented Interfaces:
GistOperations
public class GistTemplate extends Object implements GistOperations
Gist template implementation.
- Author:
- Willie Wheeler (willie.wheeler@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description GistTemplate(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)GitHubGistgetGist(String id)Returns the gist with the given ID.GitHubCommentgetGistComment(Long id)Public operation to return a gist comment.List<GitHubComment>getGistComments(String id)Public operation to return the comments on a given gist.List<GitHubGist>getGists()If authenticated, this method returns the current user's gists.List<GitHubGist>getPublicGists()Public operation to return all public gists.List<GitHubGist>getStarredGists()Returns the authenticated user's starred gists.List<GitHubGist>getUserGists(String user)Public operation to return the given user's public gists.protected voidrequireAuthorization()
-
-
-
Method Detail
-
getUserGists
public List<GitHubGist> getUserGists(String user)
Description copied from interface:GistOperationsPublic operation to return the given user's public gists.- Specified by:
getUserGistsin interfaceGistOperations- Parameters:
user- GitHub user- Returns:
- list of user's gists
-
getGists
public List<GitHubGist> getGists()
Description copied from interface:GistOperationsIf authenticated, this method returns the current user's gists. Otherwise it returns all public gists.
- Specified by:
getGistsin interfaceGistOperations- Returns:
- current user's gists, or else all public gists
-
getPublicGists
public List<GitHubGist> getPublicGists()
Description copied from interface:GistOperationsPublic operation to return all public gists.- Specified by:
getPublicGistsin interfaceGistOperations- Returns:
- all public gists
-
getStarredGists
public List<GitHubGist> getStarredGists()
Description copied from interface:GistOperationsReturns the authenticated user's starred gists.- Specified by:
getStarredGistsin interfaceGistOperations- Returns:
- authenticated user's starred gists
-
getGist
public GitHubGist getGist(String id)
Description copied from interface:GistOperationsReturns the gist with the given ID.- Specified by:
getGistin interfaceGistOperations- Parameters:
id- gist ID- Returns:
- gist
-
getGistComments
public List<GitHubComment> getGistComments(String id)
Description copied from interface:GistOperationsPublic operation to return the comments on a given gist.- Specified by:
getGistCommentsin interfaceGistOperations- Parameters:
id- gist ID- Returns:
- gist comments
-
getGistComment
public GitHubComment getGistComment(Long id)
Description copied from interface:GistOperationsPublic operation to return a gist comment.- Specified by:
getGistCommentin interfaceGistOperations- Parameters:
id- comment ID- Returns:
- comment
-
requireAuthorization
protected void requireAuthorization()
-
-