1.2.0 permalink Arrow_down_16x16
  • (file arg)
  • (file parent child)
  • (file parent child & more)
Returns a java.io.File from string or file args.

1 Example top

  • user=> (require 'clojure.contrib.java-utils)              
    nil
    user=> (. (clojure.contrib.java-utils/file ".") exists)
    true
    user=> (. (clojure.contrib.java-utils/file "...") exists)
    false
    user=> (. (clojure.contrib.java-utils/file ".") isFile) 
    false
    user=> (. (clojure.contrib.java-utils/file ".") isDirectory)
    true
    
    ;; Sugared version
    user> (.exists (clojure.contrib.java-utils/file "."))
    true
    user> (.exists (clojure.contrib.java-utils/file "..."))
    false
    user> (.isFile (clojure.contrib.java-utils/file "."))
    false
    user> (.isDirectory (clojure.contrib.java-utils/file "."))
    true
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/java_utils.clj:72 top

(defn ^File file
  "Returns a java.io.File from string or file args."
  {:deprecated "1.2"}
  ([arg]                      
     (as-file arg))
  ([parent child]             
     (File. ^File (as-file parent) ^String (relative-path-string child)))
  ([parent child & more]
     (reduce file (file parent child) more)))
Vars in clojure.contrib.java-utils/file: defn reduce
Used in 0 other vars

Comments top

No comments for file. Log in to add a comment.