Created
November 14, 2012 16:18
-
-
Save mtomas/4073064 to your computer and use it in GitHub Desktop.
Get repos associated to user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static List<Repository> getRepositoryByGitUsername(String gitUsername) throws IOException { | |
RepositoryService repositoryService = new RepositoryService(Projects.gitHubClient); | |
CollaboratorService collaboratorService = new CollaboratorService(Projects.gitHubClient); | |
List<Repository> repositoryList = repositoryService.getRepositories(); | |
List<Repository> userRepositoryNameList = new ArrayList<Repository>(); | |
for (Repository repository : repositoryList) { | |
if (collaboratorService.isCollaborator(repository, gitUsername)) { | |
userRepositoryNameList.add(repository); | |
} | |
} | |
return userRepositoryNameList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment