From 5faaa4f3d6cec8e8b7c395383c45fb7ea942ec16 Mon Sep 17 00:00:00 2001 From: andrey-qlogic Date: Tue, 8 Jan 2019 13:16:39 +0000 Subject: [PATCH] 4152: Added checking PAGE_TOKEN from options --- .../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. */