read-ns-decl-from-jarfile-entry

clojure.contrib.find-namespaces

  • (read-ns-decl-from-jarfile-entry jarfile entry-name)
Attempts to read a (ns ...) declaration from the named entry in the
JAR file, and returns the unevaluated form. Returns nil if the read
fails, or if the first form is not a ns declaration.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/find_namespaces.clj:93 top

(defn read-ns-decl-from-jarfile-entry
  "Attempts to read a (ns ...) declaration from the named entry in the
  JAR file, and returns the unevaluated form.  Returns nil if the read
  fails, or if the first form is not a ns declaration."
  [^JarFile jarfile ^String entry-name]
  (with-open [rdr (PushbackReader.
                   (BufferedReader.
                    (InputStreamReader.
                     (.getInputStream jarfile (.getEntry jarfile entry-name)))))]
    (read-ns-decl rdr)))
Vars in clojure.contrib.find-namespaces/read-ns-decl-from-jarfile-entry: defn with-open
Used in 0 other vars

Comments top

No comments for read-ns-decl-from-jarfile-entry. Log in to add a comment.