/** * Get all comments on all commits in the given repository * * @param repository * @return non-null but possibly empty list of commits * @throws IOException */ public List<CommitComment> getComments(IRepositoryIdProvider repository) throws IOException { return getAll(pageComments(repository)); }
/** * Get all comments on commit with given SHA-1 * * @param repository * @param sha * @return non-null but possibly empty list of commits * @throws IOException */ public List<CommitComment> getComments(IRepositoryIdProvider repository, String sha) throws IOException { return getAll(pageComments(repository, sha)); }
/** * Get all commits in given repository beginning at an optional commit SHA-1 * and affecting an optional path. * * @param repository * @param sha * @param path * @return non-null but possibly empty list of repository commits * @throws IOException */ public List<RepositoryCommit> getCommits(IRepositoryIdProvider repository, String sha, String path) throws IOException { return getAll(pageCommits(repository, sha, path)); }
/** * Get statuses for commit SHA-1 * * @param repository * @param sha * @return list of statuses * @throws IOException */ public List<CommitStatus> getStatuses(IRepositoryIdProvider repository, String sha) throws IOException { String id = getId(repository); if (sha == null) throw new IllegalArgumentException("SHA-1 cannot be null"); //$NON-NLS-1$ if (sha.length() == 0) throw new IllegalArgumentException("SHA-1 cannot be empty"); //$NON-NLS-1$ StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(id); uri.append(SEGMENT_STATUSES); uri.append('/').append(sha); PagedRequest<CommitStatus> request = createPagedRequest(); request.setType(new TypeToken<List<CommitStatus>>() { }.getType()); request.setUri(uri); return getAll(request); }