Examples of GitHubClient


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

   * @throws Exception
   */
  @Test
  public void validHostname() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient("h", "a", "b", null, null,
        null, null);
    assertNotNull(client);
    assertEquals("h", mojo.host.get());
  }
View Full Code Here

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

   * @throws Exception
   */
  @Test
  public void nullHostname() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient(null, "a", "b", null, null,
        null, null);
    assertNotNull(client);
    assertNull(mojo.host.get());
  }
View Full Code Here

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

   * @throws Exception
   */
  @Test
  public void emptyHost() throws Exception {
    TestMojo mojo = new TestMojo();
    GitHubClient client = mojo.createClient("", "a", "b", null, null, null,
        null);
    assertNotNull(client);
    assertNull(mojo.host.get());
  }
View Full Code Here

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

   */
  protected GitHubClient createClient(String host, String userName,
      String password, String oauth2Token, String serverId,
      Settings settings, MavenSession session)
      throws MojoExecutionException {
    GitHubClient client;
    if (!StringUtils.isEmpty(host)) {
      if (isDebug())
        debug("Using custom host: " + host);
      client = createClient(host);
    } else
View Full Code Here

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

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

            }
        }
    }

    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

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

      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

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

    }
  }

  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

Examples of org.pac4j.oauth.client.GitHubClient

    return new TwitterClient(configurer.getTwitterClientKey(), configurer.getTwitterClientSecret());
  }
 
  @Bean
  public GitHubClient gitHubClient() {
    GitHubClient gitHubClient = new GitHubClient(configurer.getGitHubClientKey(), configurer.getGitHubClientSecret());
    gitHubClient.setScope(null);
    return gitHubClient;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.