Use clojure.java.io/resource to locate a resource on the Java classpath and obtain a URL that can feed Clojure I/O functions. section 22.8
Read a classpath resource
After requiring resource and reader, (def cjio (resource "clojure/java/io.clj")) retrieves the resource URL. Passing cjio to reader and line-seq makes the first line available, producing "; Copyright (c) Rich Hickey. All rights reserved." section 22.8
(require '[clojure.java.io :refer [resource reader]]) (def cjio (resource "clojure/java/io.clj")) ; #1 (first (line-seq (reader cjio))) ; #2 ;; "; Copyright (c) Rich Hickey. All rights reserved."
Inspect the complete executable example showing classpath lookup followed by reading the returned URL. section 22.8
