Commit 31ded566 authored by Bruno Burke's avatar Bruno Burke 🍔
Browse files

add get-document-size function

parent c2d23009
Pipeline #43497 passed with stages
in 1 minute and 36 seconds
(defproject document-storage "0.1.7"
(defproject document-storage "0.1.8"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
......
......@@ -78,6 +78,12 @@
result
))))))
(defn get-document-size [id & {:keys [repository] :or {repository default-repository}}]
(when (valid-id? id repository)
(let [file (io/file (get-file-path id repository))]
(when (.isFile file)
(.length file)))))
(defn save-document [id document & {:keys [repository] :or {repository default-repository}}]
(let [file-path (get-file-path id repository)
document-str (with-out-str (fipp document))]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment