You're viewing version 1.2.0 of as-relative-path. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

as-relative-path

clojure.java.io

  • (as-relative-path x)
Take an as-file-able thing and return a string if it is
a relative path, else IllegalArgumentException.

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/java/io.clj:385 top

(defn ^String as-relative-path
  "Take an as-file-able thing and return a string if it is
   a relative path, else IllegalArgumentException."
  {:added "1.2"}
  [x]
  (let [^File f (as-file x)]
    (if (.isAbsolute f)
      (throw (IllegalArgumentException. (str f " is not a relative path")))
      (.getPath f))))
Vars in clojure.java.io/as-relative-path: defn let str
Used in 0 other vars

Comments top

No comments for as-relative-path. Log in to add a comment.