Skip to content

Commit

Permalink
4152: Added checking PAGE_TOKEN from options (#4303)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-qlogic authored and JesseLovelace committed Jan 9, 2019
1 parent 0d5cbc1 commit 1ee33dc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ public Tuple<String, Iterable<StorageObject>> list(String bucket, Map<Option, ?>
throws StorageException {
String delimiter = null;
String preprefix = "";
String pageToken = null;
long maxResults = Long.MAX_VALUE;
for (Map.Entry<Option, ?> e : options.entrySet()) {
switch (e.getKey()) {
case PAGE_TOKEN:
pageToken = (String) e.getValue();
break;
case PREFIX:
preprefix = (String) e.getValue();
if (preprefix.startsWith("/")) {
Expand Down Expand Up @@ -173,7 +177,7 @@ public Tuple<String, Iterable<StorageObject>> list(String bucket, Map<Option, ?>
// again).
// The type cast seems to be necessary to help Java's typesystem remember that collections are
// iterable.
return Tuple.of(null, (Iterable<StorageObject>) values);
return Tuple.of(pageToken, (Iterable<StorageObject>) values);
}

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

0 comments on commit 1ee33dc

Please sign in to comment.