/** * Get repositories for the given user * * @param user * @return list of repositories * @throws IOException */ public List<Repository> getRepositories(String user) throws IOException { return getAll(pageRepositories(user)); }
/** * Get repositories for the currently authenticated user * * @param filterData * @return list of repositories * @throws IOException */ public List<Repository> getRepositories(Map<String, String> filterData) throws IOException { return getAll(pageRepositories(filterData)); }
/** * Get all the forks of the given repository * * @param repository * @return non-null but possibly empty list of repository * @throws IOException */ public List<Repository> getForks(IRepositoryIdProvider repository) throws IOException { return getAll(pageForks(repository)); }
/** * Get organization repositories for the given organization * * @param organization * @param filterData * @return list of repositories * @throws IOException */ public List<Repository> getOrgRepositories(String organization, Map<String, String> filterData) throws IOException { return getAll(pageOrgRepositories(organization, filterData)); }
return getAll(request);
/** * Get branches in given repository * * @param repository * @return list of branches * @throws IOException */ public List<RepositoryBranch> getBranches(IRepositoryIdProvider repository) throws IOException { String id = getId(repository); StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(id); uri.append(SEGMENT_BRANCHES); PagedRequest<RepositoryBranch> request = createPagedRequest(); request.setUri(uri); request.setType(new TypeToken<List<RepositoryBranch>>() { }.getType()); return getAll(request); }
/** * Get tags in given repository * * @param repository * @return list of tags * @throws IOException */ public List<RepositoryTag> getTags(IRepositoryIdProvider repository) throws IOException { String id = getId(repository); StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(id); uri.append(SEGMENT_TAGS); PagedRequest<RepositoryTag> request = createPagedRequest(); request.setUri(uri); request.setType(new TypeToken<List<RepositoryTag>>() { }.getType()); return getAll(request); }
/** * Get hooks for given repository * * @param repository * @return list of hooks * @throws IOException */ public List<RepositoryHook> getHooks(IRepositoryIdProvider repository) throws IOException { String id = getId(repository); StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(id); uri.append(SEGMENT_HOOKS); PagedRequest<RepositoryHook> request = createPagedRequest(); request.setUri(uri); request.setType(new TypeToken<List<RepositoryHook>>() { }.getType()); return getAll(request); }
/** * Get contributors to repository * * @param repository * @param includeAnonymous * @return list of contributors * @throws IOException */ public List<Contributor> getContributors(IRepositoryIdProvider repository, boolean includeAnonymous) throws IOException { String id = getId(repository); StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(id); uri.append(SEGMENT_CONTRIBUTORS); PagedRequest<Contributor> request = createPagedRequest(); request.setUri(uri); if (includeAnonymous) request.setParams(Collections.singletonMap("anon", "1")); //$NON-NLS-1$ //$NON-NLS-2$ request.setType(new TypeToken<List<Contributor>>() { }.getType()); return getAll(request); }