     {:json-files (map #(config/create-url (str "api/get/" (.getName %))) zipped-files)}))
 
 (defn stats-on-callback [callback-chan request stats]
+  (log/debug "Callback stats:" stats)
   (when (:callback request)
     (go (>! callback-chan [(:callback request) stats]))))
 

      validity
      reader
      #(doseq [file %]
         (let [json-filename ^String (json-filename-fn)
               compressed-file (fs/create-target-file json-filename)]
           (with-open [output-stream (io/output-stream compressed-file)
                       zip (ZipOutputStream. output-stream)]
             (.putNextEntry zip (ZipEntry. json-filename))

  "Transforms a file or zip-stream and returns a vector with the transformed files"
  (if (= format :zip)
    (translate-from-zipfile file dataset mapping validity)
    (do
      (log/debug "Going to transform file" original-filename)
      (with-open [stream (condp = format
                           :gzip (GZIPInputStream. (FileInputStream. file))
                           :plain (FileInputStream. file))]
        (translate-file-from-stream stream dataset mapping validity original-filename)))))

(defn extract-filename [headers, ^String uri]
  "Extract the original filename from the Content-Disposition header, or from the URI if unavailable"
