diff options
Diffstat (limited to 'org.eclipse.egit.github.core')
-rw-r--r-- | org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java index 8d2a2cae..7fc2746d 100644 --- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java +++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java @@ -21,6 +21,7 @@ import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_LANGU import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_LEGACY; import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_ORGS; import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_REPOS; +import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_REPOSITORIES; import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_SEARCH; import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_TAGS; import static org.eclipse.egit.github.core.client.IGitHubConstants.SEGMENT_TEST; @@ -232,6 +233,32 @@ public class RepositoryService extends GitHubService { } /** + * Page all repositories + * + * @return iterator over pages of repositories + */ + public PageIterator<Repository> pageAllRepositories() { + return pageAllRepositories(-1); + } + + /** + * Page all repositories + * + * @param since + * @return iterator over pages of repositories + */ + public PageIterator<Repository> pageAllRepositories(final long since) { + PagedRequest<Repository> request = createPagedRequest(); + request.setUri(SEGMENT_REPOSITORIES); + if (since > 0) + request.setParams(Collections.singletonMap("since", + Long.toString(since))); + request.setType(new TypeToken<List<Repository>>() { + }.getType()); + return createPageIterator(request); + } + + /** * Get repositories for the given user * * @param user |