Leinigen resources and uberjar

Problem concerning the copy of a resource file.

    [clojure.java.io :as io])
    [org.apache.commons.io FileUtils])

(defn copy-template
  "Copy the template file to the same directory of the given filepath and rename it
  with the same name of the given filepath, but using XLS extension."
  (let [template (log/spy (io/resource "template.xls"))
        out-path (s/replace fpath #"\.\w+$" ".xls")] 
    (FileUtils/copyURLToFile template (io/file out-path))

Do you wanna tell me something? Please, send me an email! =)

Published: July 21 2013