       (.write wrtr config-file)))
   path)
 
+(defn- with-condition [check elements success]
+  (cond 
+    (apply check elements) (success)
+    :else false))
+
 (defn exists? 
   ([user]
   (.exists (as-file (base-dir-for user))))

  (and (exists? user) (.exists (as-file (:path (file-path user item)))))))

(defn- with-existing [elements function]
  (cond 
    (every? exists? elements) (function)
    :else false))

(defn valid? 
  ([{username :username password :password}]

   (and (valid? user) (and (not-empty item-id) (and (number? price) (pos? price))))))

(defn- with-valid [elements function]
  (with-condition valid? elements function))

(defmulti  #^{:private true} config-file-for (fn [object] (class object)))

