NOTE: These autogen pages are still under development.
Not all links work. Not all formatting is done.
Contact Tom Faulhaber (tomfaulhaber on github, gmail, etc.)
with any questions.
API for java-utils
by
Stuart Halloway, Stephen C. Gilardi, Shawn Hoover, Perry Trolard, Stuart Sierra
Usage:
(ns your-namespace
(:require clojure.contrib.java-utils))
Overview
A set of utilties for dealing with Java stuff like files and properties.
Design goals:
(1) Ease-of-use. These APIs should be convenient. Performance is secondary.
(2) Duck typing. I hate having to think about the difference between
a string that names a file, and a File. Ditto for a ton of other
wrapper classes in the Java world (URL, InternetAddress). With these
APIs you should be able to think about domain equivalence, not type
equivalence.
(3) No bossiness. I am not marking any of these functions as private
the docstrings will tell you the intended usage but do what works for you.
Feedback welcome!
If something in this module violates the principle of least surprise, please
let me (Stu) and the Clojure community know via the mailing list.
Public Variables and Functions
as-file
multimethod
No usage documentation available
Interpret a String or a java.io.File as a File. Building block
for clojure.contrib.java-utils/file, which you should prefer
in most cases.
Source
as-properties
function
Usage: (as-properties m)
Convert any seq of pairs to a java.utils.Properties instance.
Uses as-str to convert both keys and values into strings.
Source
as-str
function
Usage: (as-str x)
Returns the name or string representation of x
Source
as-url
multimethod
Usage: (as-url arg)
Coerces argument (URL, URI, or String) to a java.net.URL.
Source
file
function
Usage: (file arg)
(file parent child)
(file parent child & more)
Returns a java.io.File from string or file args.
Source
get-system-property
function
Usage: (get-system-property stringable)
(get-system-property stringable default)
Get a system property.
Source
read-properties
function
Usage: (read-properties file-able)
Read properties from file-able.
Source
relative-path-string
multimethod
No usage documentation available
Interpret a String or java.io.File as a relative path string.
Building block for clojure.contrib.java-utils/file.
Source
set-system-properties
function
Usage: (set-system-properties settings)
Set some system properties. Nil clears a property.
Source
with-system-properties
macro
Usage: (with-system-properties settings & body)
setting => property-name value
Sets the system properties to the supplied values, executes the body, and
sets the properties back to their original values. Values of nil are
translated to a clearing of the property.
Source
write-properties
function
Usage: (write-properties m file-able)
(write-properties m file-able comments)
Write properties to file-able.
Source