aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/java_utils.clj
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2009-04-10 02:47:52 +0000
committerStuart Halloway <stu@thinkrelevance.com>2009-04-10 02:47:52 +0000
commit71c8d51d0a920a46eef39117aab33a9f59c10bf2 (patch)
tree000696aacd729eb81f32279553531625afc29459 /src/clojure/contrib/java_utils.clj
parent00bfc0caaf56e879bced5c7dbcd2f513fd0ea9a8 (diff)
Stuart S's suggestions for properties
Diffstat (limited to 'src/clojure/contrib/java_utils.clj')
-rw-r--r--src/clojure/contrib/java_utils.clj12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/clojure/contrib/java_utils.clj b/src/clojure/contrib/java_utils.clj
index c5e120bb..0ac39ece 100644
--- a/src/clojure/contrib/java_utils.clj
+++ b/src/clojure/contrib/java_utils.clj
@@ -72,15 +72,19 @@
(name x)
(str x)))
-(defn get-system-property [stringable]
- (System/getProperty (as-str stringable)))
+(defn get-system-property
+ "Get a system property."
+ ([stringable]
+ (System/getProperty (as-str stringable)))
+ ([stringable default]
+ (System/getProperty (as-str stringable) default)))
(defn set-system-properties
- [settings]
"Set some system properties. Nil clears a property."
+ [settings]
(doseq [[name val] settings]
(if val
- (System/setProperty (as-str name) val)
+ (System/setProperty (as-str name) (as-str val))
(System/clearProperty (as-str name)))))
(defmacro with-system-properties