mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-05 15:50:59 +00:00
Should support pagination
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user