You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2015/08/20 21:42:41 UTC
[5/7] jclouds git commit: JCLOUDS-992: Old Swift: treat directories
as blobs
JCLOUDS-992: Old Swift: treat directories as blobs
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/238cc525
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/238cc525
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/238cc525
Branch: refs/heads/master
Commit: 238cc525f92d400fe919f79238ca9361553fbf24
Parents: a2d8dfc
Author: Timur Alperovich <ti...@gmail.com>
Authored: Tue Aug 18 11:34:27 2015 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Aug 20 12:42:11 2015 -0700
----------------------------------------------------------------------
.../blobstore/functions/ObjectToBlobMetadata.java | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/238cc525/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/functions/ObjectToBlobMetadata.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/functions/ObjectToBlobMetadata.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/functions/ObjectToBlobMetadata.java
index 8832282..ba0ce47 100644
--- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/functions/ObjectToBlobMetadata.java
+++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/functions/ObjectToBlobMetadata.java
@@ -18,13 +18,11 @@ package org.jclouds.openstack.swift.blobstore.functions;
import static com.google.common.io.BaseEncoding.base16;
-import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.blobstore.domain.MutableBlobMetadata;
import org.jclouds.blobstore.domain.StorageType;
import org.jclouds.blobstore.domain.internal.MutableBlobMetadataImpl;
-import org.jclouds.blobstore.strategy.IfDirectoryReturnNameStrategy;
import org.jclouds.openstack.swift.domain.MutableObjectInfoWithMetadata;
import org.jclouds.openstack.swift.domain.ObjectInfo;
@@ -32,13 +30,6 @@ import com.google.common.base.Function;
@Singleton
public class ObjectToBlobMetadata implements Function<ObjectInfo, MutableBlobMetadata> {
- private final IfDirectoryReturnNameStrategy ifDirectoryReturnName;
-
- @Inject
- public ObjectToBlobMetadata(IfDirectoryReturnNameStrategy ifDirectoryReturnName) {
- this.ifDirectoryReturnName = ifDirectoryReturnName;
- }
-
public MutableBlobMetadata apply(ObjectInfo from) {
if (from == null)
return null;
@@ -56,13 +47,7 @@ public class ObjectToBlobMetadata implements Function<ObjectInfo, MutableBlobMet
to.setLastModified(from.getLastModified());
if (from instanceof MutableObjectInfoWithMetadata)
to.setUserMetadata(((MutableObjectInfoWithMetadata) from).getMetadata());
- String directoryName = ifDirectoryReturnName.execute(to);
- if (directoryName != null) {
- to.setName(directoryName);
- to.setType(StorageType.RELATIVE_PATH);
- } else {
- to.setType(StorageType.BLOB);
- }
+ to.setType(StorageType.BLOB);
return to;
}
}