Created
October 10, 2011 08:30
-
-
Save auramo/1274866 to your computer and use it in GitHub Desktop.
Loading resource file in clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn load-resource | |
[name] | |
(let [rsc-name (str "somefolder/" name) | |
thr (Thread/currentThread) | |
ldr (.getContextClassLoader thr)] | |
(.getResourceAsStream ldr rsc-name))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment