当前位置: 首页>>代码示例>>Java>>正文


Java GitHubClient.setCredentials方法代码示例

本文整理汇总了Java中org.eclipse.egit.github.core.client.GitHubClient.setCredentials方法的典型用法代码示例。如果您正苦于以下问题:Java GitHubClient.setCredentials方法的具体用法?Java GitHubClient.setCredentials怎么用?Java GitHubClient.setCredentials使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.egit.github.core.client.GitHubClient的用法示例。


在下文中一共展示了GitHubClient.setCredentials方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
@Override
public GitHubGovernorClient build(
        GitHubGovernorConfiguration governorConfiguration) throws Exception {
    Validate.notNull(governorConfiguration, "GitHub governor configuration has to be set.");
    this.gitHubGovernorConfiguration = governorConfiguration;

    final GitHubClient gitHubClient = new GitHubClient();
    if (this.gitHubGovernorConfiguration.getUsername() != null && this.gitHubGovernorConfiguration.getUsername().length() > 0 && this.gitHubGovernorConfiguration.getPassword() != null && this.gitHubGovernorConfiguration.getPassword().length() > 0) {
        gitHubClient.setCredentials(this.gitHubGovernorConfiguration.getUsername(), this.gitHubGovernorConfiguration.getPassword());
    }

    if (this.gitHubGovernorConfiguration.getToken() != null && this.gitHubGovernorConfiguration.getToken().length() > 0) {
        gitHubClient.setOAuth2Token(gitHubGovernorConfiguration.getToken());
    }

    final GitHubGovernorClient gitHubGovernorClient = new GitHubGovernorClient(gitHubClient, gitHubGovernorConfiguration);
    gitHubGovernorClient.setGovernorStrategy(new GitHubGovernorStrategy(this.gitHubGovernorConfiguration));

    return gitHubGovernorClient;
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:21,代码来源:GitHubGovernorClientFactory.java

示例2: createGitHubClient

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
protected GitHubClient createGitHubClient() {
    // GitHub client (non authentified)
    GitHubClient client = new GitHubClient() {
        @Override
        protected HttpURLConnection configureRequest(HttpURLConnection request) {
            HttpURLConnection connection = super.configureRequest(request);
            connection.setRequestProperty(HEADER_ACCEPT, "application/vnd.github.v3.full+json");
            return connection;
        }
    };
    // Authentication
    String oAuth2Token = configuration.getOauth2Token();
    if (StringUtils.isNotBlank(oAuth2Token)) {
        client.setOAuth2Token(oAuth2Token);
    } else {
        String user = configuration.getUser();
        String password = configuration.getPassword();
        if (StringUtils.isNotBlank(user)) {
            client.setCredentials(user, password);
        }
    }
    return client;
}
 
开发者ID:nemerosa,项目名称:ontrack,代码行数:24,代码来源:DefaultOntrackGitHubClient.java

示例3: connect

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
public boolean connect(String username, String password){

		this.username=username;
		client = new GitHubClient();
		client.setCredentials(username, password);
		
		repoService = new MyRepositoriesService(client);
		userService = new UserService(client);
		issueService = new IssueService(client);
		milestoneService = new MilestoneService(client);
		labelService = new LabelService(client);
		commitService = new CommitService(client);
		markdownService = new MarkdownService(client);
		colaboratorService = new CollaboratorService(client);
		contentsService = new ContentsService(client);
		
		
		
		try {
			loadInformations();
			return true;
		} catch (IOException e) {
			mainApp.writeNotification(e.getMessage());
			return false;
		}
	}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:27,代码来源:GitHubModel.java

示例4: PublishHelper

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
public PublishHelper(CommitterInfo parameterObject,String commitMessage, RepositoryId id) {
	cl = new GitHubClient();
	cl.setCredentials(parameterObject.login, parameterObject.password);
	rs = new RepositoryService(cl);
	service = new DataService(cl);
	this.email=parameterObject.email;
	this.name=parameterObject.name;
	this.commitMessage=commitMessage;
	this.id=id;
}
 
开发者ID:OnPositive,项目名称:aml,代码行数:11,代码来源:PublishHelper.java

示例5: setup

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
@BeforeClass
public static void setup()
{
    GitHubClient gitHubClient = new GitHubClient(GITHUB_URL);
    gitHubClient.setUserAgent(USER_AGENT);
    gitHubClient.setCredentials(DVCS_REPO_OWNER, DVCS_REPO_PASSWORD);

    githubRepositoriesREST = new GithubRepositoriesRemoteRestpoint(gitHubClient);
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:10,代码来源:MissingCommitsGithubTest.java

示例6: createOAuthServiceRest

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
private OAuthService createOAuthServiceRest(final String repoOwner, final String repoPassword)
{
    GitHubClient gitHubClient = new GitHubClient(GITHUB_URL);
    gitHubClient.setUserAgent(USER_AGENT);
    gitHubClient.setCredentials(repoOwner, repoPassword);
    return new OAuthService(gitHubClient);
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:8,代码来源:DeleteGitHubOrphanAppsTest.java

示例7: GitHubApi

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
public GitHubApi(GitHubProjectConfig config) {

        GitHubCredentials gitHubCredentials = config.getGitHubCredentials();
        GitHubUser gitHubUser = config.getGitHubUser();

        gitHubClient = new GitHubClient();
        gitHubClient.setCredentials(gitHubCredentials.getUsername(), gitHubCredentials.getPassword());
        this.gitHubCommitUser = getGitHubCommitUser(gitHubUser.getName(), gitHubUser.getEmail());
        repositoryService = new RepositoryService(gitHubClient);
        dataService = new DataService(gitHubClient);
    }
 
开发者ID:drifted-in,项目名称:txgh,代码行数:12,代码来源:GitHubApi.java

示例8: connect

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
@Override
public void connect(WebSCMConfig config, String username, String token) {
	GitHubClient client = new GitHubClient();
	client.setCredentials(username, token);
	
	this.repositoryId = new RepositoryId(config.getOwner(), config.getName());
	this.issueServ = new IssueService(client);
	this.milestoneServ = new MilestoneService(client);
}
 
开发者ID:visminer,项目名称:repositoryminer,代码行数:10,代码来源:GitHubService.java

示例9: reportSuccesses

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
private void reportSuccesses(int successCounter) throws IOException {
 System.out.println(successCounter +" things went well");
 GitHubClient client = new GitHubClient();
 String botUserName = System.getProperty("testUserName");
 String botPassword = System.getProperty("testUserPass");
 client.setCredentials(botUserName, botPassword);
 
 String sha = System.getenv("TRAVIS_COMMIT");
 System.out.println("making a comment on commit "+sha);
 
 RepositoryService repoService = new RepositoryService(client);
 Repository repo = repoService.getRepository("DeveloperLiberationFront", "Pdf-Reviewer");
 CommitService service = new CommitService(client);
 CommitComment comment = new CommitComment();
 
    String message = "step | pass?\n" +
            "--- | --- \n" +
            "canary site online |  :fire: \n" +
            "authenticated with GitHub | :fire: \n" +
            "no carry over reviews |  ::fire: \n" +
            "created request |  :fire: \n" +
            "Uploaded pdf |  :fire: \n" +
            "Found issues in GitHub |  :fire: \n";
    
    for(int i = 0; i< successCounter; i++) {
        message = message.replaceFirst(":fire:", ":white_check_mark:");
    }

 comment.setBody(message);
    service.addComment(repo, sha, comment);
}
 
开发者ID:DeveloperLiberationFront,项目名称:Pdf-Reviewer,代码行数:32,代码来源:BrowserTest.java

示例10: UpdateAll

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
public static void UpdateAll() throws IOException {

    GitHubClient client = new GitHubClient();
    client.setCredentials("ferhaterata", "");

    RepositoryId repositoryId = new RepositoryId("modelwriter", "WP7");

    IssueManagement.updateTasks(client, repositoryId);

    // ModelWriterIssueManagement.loadDeliverableMap(client, repositoryId);

    // ModelWriterIssueManagement.updateDeliverables(client, repositoryId);


    // org.eclipse.egit.github.core.client.RequestException: Validation
    // Failed (422): Label resource with 'name' field already exists
  }
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:18,代码来源:IssueManagement.java

示例11: FetchUserRequirements

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
protected FetchUserRequirements() {
	client = new GitHubClient();
	client.setCredentials(Constants.USERNAME, Constants.PASSWORD);

	repositoryId = new RepositoryId(Constants.ORGANIZATION, Constants.REPOSITORY);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:7,代码来源:FetchUserRequirements.java

示例12: FetchSoftwareRequirements

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
protected FetchSoftwareRequirements() {
	client = new GitHubClient();
	client.setCredentials(Constants.USERNAME, Constants.PASSWORD);

	repositoryId = new RepositoryId(Constants.ORGANIZATION, Constants.REPOSITORY);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:7,代码来源:FetchSoftwareRequirements.java

示例13: FetchSoftwareRequirementReviewMeeting

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
protected FetchSoftwareRequirementReviewMeeting() {
  client = new GitHubClient();
  client.setCredentials(Constants.USERNAME, Constants.PASSWORD);

  repositoryId = new RepositoryId(Constants.ORGANIZATION, Constants.REPOSITORY);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:7,代码来源:FetchSoftwareRequirementReviewMeeting.java

示例14: FetchUserRequirementReviewMeeting

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
protected FetchUserRequirementReviewMeeting() {
  client = new GitHubClient();
  client.setCredentials(Constants.USERNAME, Constants.PASSWORD);

  repositoryId = new RepositoryId(Constants.ORGANIZATION, Constants.REPOSITORY);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:7,代码来源:FetchUserRequirementReviewMeeting.java

示例15: configure

import org.eclipse.egit.github.core.client.GitHubClient; //导入方法依赖的package包/类
@Override
public void configure(GitHubClient client) {
    client.setCredentials(username, password);
}
 
开发者ID:udoprog,项目名称:exposr,代码行数:5,代码来源:BasicProjectAuth.java


注:本文中的org.eclipse.egit.github.core.client.GitHubClient.setCredentials方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。