      [pprint :as pp]
      [string :as s]]
     [clojure.tools.logging :as l]
-    [io.aviso.tracker :as t]))
+    [io.aviso.tracker :as t]
+    [io.aviso.twixt.utils :as utils]))
 
 
 (defn- checksum-matches?

      (some->
        (io/file asset-cache-dir asset-file-name)
        read-cached-asset-data
        (assoc :content (io/file asset-cache-dir content-file-name))))))

(defn- write-cached-asset [^File asset-cache-dir asset]
  (t/track

      ;; Write the content first
      (io/copy (:content asset) content-file)
      (with-open [^Writer writer (io/writer asset-file)]
        (.write writer (-> asset
                           (write-attachments asset-cache-dir)
                           ;; The name of the content file is (currently) a fixed value,
                           ;; so we can just remove the key, rather than replace it with a file name.
                           (dissoc :content)
                           ;; Override *print-length* and *print-level* to ensure it is all written out.
                           ^String (pp/write :length nil :level nil :stream nil)))
        (.write writer "\n")))))

(defn- delete-dir-and-contents
