clj-htmltopdf/src/clj_htmltopdf/utils.clj

12 lines
226 B
Clojure

(ns clj-htmltopdf.utils
(:import
[java.io File]
[java.net URL MalformedURLException]))
(defn string->url-or-file
[^String s]
(try
(URL. s)
(catch MalformedURLException _
(File. (str "file:" s)))))