camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [2/5] camel git commit: CAMEL-8918 Camel-Jclouds: Add countBlobs and removeBlob operation to Blobstore component, add removeBlob operation
Date Mon, 29 Jun 2015 12:28:56 GMT
CAMEL-8918 Camel-Jclouds: Add countBlobs and removeBlob operation to Blobstore component, add
removeBlob operation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/52e80745
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/52e80745
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/52e80745

Branch: refs/heads/master
Commit: 52e807456a96ac3d77e9f4269b33a08bf60f5fbe
Parents: 2f31121
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Mon Jun 29 13:52:05 2015 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Mon Jun 29 14:24:54 2015 +0200

----------------------------------------------------------------------
 .../camel/component/jclouds/JcloudsBlobStoreHelper.java   | 10 ++++++++++
 .../camel/component/jclouds/JcloudsBlobStoreProducer.java |  2 ++
 .../apache/camel/component/jclouds/JcloudsConstants.java  |  1 +
 3 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/52e80745/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
index f365b94..27fcec9 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreHelper.java
@@ -104,4 +104,14 @@ public final class JcloudsBlobStoreHelper {
         long blobsCount = blobStore.countBlobs(container);
         return blobsCount;
     }
+    
+
+    /**
+     * Reads from a {@link BlobStore}. It returns an Object.
+     */
+    public static void removeBlob(BlobStore blobStore, String container, String blobName)
throws IOException {
+        if (!Strings.isNullOrEmpty(blobName)) {
+            blobStore.removeBlob(container, blobName);            
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/52e80745/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
index 911dd27..4ab5ddc 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreProducer.java
@@ -57,6 +57,8 @@ public class JcloudsBlobStoreProducer extends JcloudsProducer {
             exchange.getOut().setBody(JcloudsBlobStoreHelper.readBlob(blobStore, container,
blobName));
         } else if (JcloudsConstants.COUNT_BLOBS.equals(operation)) {
             exchange.getOut().setBody(JcloudsBlobStoreHelper.countBlob(blobStore, container));
+        }  else if (JcloudsConstants.REMOVE_BLOB.equals(operation)) {
+            JcloudsBlobStoreHelper.removeBlob(blobStore, container, blobName);
         } else {
             Payload body = exchange.getIn().getBody(Payload.class);
             JcloudsBlobStoreHelper.writeBlob(blobStore, container, blobName, body);

http://git-wip-us.apache.org/repos/asf/camel/blob/52e80745/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
index af0cd69..6b60a03 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java
@@ -29,6 +29,7 @@ public final class JcloudsConstants {
     public static final String PUT = "CamelJcloudsPut";
     public static final String GET = "CamelJcloudsGet";
     public static final String COUNT_BLOBS = "CamelJcloudsCountBlobs";
+    public static final String REMOVE_BLOB = "CamelJcloudsRemoveBlob";
     public static final String LIST_IMAGES = "CamelJcloudsListImages";
     public static final String LIST_HARDWARE = "CamelJcloudsListHardware";
     public static final String LIST_NODES = "CamelJcloudsListNodes";


Mime
View raw message