Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1313

Filesystem blob store does not handle empty string LIST options properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • jclouds-blobstore
    • None

    Description

      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.

      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());
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            timuralp Timur Alperovich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: