diff --git a/blobstore/src/main/clojure/org/jclouds/blobstore.clj b/blobstore/src/main/clojure/org/jclouds/blobstore.clj index ac6149bc12..433b4b716c 100644 --- a/blobstore/src/main/clojure/org/jclouds/blobstore.clj +++ b/blobstore/src/main/clojure/org/jclouds/blobstore.clj @@ -237,11 +237,11 @@ example: (.list (as-blobstore blobstore) container-name (.inDirectory (new ListContainerOptions) dir)))) -(defn create-blob +(defn upload-blob "Create an blob representing text data: container, name, string -> etag" ([container-name name data] ;; TODO: allow payload to be a stream - (create-blob container-name name data *blobstore*)) + (upload-blob container-name name data *blobstore*)) ([container-name name data blobstore] (put-blob container-name (doto (.newBlob blobstore name) diff --git a/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj b/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj index 913db4d843..72be8f158d 100644 --- a/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj +++ b/blobstore/src/test/clojure/org/jclouds/blobstore_test.clj @@ -41,12 +41,12 @@ (deftest list-container-test (is (create-container "container")) (is (empty? (list-container "container"))) - (is (create-blob "container" "blob1" "blob1")) - (is (create-blob "container" "blob2" "blob2")) + (is (upload-blob "container" "blob1" "blob1")) + (is (upload-blob "container" "blob2" "blob2")) (is (= 2 (count (list-container "container")))) (is (= 1 (count (list-container "container" :max-results 1)))) (create-directory "container" "dir") - (is (create-blob "container" "dir/blob2" "blob2")) + (is (upload-blob "container" "dir/blob2" "blob2")) (is (= 3 (count (list-container "container")))) (is (= 4 (count (list-container "container" :recursive)))) (is (= 1 (count (list-container "container" :in-directory "dir"))))) @@ -57,7 +57,7 @@ data "test content" data-file (java.io.File/createTempFile "jclouds" "data")] (try (create-container container-name) - (create-blob container-name name data) + (upload-blob container-name name data) (download-blob container-name name data-file) (is (= data (slurp (.getAbsolutePath data-file)))) (finally (.delete data-file))))) @@ -74,7 +74,7 @@ data "test content" data-file (java.io.File/createTempFile "jclouds" "data")] (try (create-container container-name) - (create-blob container-name name data) + (upload-blob container-name name data) (is (thrown? Exception (download-blob container-name name data-file))) (finally (.delete data-file)))))) @@ -92,7 +92,7 @@ (when-not (blob-exists? container-name name) (let [data-stream (java.io.ByteArrayOutputStream.)] (dotimes [i 5000000] (.write data-stream i)) - (create-blob container-name name (.toByteArray data-stream)))) + (upload-blob container-name name (.toByteArray data-stream)))) ;; download (let [total (atom total-downloads)]