File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Filter options
src/main/java/org/kohsuke/github Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Original file line number Diff line number Diff line change @@ -54,6 +54,25 @@ public synchronized Map<String,GHRepository> getRepositories() throws IOExceptio
54
54
return Collections .unmodifiableMap (repositories );
55
55
}
56
56
57
+ /**
58
+ * Lists up all the repositories.
59
+ *
60
+ * Unlike {@link #getRepositories()}, this does not wait until all the repositories are returned.
61
+ */
62
+ public PagedIterable <GHRepository > listRepositories () {
63
+ return new PagedIterable <GHRepository >() {
64
+ public PagedIterator <GHRepository > iterator () {
65
+ return new PagedIterator <GHRepository >(root .retrieve ().asIterator ("/users/" + login + "/repos" , GHRepository [].class )) {
66
+ @ Override
67
+ protected void wrapUp (GHRepository [] page ) {
68
+ for (GHRepository c : page )
69
+ c .wrap (root );
70
+ }
71
+ };
72
+ }
73
+ };
74
+ }
75
+
57
76
/**
58
77
* Loads repository list in a pagenated fashion.
59
78
*
@@ -63,6 +82,9 @@ public synchronized Map<String,GHRepository> getRepositories() throws IOExceptio
63
82
*
64
83
* Every {@link Iterator#next()} call results in I/O. Exceptions that occur during the processing is wrapped
65
84
* into {@link Error}.
85
+ *
86
+ * @deprecated
87
+ * Use {@link #listRepositories()}
66
88
*/
67
89
public synchronized Iterable <List <GHRepository >> iterateRepositories (final int pageSize ) {
68
90
return new Iterable <List <GHRepository >>() {
You can’t perform that action at this time.
0 commit comments