From cf2c07783687a2379eaeefc7e06d9133ed7a61fb Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 28 Oct 2017 11:06:25 -0700 Subject: [PATCH] Handle empty prefix on Atmos --- .../main/java/org/jclouds/atmos/blobstore/AtmosBlobStore.java | 3 +++ .../blobstore/functions/BlobStoreListOptionsToListOptions.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobStore.java b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobStore.java index d1721292f3..c999743b4f 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobStore.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobStore.java @@ -16,6 +16,7 @@ */ package org.jclouds.atmos.blobstore; +import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.atmos.options.PutOptions.Builder.publicRead; @@ -58,6 +59,7 @@ import org.jclouds.http.options.GetOptions; import org.jclouds.io.Payload; import org.jclouds.io.PayloadSlicer; +import com.google.common.base.Strings; import com.google.common.base.Supplier; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; @@ -218,6 +220,7 @@ public class AtmosBlobStore extends BaseBlobStore { @Override public PageSet list(String container, org.jclouds.blobstore.options.ListContainerOptions options) { + checkArgument(Strings.isNullOrEmpty(options.getPrefix()), "does not support prefixes"); container = AtmosUtils.adjustContainerIfDirOptionPresent(container, options); ListOptions nativeOptions = container2ContainerListOptions.apply(options); // until includeMeta() option works for namespace interface diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/functions/BlobStoreListOptionsToListOptions.java b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/functions/BlobStoreListOptionsToListOptions.java index b6a1e9dbe2..13882f998d 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/functions/BlobStoreListOptionsToListOptions.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/functions/BlobStoreListOptionsToListOptions.java @@ -23,6 +23,7 @@ import javax.inject.Singleton; import org.jclouds.blobstore.options.ListContainerOptions; import com.google.common.base.Function; +import com.google.common.base.Strings; @Singleton public class BlobStoreListOptionsToListOptions implements @@ -31,7 +32,7 @@ public class BlobStoreListOptionsToListOptions implements public org.jclouds.atmos.options.ListOptions apply(ListContainerOptions from) { checkNotNull(from, "set options to instance NONE instead of passing null"); org.jclouds.atmos.options.ListOptions httpOptions = new org.jclouds.atmos.options.ListOptions(); - if (from.getMarker() != null) { + if (!Strings.isNullOrEmpty(from.getMarker())) { httpOptions.token(from.getMarker()); } if (from.getMaxResults() != null) {