2016-12-10 19 views
1

すべての問題をすべての組織のすべてのリポジトリにリストしたいと思います。 私はこのコードを試してみました:リポジトリ内のすべての問題を一覧表示する

GitHubClient client = new GitHubClient(host); 
     client.setCredentials(user_name, password); 

     RepositoryService repository = new RepositoryService(client); 
     IssueService issues = new IssueService(client); 

     OrganizationService organization = new OrganizationService(client); 

     List<Repository> orgRepositories = repository.getOrgRepositories("eMerchantPay"); 

     for (int i = 0; i < orgRepositories.size(); i++) { 
      Repository get = orgRepositories.get(i); 
      String name = get.getName(); 
      System.out.println("Repository name " + name); 

      Map<String, String> map = new HashMap<>(); 
      List<Issue> issues1 = issues.getIssues(user_name, name, map); 

      for (int x = 0; x < issues1.size(); x++) { 
       Issue get1 = issues1.get(x); 
       String title = get1.getTitle(); 
       System.out.println("Issue name " + title); 
      } 

     } 

私はorg.eclipse.egit.github.coreライブラリでこれを行うことができますどのように?

答えて

2

org.eclipse.egit.github.core.service.IssueServiceを使用すると、特定のレポのすべての問題をフェッチできます。

あなたはページの問題のを取得しますexample in this questionを参照してください:

IssueService service = new IssueService(client); 
Map<String, String> params = new HashMap<String, String>(); 
params.put(IssueService.FILTER_STATE, IssueService.STATE_CLOSED); 
PageIterator<Issue> iterator = service.pageIssues("schacon", "showoff", 
     params, 1); 
関連する問題