Skip to content

Commit 1ee33dc

Browse files
andrey-qlogicJesseLovelace
authored andcommitted
4152: Added checking PAGE_TOKEN from options (#4303)
1 parent 0d5cbc1 commit 1ee33dc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing

google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/FakeStorageRpc.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,13 @@ public Tuple<String, Iterable<StorageObject>> list(String bucket, Map<Option, ?>
123123
throws StorageException {
124124
String delimiter = null;
125125
String preprefix = "";
126+
String pageToken = null;
126127
long maxResults = Long.MAX_VALUE;
127128
for (Map.Entry<Option, ?> e : options.entrySet()) {
128129
switch (e.getKey()) {
130+
case PAGE_TOKEN:
131+
pageToken = (String) e.getValue();
132+
break;
129133
case PREFIX:
130134
preprefix = (String) e.getValue();
131135
if (preprefix.startsWith("/")) {
@@ -173,7 +177,7 @@ public Tuple<String, Iterable<StorageObject>> list(String bucket, Map<Option, ?>
173177
// again).
174178
// The type cast seems to be necessary to help Java's typesystem remember that collections are
175179
// iterable.
176-
return Tuple.of(null, (Iterable<StorageObject>) values);
180+
return Tuple.of(pageToken, (Iterable<StorageObject>) values);
177181
}
178182

179183
/** Returns the requested bucket or {@code null} if not found. */

0 commit comments

Comments
 (0)