From 1ee33dce9c137938be0650f065717700d78f9bf6 Mon Sep 17 00:00:00 2001 From: andrey-qlogic <44769745+andrey-qlogic@users.noreply.github.com> Date: Thu, 10 Jan 2019 01:31:43 +0300 Subject: [PATCH] 4152: Added checking PAGE_TOKEN from options (#4303) --- .../cloud/storage/contrib/nio/testing/FakeStorageRpc.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/FakeStorageRpc.java b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/FakeStorageRpc.java index d694c4d07a86..07cb169511a4 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/FakeStorageRpc.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/FakeStorageRpc.java @@ -123,9 +123,13 @@ public Tuple> list(String bucket, Map throws StorageException { String delimiter = null; String preprefix = ""; + String pageToken = null; long maxResults = Long.MAX_VALUE; for (Map.Entry e : options.entrySet()) { switch (e.getKey()) { + case PAGE_TOKEN: + pageToken = (String) e.getValue(); + break; case PREFIX: preprefix = (String) e.getValue(); if (preprefix.startsWith("/")) { @@ -173,7 +177,7 @@ public Tuple> list(String bucket, Map // again). // The type cast seems to be necessary to help Java's typesystem remember that collections are // iterable. - return Tuple.of(null, (Iterable) values); + return Tuple.of(pageToken, (Iterable) values); } /** Returns the requested bucket or {@code null} if not found. */