more convenience methods

This commit is contained in:
Kohsuke Kawaguchi
2010-04-18 21:56:53 -07:00
parent 5d2b4bdb16
commit 6b9f835726

View File

@@ -97,6 +97,9 @@ public class GitHub {
return MAPPER.readValue(getApiURL(tail),type);
}
/**
* Obtains the object that represents the named user.
*/
public GHUser getUser(String login) throws IOException {
GHUser u = users.get(login);
if (u==null) {
@@ -107,6 +110,14 @@ public class GitHub {
return u;
}
/**
* Gets the {@link GHUser} that represents yourself.
*/
public GHUser getMyself() throws IOException {
requireCredential();
return getUser(login);
}
/**
* Creates a new repository.
*