mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
more convenience methods
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user