got rid of all retrieveXYZ methods in favor of Poster

This commit is contained in:
Kohsuke Kawaguchi
2012-09-05 18:55:44 -07:00
parent d6d73f5165
commit b6520cb6f9
7 changed files with 33 additions and 56 deletions

View File

@@ -22,7 +22,7 @@ public class GHMyself extends GHUser {
* Always non-null.
*/
public List<String> getEmails() throws IOException {
String[] addresses = root.retrieveWithAuth("/user/emails", String[].class);
String[] addresses = root.retrieve().withCredential().to("/user/emails", String[].class);
return Collections.unmodifiableList(Arrays.asList(addresses));
}
@@ -33,7 +33,7 @@ public class GHMyself extends GHUser {
* Always non-null.
*/
public List<GHKey> getPublicKeys() throws IOException {
return Collections.unmodifiableList(Arrays.asList(root.retrieveWithAuth("/user/keys", GHKey[].class)));
return Collections.unmodifiableList(Arrays.asList(root.retrieve().withCredential().to("/user/keys", GHKey[].class)));
}
// public void addEmails(Collection<String> emails) throws IOException {