mirror of https://github.com/apache/jclouds.git
Fix File method of download-blob multimethod.
This commit is contained in:
parent
5311b05192
commit
9ba88797a0
|
@ -258,7 +258,7 @@ container, name, string -> etag
|
|||
(copy (.getContent blob) target)))
|
||||
|
||||
(defmethod download-blob File [blobstore container-name name target]
|
||||
(download-blob (FileOutputStream. target)))
|
||||
(download-blob blobstore container-name name (FileOutputStream. target)))
|
||||
|
||||
(define-accessors StorageMetadata "blob" type id name
|
||||
location-id uri last-modfied)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(ns org.jclouds.blobstore-test
|
||||
(:use [org.jclouds.blobstore] :reload-all)
|
||||
(:use clojure.test)
|
||||
(:use [clojure.test])
|
||||
(:import [org.jclouds.blobstore BlobStoreContextFactory]
|
||||
[java.io ByteArrayOutputStream]))
|
||||
|
||||
|
@ -65,11 +65,12 @@
|
|||
(let [name "test"
|
||||
container-name "test-container"
|
||||
data "test content"
|
||||
baos (ByteArrayOutputStream.)]
|
||||
(create-container container-name)
|
||||
data-file (java.io.File/createTempFile "jclouds" "data")]
|
||||
(try (create-container container-name)
|
||||
(create-blob container-name name data)
|
||||
(download-blob container-name name baos)
|
||||
(is (= data (.toString baos)))))
|
||||
(download-blob container-name name data-file)
|
||||
(is (= data (slurp (.getAbsolutePath data-file))))
|
||||
(finally (.delete data-file)))))
|
||||
|
||||
;; TODO: more tests involving blob-specific functions
|
||||
|
||||
|
|
Loading…
Reference in New Issue