add helper functions we'll need for file modification date/time testing

This commit is contained in:
Gered 2014-03-02 13:52:05 -05:00
parent 5bf4dcaf98
commit 6427dc19bc

View file

@ -24,6 +24,17 @@
(new JtwigTemplate)
(.compile)))
(defn- inside-jar? [^File file]
(-> file
(.getPath)
; the path of a file inside a jar looks something like "jar:file:/path/to/file.jar!/path/to/file"
(.contains "jar!")))
(defn- get-file-last-modified [^File file]
(if (inside-jar? file)
0
(.lastModified file)))
(defn- get-compiled-template [^File file]
(if-not (.exists file)
(throw (new FileNotFoundException (str "Template file \"" file "\" not found.")))