Timur Alperovich created JCLOUDS-1313:
-----------------------------------------

             Summary: Filesystem blob store does not handle empty string LIST 
options properly
                 Key: JCLOUDS-1313
                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1313
             Project: jclouds
          Issue Type: Bug
          Components: jclouds-blobstore
            Reporter: Timur Alperovich


When attempting to list a container and setting prefix. delimiter, and marker 
to "", the filesystem blobstore does not return any entries. Against AWS, 
setting the values to an empty is tantamount to not setting them at all.

Here is an example that fails. A similar test against AWS succeeds.

{code}
public void testList_EmptyOptionSingleContainer() throws IOException {
       blobStore.createContainerInLocation(null, CONTAINER_NAME);

       checkForContainerContent(CONTAINER_NAME, null);

       TestUtils.createBlobsInContainer(CONTAINER_NAME, "a", "b", "c");
       // Test listing where we set the prefix and delimiter to empty string
       ListContainerOptions options = ListContainerOptions.Builder.delimiter("")
             .prefix("").afterMarker("");
       PageSet<? extends StorageMetadata> rs = blobStore.list(CONTAINER_NAME, 
options);
       assertEquals(rs.size(), 3);
       Set<String> expected = Sets.newHashSet("a", "b", "c");
       for (StorageMetadata sm : rs) {
          assertTrue(expected.contains(sm.getName()));
          expected.remove(sm.getName());
       }
       assertTrue(expected.isEmpty());
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to