Package org.eclipse.egit.github.core.client

Examples of org.eclipse.egit.github.core.client.GitHubClient


            try {
                if (linha.startsWith("#")) {
                    continue;
                }
                String[] login = linha.split("[,]");
                GitHubClient cl = createClient(login[0], login[1]);
                if (cl != null) {
                    clients.add(cl);
                    clientCount++;
                }
            } catch (Exception ex) {
View Full Code Here


            }
        }
    }

    private static GitHubClient createClient(String user, String pass) throws Exception {
        GitHubClient cliente = new GitHubClient();
        cliente.setCredentials(user, pass);
        OAuthService oauth = new OAuthService(cliente);
        Authorization auth = new Authorization();

        try {
            String token;
            if (oauth.getAuthorizations() == null || oauth.getAuthorizations().isEmpty()) {
                auth = oauth.createAuthorization(auth);
                token = auth.getToken();
                System.out.println("autorizooou: " + token);
            } else {
                List<Authorization> auths = oauth.getAuthorizations();
                System.out.println("autorizaçoes: " + auths.size());
                System.out.println("autorização: " + auths.get(0));
                token = auths.get(0).getToken();
                System.out.println("token: " + token);
            }
            return new GitHubClient().setOAuth2Token(token);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
View Full Code Here

      System.out.println();
    }
  }

  public String[] getRepositories(String pAccessToken) {
    GitHubClient client = new GitHubClient();
    client.setOAuth2Token(pAccessToken);
    RepositoryService service = new RepositoryService(client);
    try {
      List<Repository> repositories = service.getRepositories();
      String[] result = new String[repositories.size()];
      for (int i = 0; i < repositories.size(); i++) {
View Full Code Here

    }
  }

  public String[] getIssues(String pAccessToken, String owner,
      String pRepository) {
    GitHubClient client = new GitHubClient();
    client.setOAuth2Token(pAccessToken);
    IssueService issueService = new IssueService(client);
    try {
      List<Issue> issues = issueService.getIssues("wimjongman",
          pRepository, null);
      String[] result = new String[issues.size()];
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.client.GitHubClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.