Java Code Examples for org.eclipse.egit.github.core.Repository#getName()

The following examples show how to use org.eclipse.egit.github.core.Repository#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RepositoryInfo.java    From jbpm-work-items with Apache License 2.0 5 votes vote down vote up
public RepositoryInfo(Repository repository) {
    if (repository != null) {
        this.id = repository.getId();
        this.name = repository.getName();
        this.gitURL = repository.getGitUrl();
        this.htmlURL = repository.getHtmlUrl();
        this.description = repository.getDescription();
        this.masterBranch = repository.getMasterBranch();
        this.openIssues = repository.getOpenIssues();
        this.sshURL = repository.getSshUrl();
        this.watchers = repository.getWatchers();
    }
}
 
Example 2
Source File: GithubImporter.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
private List<String> getGradleDependencies(GitHubClient client, Repository rep)
		throws IOException, XmlPullParserException, InterruptedException {
	String repoFullName = rep.getOwner().getLogin() + "/" + rep.getName();
	List<String> pomPath = new ArrayList<>();
	InputStream searchPomFiles = null;
	try {
		searchPomFiles = new URL("https://api.github.com/search/code?q=filename:build.gradle+repo:" + repoFullName
				+ "&access_token=" + this.token).openStream();
	} catch (Exception e) {

		logger.debug("sleep time");
		Thread.sleep(60000);
		logger.debug("wakeup");
		searchPomFiles = new URL("https://api.github.com/search/code?q=filename:build.gradle+repo:" + repoFullName
				+ "&access_token=" + this.token).openStream();
	}
	BufferedReader searchPomresults = new BufferedReader(
			new InputStreamReader(searchPomFiles, Charset.forName(UTF8)));
	String jsonSearchPom = readAll(searchPomresults);
	JSONObject pomContentsResults = (JSONObject) JSONValue.parse(jsonSearchPom);
	long i = (long) pomContentsResults.get("total_count");
	if (i > 0) {
		JSONArray pomFiles = (JSONArray) pomContentsResults.get("items");
		for (Object object : pomFiles) {
			JSONObject pomFile = (JSONObject) object;
			pomPath.add((String) pomFile.get("path"));
		}
	}
	return getGradleDependencies(client, rep, pomPath);
}
 
Example 3
Source File: GithubImporter.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
private List<String> getMavenDependencies(GitHubClient client, Repository rep)
		throws IOException, XmlPullParserException, InterruptedException {
	String repoFullName = rep.getOwner().getLogin() + "/" + rep.getName();
	List<String> pomPath = new ArrayList<>();
	InputStream searchPomFiles = null;
	try {
		searchPomFiles = new URL("https://api.github.com/search/code?q=filename:pom.xml+repo:" + repoFullName
				+ "&access_token=" + this.token).openStream();
	} catch (Exception e) {

		logger.debug("sleep time");
		Thread.sleep(60000);
		logger.debug("wakeup");
		searchPomFiles = new URL("https://api.github.com/search/code?q=filename:pom.xml+repo:" + repoFullName
				+ "&access_token=" + this.token).openStream();
	}
	BufferedReader searchPomresults = new BufferedReader(
			new InputStreamReader(searchPomFiles, Charset.forName(UTF8)));
	String jsonSearchPom = readAll(searchPomresults);
	JSONObject pomContentsResults = (JSONObject) JSONValue.parse(jsonSearchPom);
	long i = (long) pomContentsResults.get("total_count");
	if (i > 0) {
		JSONArray pomFiles = (JSONArray) pomContentsResults.get("items");
		for (Object object : pomFiles) {
			JSONObject pomFile = (JSONObject) object;
			pomPath.add((String) pomFile.get("path"));
		}
	}
	return getMavenDependencies(client, rep, pomPath);
}
 
Example 4
Source File: TrafficService.java    From gito-github-client with Apache License 2.0 4 votes vote down vote up
public TrafficService setRepository(Repository repository) {
    mRepositoryName = repository.getName();
    mLogin = repository.getOwner().getLogin();
    return this;
}
 
Example 5
Source File: StargazersService.java    From gito-github-client with Apache License 2.0 4 votes vote down vote up
public StargazersService setRepository(Repository repository) {
    mRepositoryName = repository.getName();
    mLogin = repository.getOwner().getLogin();
    return this;
}