You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Andrew Gaul (JIRA)" <ji...@apache.org> on 2015/08/28 00:19:46 UTC
[jira] [Resolved] (JCLOUDS-856) openstack-swift provider mangles
blob names that end with slash
[ https://issues.apache.org/jira/browse/JCLOUDS-856?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Gaul resolved JCLOUDS-856.
---------------------------------
Resolution: Fixed
Assignee: Timur Alperovich (was: Zack Shoylev)
Fix Version/s: 2.0.0
> openstack-swift provider mangles blob names that end with slash
> ---------------------------------------------------------------
>
> Key: JCLOUDS-856
> URL: https://issues.apache.org/jira/browse/JCLOUDS-856
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 1.8.1
> Reporter: Ka-Hing Cheung
> Assignee: Timur Alperovich
> Labels: openstack-swift, swift
> Fix For: 2.0.0
>
>
> 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.
> {code:java}
> @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);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)