 
 ;; collection files
 
-(defn create-default-path []
-  (str (System/getProperty "user.name") ".mmdb.txt"))
-
-(defn new-collection []
-  (File. (create-default-path)))
-
-(defn read-collection-list []
-  (read-value-from-prefs prefs "collection-files"))
+(defn read-collection-map []
+  (or (read-value-from-prefs prefs "collection-files")
+      (let [name (System/getProperty "user.name")]
+        {name (.getAbsolutePath (File. (str name ".mmdb.txt")))})))
+
+(defn save-collection-map [collection-map]
+  (write-value-to-prefs prefs "collection-files" collection-map))
 
 (defn get-current-data-and-settings []
   (let [table (@browser :table)

    (.setLayout panel (SpringLayout.))
    (constrain-to-parent scroll-pane :n 32 :w 5 :s -5 :e -5
                         search-field :n 5 :w 25 :n 28 :w 200
                         settings-button :n 5 :w 200 :n 28 :w 305
                         search-label :n 5 :w 5 :n 28 :w 25
                         collection-label :n 5 :w 310 :n 28 :w 380
                         collection-menu :n 5 :w 380 :n 28 :w 525)
    (connect-search search-field table)
    (.setSortsOnUpdates (.getRowSorter table) true)
    (listen-to-open table)

           [javax.swing.table AbstractTableModel DefaultTableModel
                              TableColumn TableRowSorter]
           [javax.swing.event DocumentListener TableModelListener]
           [java.io BufferedReader File FileReader PrintWriter]
           [java.util Vector]
           [java.util.prefs Preferences]
           [java.awt Color Dimension Font Insets]
