Skip to content

Commit

Permalink
Fix for finding private repos on organizations,
Browse files Browse the repository at this point in the history
requires authenticated API call
  • Loading branch information
jkrall committed Jan 3, 2012
1 parent 46b2e5d commit 4a4a469
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/org/kohsuke/github/GHOrganization.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.AbstractList;
import java.util.ArrayList;
Expand Down Expand Up @@ -42,6 +43,19 @@ public Map<String,GHTeam> getTeams() throws IOException {
return root.retrieveWithAuth("/organizations/"+login+"/teams",JsonTeams.class).toMap(this);
}

/**
*
* @return
* null if the repository was not found
*/
public GHRepository getRepository(String name) throws IOException {
try {
return root.retrieveWithAuth3("/repos/" + login + '/' + name, GHRepository.class).wrap(root);
} catch (FileNotFoundException e) {
return null;
}
}

/**
* Publicizes the membership.
*/
Expand Down

0 comments on commit 4a4a469

Please sign in to comment.