/** * Get gists for specified user * * @param user * @return list of gists * @throws IOException */ public List<Gist> getGists(String user) throws IOException { return getAll(pageGists(user)); }
/** * Get starred gists for currently authenticated user * * @return list of gists * @throws IOException */ public List<Gist> getStarredGists() throws IOException { return getAll(pageStarredGists()); }
/** * Get comments for specified gist id * * @param gistId * @return list of comments * @throws IOException */ public List<Comment> getComments(String gistId) throws IOException { checkGistId(gistId); StringBuilder uri = new StringBuilder(SEGMENT_GISTS); uri.append('/').append(gistId); uri.append(SEGMENT_COMMENTS); PagedRequest<Comment> request = createPagedRequest(); request.setUri(uri).setType(new TypeToken<List<Comment>>() { }.getType()); return getAll(request); }