/** * Lists up all repositories this user owns (public and private). * * Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned. * Repositories are returned by GitHub API with a 30 items per page. */ @Override public PagedIterable<GHRepository> listRepositories() { return listRepositories(30); }
/** * @deprecated * Use {@link #listRepositories()} */ public PagedIterable<GHRepository> listAllRepositories() { return listRepositories(); }
/** * @deprecated * Use {@link #listRepositories()} */ public PagedIterable<GHRepository> listAllRepositories() { return listRepositories(); }
/** * Lists up all repositories this user owns (public and private). * * Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned. * Repositories are returned by GitHub API with a 30 items per page. */ @Override public PagedIterable<GHRepository> listRepositories() { return listRepositories(30); }
/** * @deprecated * Use {@link #listRepositories()} */ public PagedIterable<GHRepository> listAllRepositories() { return listRepositories(); }
/** * List repositories that are accessible to the authenticated user (public and private) using the specified page size. * * This includes repositories owned by the authenticated user, repositories that belong to other users * where the authenticated user is a collaborator, and other organizations' repositories that the authenticated * user has access to through an organization membership. * * @param pageSize size for each page of items returned by GitHub. Maximum page size is 100. * * Unlike {@link #getRepositories()}, this does not wait until all the repositories are returned. */ public PagedIterable<GHRepository> listRepositories(final int pageSize) { return listRepositories(pageSize, RepositoryListFilter.ALL); }
/** * Lists up all repositories this user owns (public and private). * * Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned. * Repositories are returned by GitHub API with a 30 items per page. */ @Override public PagedIterable<GHRepository> listRepositories() { return listRepositories(30); }
/** * List repositories that are accessible to the authenticated user (public and private) using the specified page size. * * This includes repositories owned by the authenticated user, repositories that belong to other users * where the authenticated user is a collaborator, and other organizations' repositories that the authenticated * user has access to through an organization membership. * * @param pageSize size for each page of items returned by GitHub. Maximum page size is 100. * * Unlike {@link #getRepositories()}, this does not wait until all the repositories are returned. */ public PagedIterable<GHRepository> listRepositories(final int pageSize) { return listRepositories(pageSize, RepositoryListFilter.ALL); }
public PagedIterable<GHRepository> getGHRepositories(Multimap<String, String> pathToDockerfileInParentRepo, GHMyself currentUser) throws InterruptedException { PagedIterable<GHRepository> listOfRepos; Set<String> repoNamesSet = new HashSet<>(); while (true) { listOfRepos = currentUser.listRepositories(100, GHMyself.RepositoryListFilter.OWNER); for (GHRepository repo : listOfRepos) { repoNamesSet.add(repo.getName()); } boolean listOfReposHasRecentForks = true; for (String s : pathToDockerfileInParentRepo.keySet()) { String forkName = s.substring(s.lastIndexOf('/') + 1); log.info(forkName); if (!repoNamesSet.contains(forkName)) { listOfReposHasRecentForks = false; } } if (listOfReposHasRecentForks) { break; } else { log.info("Waiting for GitHub API cache to clear..."); Thread.sleep(TimeUnit.MINUTES.toMillis(1)); } } return listOfRepos; } }
public PagedIterable<GHRepository> getGHRepositories(Multimap<String, String> pathToDockerfileInParentRepo, GHMyself currentUser) throws InterruptedException { PagedIterable<GHRepository> listOfRepos; Set<String> repoNamesSet = new HashSet<>(); while (true) { listOfRepos = currentUser.listRepositories(100, GHMyself.RepositoryListFilter.OWNER); for (GHRepository repo : listOfRepos) { repoNamesSet.add(repo.getName()); } boolean listOfReposHasRecentForks = true; for (String s : pathToDockerfileInParentRepo.keySet()) { String forkName = s.substring(s.lastIndexOf('/') + 1); log.info(forkName); if (!repoNamesSet.contains(forkName)) { listOfReposHasRecentForks = false; } } if (listOfReposHasRecentForks) { break; } else { log.info("Waiting for GitHub API cache to clear..."); Thread.sleep(TimeUnit.MINUTES.toMillis(1)); } } return listOfRepos; } }
public Iterable<GHRepository> getRepositories(final String orgName) { try { if (orgName.equals(this.user.getLogin())) { return this.gh.getMyself().listRepositories(); } else { return this.gh.getOrganization(orgName).listRepositories(); } } catch (final IOException e) { throw new RuntimeException(e); } }
for (GHRepository repo : myself.listRepositories(100, GHMyself.RepositoryListFilter.OWNER)) { result.add(repo.getName());
"Looking up repositories of myself %s", repoOwner ))); for (GHRepository repo : myself.listRepositories(100)) { Connector.checkApiRateLimit(listener, github); if (!repo.getOwnerName().equals(repoOwner)) {