Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Spaces ruin resource-reading via
(require '[ :as jio])
(def f ( "has spaces" "txt"))
(jio/as-url f)
;=> #<URL file:/tmp/has spaces2596746647349806731txt>
;;; Note the lack of URL-escaping
(slurp f)
;=> ""
(def loader
( (into-array [(jio/as-url (.getParentFile f))])))
(def f-resource
(jio/resource (.getName f) loader))
(slurp f-resource)
;=> FileNotFoundException /tmp/has%20spaces8769028438726695263txt (No such file or directory) (
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment