Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.8.1
Description
Swift (both the old swift and the new openstack-swift providers) deletes trailing slash on listContainer. deleteContainer() also fails if you have a blob with trailing slash.
The mangling is done in MarkersIfDirectoryReturnNameStrategy. Working around that in application is not ideal because metadata.getType() is RELATIVE_PATH could mean a slash was deleted from the end, or the blob's content type is application/directory. It's not clear how to figure out what the real name of the returned objects without probing the store again.
@Test public void testListObjectWithTrailingSlash() throws InterruptedException { BlobStore blobStore = view.getBlobStore(); String containerName = getContainerName(); try { String key = "a/"; String etag = blobStore.putBlob(containerName, blobStore.blobBuilder(key).payload("content").build()); assertThat(etag).isNotNull(); PageSet<? extends StorageMetadata> res = blobStore.list(containerName, new ListContainerOptions().recursive()); assertThat(res).hasSize(1); StorageMetadata meta = res.iterator().next(); assertThat(meta.getName()).isEqualTo(key); } finally { returnContainer(containerName); } }
Attachments
Issue Links
- is related to
-
JCLOUDS-992 jclouds improperly handles "application/directory" blobs during LIST
-
- Resolved
-