/** * Get gist comment with id * * @param commentId * @return comment * @throws IOException */ public Comment getComment(long commentId) throws IOException { StringBuilder uri = new StringBuilder(SEGMENT_GISTS + SEGMENT_COMMENTS); uri.append('/').append(commentId); GitHubRequest request = createRequest(); request.setUri(uri); request.setType(Comment.class); return (Comment) client.get(request).getBody(); }
/** * Get gist * * @param id * @return gist * @throws IOException */ public Gist getGist(String id) throws IOException { checkGistId(id); StringBuilder uri = new StringBuilder(SEGMENT_GISTS); uri.append('/').append(id); GitHubRequest request = createRequest(); request.setUri(uri); request.setType(Gist.class); return (Gist) client.get(request).getBody(); }