Should support pagination

This commit is contained in:
Kohsuke Kawaguchi
2014-05-10 11:59:46 -07:00
parent c62bc8d5da
commit 6f6583772d

View File

@@ -183,9 +183,18 @@ public class GHRepository {
GHRelease[].class), this));
}
public List<GHTag> getTags() throws IOException {
return Arrays.asList(GHTag.wrap(root.retrieve().to("/repos/" + owner.login + "/" + name + "/tags",
GHTag[].class), this));
public PagedIterable<GHTag> listTags() throws IOException {
return new PagedIterable<GHTag>() {
public PagedIterator<GHTag> iterator() {
return new PagedIterator<GHTag>(root.retrieve().asIterator(getApiTailUrl("tags"), GHTag[].class)) {
@Override
protected void wrapUp(GHTag[] page) {
for (GHTag c : page)
c.wrap(GHRepository.this);
}
};
}
};
}
protected String getOwnerName() {