diff --git a/src/org/openstreetmap/josm/data/CustomConfigurator.java b/src/org/openstreetmap/josm/data/CustomConfigurator.java
index 5aa8449..d853b28 100644
--- a/src/org/openstreetmap/josm/data/CustomConfigurator.java
+++ b/src/org/openstreetmap/josm/data/CustomConfigurator.java
@@ -415,12 +415,19 @@ public class CustomConfigurator {
         
         
         ScriptEngine engine ;
-        
+
         public void openAndReadXML(File file) {
-            log("-- Reading custom preferences from " + file.getAbsolutePath() + " --");
-            InputStream is = null;
             try {
-                is = new BufferedInputStream(new FileInputStream(file));
+                log("-- Reading custom preferences from " + file.getAbsolutePath() + " --");
+                openAndReadXML(new BufferedInputStream(new FileInputStream(file)));
+                log("-- Reading complete --");
+            } catch (IOException ex) {
+                log("Error reading custom preferences: " + ex.getMessage());
+            }
+        }
+
+        public void openAndReadXML(InputStream is) {
+            try {
                 DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
                 builderFactory.setValidating(false);
                 builderFactory.setNamespaceAware(true);
@@ -438,7 +445,6 @@ public class CustomConfigurator {
                     }
                 } catch (IOException ex) {         }
             }
-            log("-- Reading complete --");
         }
 
         public XMLCommandProcessor(Preferences mainPrefs) {
diff --git a/src/org/openstreetmap/josm/gui/MainApplication.java b/src/org/openstreetmap/josm/gui/MainApplication.java
index 01676f4..d108c83 100644
--- a/src/org/openstreetmap/josm/gui/MainApplication.java
+++ b/src/org/openstreetmap/josm/gui/MainApplication.java
@@ -10,8 +10,7 @@ import java.awt.event.ActionEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.io.File;
-import java.net.Authenticator;
-import java.net.ProxySelector;
+import java.net.*;
 import java.security.AllPermission;
 import java.security.CodeSource;
 import java.security.PermissionCollection;
@@ -30,6 +29,7 @@ import javax.swing.SwingUtilities;
 import org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.AutosaveTask;
+import org.openstreetmap.josm.data.CustomConfigurator;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.gui.download.DownloadDialog;
@@ -102,6 +102,7 @@ public class MainApplication extends Main {
                 "\t--selection=<searchstring>                "+tr("Select with the given search")+"\n"+
                 "\t--[no-]maximize                           "+tr("Launch in maximized mode")+"\n"+
                 "\t--reset-preferences                       "+tr("Reset the preferences to default")+"\n\n"+
+                "\t--load-preferences=<url-to-xml>           "+tr("Reset the preferences to default")+"\n\n"+
                 "\t--set=<key>=<value>                       "+tr("Set preference key to value")+"\n\n"+
                 "\t--language=<language>                     "+tr("Set the language")+"\n\n"+
                 tr("options provided as Java system properties")+":\n"+
@@ -201,6 +202,21 @@ public class MainApplication extends Main {
         }
         Main.pref.updateSystemProperties();
 
+        JFrame mainFrame = new JFrame(tr("Java OpenStreetMap Editor"));
+        Main.parent = mainFrame;
+        if (args.containsKey("load-preferences")) {
+            CustomConfigurator.XMLCommandProcessor config = new CustomConfigurator.XMLCommandProcessor(Main.pref);
+            for (String i : args.get("load-preferences")) {
+                System.out.println("Reading preferences from " + i);
+                try {
+                    URL url = new URL(i);
+                    config.openAndReadXML(url.openStream());
+                } catch (Exception ex) {
+                    throw new RuntimeException(ex);
+                }
+            }
+        }
+
         if (args.containsKey("set")) {
             for (String i : args.get("set")) {
                 String[] kv = i.split("=", 2);
@@ -247,8 +263,6 @@ public class MainApplication extends Main {
         preConstructorInit(args);
 
         monitor.indeterminateSubTask(tr("Creating main GUI"));
-        JFrame mainFrame = new JFrame(tr("Java OpenStreetMap Editor"));
-        Main.parent = mainFrame;
         Main.addListener();
         final Main main = new MainApplication(mainFrame);
 
