From fc0f31fc01cea42aff0a8d462bd8a09d25673fcd Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 23 Nov 2024 17:22:47 -0800 Subject: [PATCH] Handle list marker after last key in transient-nio2 Found by s3-tests. References #697. --- src/main/java/org/gaul/s3proxy/nio2blob/Nio2BlobStore.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/gaul/s3proxy/nio2blob/Nio2BlobStore.java b/src/main/java/org/gaul/s3proxy/nio2blob/Nio2BlobStore.java index 6b4a133..1285f75 100644 --- a/src/main/java/org/gaul/s3proxy/nio2blob/Nio2BlobStore.java +++ b/src/main/java/org/gaul/s3proxy/nio2blob/Nio2BlobStore.java @@ -193,12 +193,17 @@ public final class Nio2BlobStore extends BaseBlobStore { listHelper(set, container, dirPrefix, prefix, delimiter); var sorted = set.build(); if (options.getMarker() != null) { + var found = false; for (var blob : sorted) { if (blob.getName().compareTo(options.getMarker()) > 0) { sorted = sorted.tailSet(blob); + found = true; break; } } + if (!found) { + sorted = ImmutableSortedSet.of(); + } } String marker = null; if (options.getMaxResults() != null) {