Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/HttpServer.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/HttpServer.java	(revision 12588)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/HttpServer.java	(revision 12778)
@@ -8,5 +8,5 @@
 
 /**
- * Simple HTTP server that spawns a {@link RequestProcessor} for every 
+ * Simple HTTP server that spawns a {@link RequestProcessor} for every
  * connection.
  *
@@ -17,59 +17,59 @@
 
     /** Default port for the HTTP server */
-	public static final int DEFAULT_PORT = 8111;
-	
-	/** The server socket */
-	private ServerSocket server;
+    public static final int DEFAULT_PORT = 8111;
 
-	/**
-	 * Constructor
-	 * @param port The port this server will listen on
-	 * @throws IOException when connection errors
-	 */
-	public HttpServer(int port)
-		throws IOException 
-	{
-		super("RemoteControl HTTP Server");
-		this.setDaemon(true);
-		// Start the server socket with only 1 connection.
+    /** The server socket */
+    private ServerSocket server;
+
+    /**
+     * Constructor
+     * @param port The port this server will listen on
+     * @throws IOException when connection errors
+     */
+    public HttpServer(int port)
+        throws IOException
+    {
+        super("RemoteControl HTTP Server");
+        this.setDaemon(true);
+        // Start the server socket with only 1 connection.
         // Also make sure we only listen
         // on the local interface so nobody from the outside can connect!
-		this.server = new ServerSocket(port, 1, 
+        this.server = new ServerSocket(port, 1,
             InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }));
-	}
+    }
 
-	/**
-	 * The main loop, spawns a {@link RequestProcessor} for each connection
-	 */
-	public void run() 
-	{
-		System.out.println("RemoteControl::Accepting connections on port " + server.getLocalPort());
-		while (true) 
-		{
-			try 
-			{
-				Socket request = server.accept();
-				RequestProcessor.processRequest(request);
-			}
-			catch( SocketException se)
-			{
-				if( !server.isClosed() )
-					se.printStackTrace();
-			}
-			catch (IOException ioe) 
-			{
-				ioe.printStackTrace();
-			}
-		}
-	}
-	
-	/**
+    /**
+     * The main loop, spawns a {@link RequestProcessor} for each connection
+     */
+    public void run()
+    {
+        System.out.println("RemoteControl::Accepting connections on port " + server.getLocalPort());
+        while (true)
+        {
+            try
+            {
+                Socket request = server.accept();
+                RequestProcessor.processRequest(request);
+            }
+            catch( SocketException se)
+            {
+                if( !server.isClosed() )
+                    se.printStackTrace();
+            }
+            catch (IOException ioe)
+            {
+                ioe.printStackTrace();
+            }
+        }
+    }
+
+    /**
      * Stops the HTTP server
-     *  
+     *
      * @throws IOException
-	 */
-	public void stopServer() throws IOException
-	{
-		server.close();
-	}
+     */
+    public void stopServer() throws IOException
+    {
+        server.close();
+    }
 }
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java	(revision 12588)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java	(revision 12778)
@@ -12,40 +12,40 @@
 public class RemoteControlPlugin extends Plugin 
 {
-	/** The HTTP server this plugin launches */
-	static HttpServer server;
+    /** The HTTP server this plugin launches */
+    static HttpServer server;
     
-	/**
-	 * Creates the plugin, and starts the HTTP server
-	 */
-	public RemoteControlPlugin()
-	{
-		restartServer();
-	}
-	
+    /**
+     * Creates the plugin, and starts the HTTP server
+     */
+    public RemoteControlPlugin()
+    {
+        restartServer();
+    }
+    
     @Override
-	public PreferenceSetting getPreferenceSetting() 
-	{
-		return new RemoteControlPreferences();
-	}
-	
-	/**
-	 * Starts or restarts the HTTP server
-	 *
-	 */
-	public void restartServer()
-	{
-		try
-		{
-			if (server != null)
-				server.stopServer();
-			
-			int port = HttpServer.DEFAULT_PORT;
-			server = new HttpServer(port);
-			server.start();
-		}
-		catch(IOException ioe)
-		{
-			ioe.printStackTrace();
-		}
-	}
+    public PreferenceSetting getPreferenceSetting() 
+    {
+        return new RemoteControlPreferences();
+    }
+    
+    /**
+     * Starts or restarts the HTTP server
+     *
+     */
+    public void restartServer()
+    {
+        try
+        {
+            if (server != null)
+                server.stopServer();
+            
+            int port = HttpServer.DEFAULT_PORT;
+            server = new HttpServer(port);
+            server.start();
+        }
+        catch(IOException ioe)
+        {
+            ioe.printStackTrace();
+        }
+    }
 }
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java	(revision 12588)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java	(revision 12778)
@@ -18,49 +18,49 @@
 /**
  * Preference settings for the Remote Control plugin
- * 
+ *
  * @author Frederik Ramm
  */
 public class RemoteControlPreferences implements PreferenceSetting
 {
-	private JCheckBox permissionLoadData = new JCheckBox(tr("load data from API"));
-	private JCheckBox permissionChangeSelection = new JCheckBox(tr("change the selection"));
-	private JCheckBox permissionChangeViewport = new JCheckBox(tr("change the viewport"));
-	private JCheckBox alwaysAskUserConfirm = new JCheckBox(tr("confirm all Remote Control actions manually"));
-	
-    public void addGui(final PreferenceDialog gui) 
+    private JCheckBox permissionLoadData = new JCheckBox(tr("load data from API"));
+    private JCheckBox permissionChangeSelection = new JCheckBox(tr("change the selection"));
+    private JCheckBox permissionChangeViewport = new JCheckBox(tr("change the viewport"));
+    private JCheckBox alwaysAskUserConfirm = new JCheckBox(tr("confirm all Remote Control actions manually"));
+
+    public void addGui(final PreferenceDialog gui)
     {
-		Version ver = Util.getVersion();
-		String description = tr("A plugin that allows JOSM to be controlled from other applications.");
-		if (ver != null)
-			description += "<br><br>" + tr("Version: {0}<br>Last change at {1}", ver.revision, ver.time) + "<br><br>";
-    	JPanel remote = gui.createPreferenceTab("remotecontrol.gif", tr("Remote Control"), tr("Settings for the Remote Control plugin."));    
-    	remote.add(new JLabel("<html>"+tr("The Remote Control plugin will always listen on port 8111 on localhost." + 
-    			"The port is not variable because it is referenced by external applications talking to the plugin.") + "</html>"), GBC.eol().insets(0,5,0,10).fill(GBC.HORIZONTAL));
+        Version ver = Util.getVersion();
+        String description = tr("A plugin that allows JOSM to be controlled from other applications.");
+        if (ver != null)
+            description += "<br><br>" + tr("Version: {0}<br>Last change at {1}", ver.revision, ver.time) + "<br><br>";
+        JPanel remote = gui.createPreferenceTab("remotecontrol.gif", tr("Remote Control"), tr("Settings for the Remote Control plugin."));
+        remote.add(new JLabel("<html>"+tr("The Remote Control plugin will always listen on port 8111 on localhost." +
+                "The port is not variable because it is referenced by external applications talking to the plugin.") + "</html>"), GBC.eol().insets(0,5,0,10).fill(GBC.HORIZONTAL));
 
-    	JPanel perms = new JPanel();
-    	perms.setLayout(new GridBagLayout());
-    	perms.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.gray), tr("Permitted actions")));
+        JPanel perms = new JPanel();
+        perms.setLayout(new GridBagLayout());
+        perms.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.gray), tr("Permitted actions")));
         perms.add(permissionLoadData, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
         perms.add(permissionChangeSelection, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
-        perms.add(permissionChangeViewport, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));       
+        perms.add(permissionChangeViewport, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
         remote.add(perms, GBC.eol().fill(GBC.HORIZONTAL));
-        
+
         remote.add(alwaysAskUserConfirm, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL));
         remote.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
 
-        
+
         permissionLoadData.setSelected(Main.pref.getBoolean("remotecontrol.permission.load-data", true));
         permissionChangeSelection.setSelected(Main.pref.getBoolean("remotecontrol.permission.change-selection", true));
         permissionChangeViewport.setSelected(Main.pref.getBoolean("remotecontrol.permission.change-viewport", true));
         alwaysAskUserConfirm.setSelected(Main.pref.getBoolean("remotecontrol.always-confirm", false));
-        
+
     }
-    
+
     public boolean ok() {
-    	Main.pref.put("remotecontrol.permission.load-data", permissionLoadData.isSelected());
-    	Main.pref.put("remotecontrol.permission.change-selection", permissionChangeSelection.isSelected());
-    	Main.pref.put("remotecontrol.permission.change-viewport", permissionChangeViewport.isSelected());
-    	Main.pref.put("remotecontrol.always-confirm", alwaysAskUserConfirm.isSelected());
-    	return false;
+        Main.pref.put("remotecontrol.permission.load-data", permissionLoadData.isSelected());
+        Main.pref.put("remotecontrol.permission.change-selection", permissionChangeSelection.isSelected());
+        Main.pref.put("remotecontrol.permission.change-viewport", permissionChangeViewport.isSelected());
+        Main.pref.put("remotecontrol.always-confirm", alwaysAskUserConfirm.isSelected());
+        return false;
     }
 }
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 12588)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 12778)
@@ -30,69 +30,69 @@
  * Processes HTTP "remote control" requests.
  */
-public class RequestProcessor extends Thread 
+public class RequestProcessor extends Thread
 {
-	/** The socket this processor listens on */
-	private Socket request;
-	
-	private class AlreadyLoadedException extends Exception {};
-	private class DeniedException extends Exception {};
-	private class LoadDeniedException extends Exception {};
-  
-	/**
-	 * Constructor
-	 * 
-	 * @param request 
-	 */
-	public RequestProcessor(Socket request) 
-	{
-	    super("RemoteControl request processor");
-	    this.setDaemon(true);
-		this.request = request;
-	}
-  
-	/**
-	 * Spawns a new thread for the request
-	 * 
-	 * @param request The WMS request
-	 */
-	public static void processRequest(Socket request) 
-	{
-		RequestProcessor processor = new RequestProcessor(request);
-		processor.start();
-	}  
-  
-	/**
-	 * The work is done here.
-	 */
-	public void run() 
-	{
-		Writer out = null;
-		try 
-		{            
-	        OutputStream raw = new BufferedOutputStream( request.getOutputStream());         
-	        out = new OutputStreamWriter(raw);
-	        Reader in = new InputStreamReader(new BufferedInputStream(request.getInputStream()), "ASCII");
-	        
-	        StringBuffer requestLine = new StringBuffer();
-	        while (true) 
-	        {
-	            int c = in.read();
-	            if (c == '\r' || c == '\n') break;
-	            requestLine.append((char) c);
-	        }
-	        
-	        System.out.println("RemoteControl received: " + requestLine);
-	        String get = requestLine.toString();
-	        StringTokenizer st = new StringTokenizer(get);
-	        String method = st.nextToken();
-	        String url = st.nextToken();
-
-	        if(!method.equals("GET")) {
-	        	sendNotImplemented(out);
-	        	return;
-	        }
+    /** The socket this processor listens on */
+    private Socket request;
+
+    private class AlreadyLoadedException extends Exception {};
+    private class DeniedException extends Exception {};
+    private class LoadDeniedException extends Exception {};
+
+    /**
+     * Constructor
+     *
+     * @param request
+     */
+    public RequestProcessor(Socket request)
+    {
+        super("RemoteControl request processor");
+        this.setDaemon(true);
+        this.request = request;
+    }
+
+    /**
+     * Spawns a new thread for the request
+     *
+     * @param request The WMS request
+     */
+    public static void processRequest(Socket request)
+    {
+        RequestProcessor processor = new RequestProcessor(request);
+        processor.start();
+    }
+
+    /**
+     * The work is done here.
+     */
+    public void run()
+    {
+        Writer out = null;
+        try
+        {
+            OutputStream raw = new BufferedOutputStream( request.getOutputStream());
+            out = new OutputStreamWriter(raw);
+            Reader in = new InputStreamReader(new BufferedInputStream(request.getInputStream()), "ASCII");
+
+            StringBuffer requestLine = new StringBuffer();
+            while (true)
+            {
+                int c = in.read();
+                if (c == '\r' || c == '\n') break;
+                requestLine.append((char) c);
+            }
+
+            System.out.println("RemoteControl received: " + requestLine);
+            String get = requestLine.toString();
+            StringTokenizer st = new StringTokenizer(get);
+            String method = st.nextToken();
+            String url = st.nextToken();
+
+            if(!method.equals("GET")) {
+                sendNotImplemented(out);
+                return;
+            }
 
             st = new StringTokenizer(url, "&?");
-            String command = null; 
+            String command = null;
             HashMap<String,String> args = new HashMap<String,String>();
             while (st.hasMoreTokens())
@@ -106,239 +106,239 @@
                 }
             }
-            
+
             if (command.equals("/load_and_zoom")) {
-            	if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) {
-            		if (JOptionPane.showConfirmDialog(Main.parent,
-            			"<html>" + tr("Remote Control has been asked to load data from the API.") +
+                if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) {
+                    if (JOptionPane.showConfirmDialog(Main.parent,
+                        "<html>" + tr("Remote Control has been asked to load data from the API.") +
                         "<br>" + tr("Request details: {0}", url) + "<br>" + tr("Do you want to allow this?"),
-            			tr("Confirm Remote Control action"),
-            			JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
-            				sendForbidden(out);
-            				return;
-            		}
-            	}
-            	DownloadTask osmTask = new DownloadOsmTask();
-				if (!(args.containsKey("bottom") && args.containsKey("top") && 
-					args.containsKey("left") && args.containsKey("right"))) {
-					sendBadRequest(out);
-					System.out.println("load_and_zoom remote control request must have bottom,top,left,right parameters");
-					return;	
-				}
-				double minlat = 0;
-				double maxlat = 0;
-				double minlon = 0;
-				double maxlon = 0;
-				try {
-					minlat = Double.parseDouble(args.get("bottom"));
-					maxlat = Double.parseDouble(args.get("top"));
-					minlon = Double.parseDouble(args.get("left"));
-					maxlon = Double.parseDouble(args.get("right"));
-					
-					if (!Main.pref.getBoolean("remotecontrol.permission.load-data", true))
-						throw new LoadDeniedException();
-					
-					// find out whether some data has already been downloaded
-					Area present = Main.ds.getDataSourceArea();
-					if (present != null && !present.isEmpty()) {
-						Area toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
-						toDownload.subtract(present);
-						if (toDownload.isEmpty()) throw new AlreadyLoadedException();
-						// the result might not be a rectangle (L shaped etc)
-						Rectangle2D downloadBounds = toDownload.getBounds2D();
-						minlat = downloadBounds.getMinY();
-						minlon = downloadBounds.getMinX();
-						maxlat = downloadBounds.getMaxY();
-						maxlon = downloadBounds.getMaxX();
-					}
-					osmTask.download(null, minlat,minlon,maxlat,maxlon);
-				} catch (AlreadyLoadedException ex) {
-					System.out.println("RemoteControl: no download necessary");
-				} catch (LoadDeniedException ex) {
-					System.out.println("RemoteControl: download forbidden by preferences");
-				} catch (Exception ex) {
-					sendError(out);
-					System.out.println("RemoteControl: Error parsing load_and_zoom remote control request:");
-					ex.printStackTrace();
-					return;
-				}
-				if (args.containsKey("select") && Main.pref.getBoolean("remotecontrol.permission.change-selection", true)) {
-					// select objects after downloading, zoom to selection.
-					final String selection = args.get("select");
-					Main.worker.execute(new Runnable() {
-						public void run() {
-							HashSet<Long> ways = new HashSet<Long>();
-							HashSet<Long> nodes = new HashSet<Long>();
-							HashSet<Long> relations = new HashSet<Long>();
-							HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
-							for (String item : selection.split(",")) {
-								if (item.startsWith("way"))	{
-									ways.add(Long.parseLong(item.substring(3)));
-								} else if (item.startsWith("node")) {
-									nodes.add(Long.parseLong(item.substring(4)));
-								} else if (item.startsWith("relation")) {
-									relations.add(Long.parseLong(item.substring(8)));
-								} else {
-									System.out.println("RemoteControl: invalid selection '"+item+"' ignored");
-								}
-							}
-							for (Way w : Main.ds.ways) if (ways.contains(w.id)) newSel.add(w);
-							for (Node n : Main.ds.nodes) if (nodes.contains(n.id)) newSel.add(n);
-							for (Relation r : Main.ds.relations) if (relations.contains(r.id)) newSel.add(r);	
-							Main.ds.setSelected(newSel);
-							if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true))
-								new AutoScaleAction("selection").actionPerformed(null);
-						}
-					});
-				} else if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true)) {
-					// after downloading, zoom to downloaded area.
-					final LatLon min = new LatLon(minlat, minlon);
-					final LatLon max = new LatLon(maxlat, maxlon);
-					
-					Main.worker.execute(new Runnable() {
-						public void run() {
-							BoundingXYVisitor bbox = new BoundingXYVisitor();
-							bbox.min = Main.proj.latlon2eastNorth(min);
-							bbox.max = Main.proj.latlon2eastNorth(max);
-							Main.map.mapView.recalculateCenterScale(bbox);
-						}
-					});
-				}
+                        tr("Confirm Remote Control action"),
+                        JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
+                            sendForbidden(out);
+                            return;
+                    }
+                }
+                DownloadTask osmTask = new DownloadOsmTask();
+                if (!(args.containsKey("bottom") && args.containsKey("top") &&
+                    args.containsKey("left") && args.containsKey("right"))) {
+                    sendBadRequest(out);
+                    System.out.println("load_and_zoom remote control request must have bottom,top,left,right parameters");
+                    return;
+                }
+                double minlat = 0;
+                double maxlat = 0;
+                double minlon = 0;
+                double maxlon = 0;
+                try {
+                    minlat = Double.parseDouble(args.get("bottom"));
+                    maxlat = Double.parseDouble(args.get("top"));
+                    minlon = Double.parseDouble(args.get("left"));
+                    maxlon = Double.parseDouble(args.get("right"));
+
+                    if (!Main.pref.getBoolean("remotecontrol.permission.load-data", true))
+                        throw new LoadDeniedException();
+
+                    // find out whether some data has already been downloaded
+                    Area present = Main.ds.getDataSourceArea();
+                    if (present != null && !present.isEmpty()) {
+                        Area toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
+                        toDownload.subtract(present);
+                        if (toDownload.isEmpty()) throw new AlreadyLoadedException();
+                        // the result might not be a rectangle (L shaped etc)
+                        Rectangle2D downloadBounds = toDownload.getBounds2D();
+                        minlat = downloadBounds.getMinY();
+                        minlon = downloadBounds.getMinX();
+                        maxlat = downloadBounds.getMaxY();
+                        maxlon = downloadBounds.getMaxX();
+                    }
+                    osmTask.download(null, minlat,minlon,maxlat,maxlon);
+                } catch (AlreadyLoadedException ex) {
+                    System.out.println("RemoteControl: no download necessary");
+                } catch (LoadDeniedException ex) {
+                    System.out.println("RemoteControl: download forbidden by preferences");
+                } catch (Exception ex) {
+                    sendError(out);
+                    System.out.println("RemoteControl: Error parsing load_and_zoom remote control request:");
+                    ex.printStackTrace();
+                    return;
+                }
+                if (args.containsKey("select") && Main.pref.getBoolean("remotecontrol.permission.change-selection", true)) {
+                    // select objects after downloading, zoom to selection.
+                    final String selection = args.get("select");
+                    Main.worker.execute(new Runnable() {
+                        public void run() {
+                            HashSet<Long> ways = new HashSet<Long>();
+                            HashSet<Long> nodes = new HashSet<Long>();
+                            HashSet<Long> relations = new HashSet<Long>();
+                            HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
+                            for (String item : selection.split(",")) {
+                                if (item.startsWith("way")) {
+                                    ways.add(Long.parseLong(item.substring(3)));
+                                } else if (item.startsWith("node")) {
+                                    nodes.add(Long.parseLong(item.substring(4)));
+                                } else if (item.startsWith("relation")) {
+                                    relations.add(Long.parseLong(item.substring(8)));
+                                } else {
+                                    System.out.println("RemoteControl: invalid selection '"+item+"' ignored");
+                                }
+                            }
+                            for (Way w : Main.ds.ways) if (ways.contains(w.id)) newSel.add(w);
+                            for (Node n : Main.ds.nodes) if (nodes.contains(n.id)) newSel.add(n);
+                            for (Relation r : Main.ds.relations) if (relations.contains(r.id)) newSel.add(r);
+                            Main.ds.setSelected(newSel);
+                            if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true))
+                                new AutoScaleAction("selection").actionPerformed(null);
+                        }
+                    });
+                } else if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true)) {
+                    // after downloading, zoom to downloaded area.
+                    final LatLon min = new LatLon(minlat, minlon);
+                    final LatLon max = new LatLon(maxlat, maxlon);
+
+                    Main.worker.execute(new Runnable() {
+                        public void run() {
+                            BoundingXYVisitor bbox = new BoundingXYVisitor();
+                            bbox.min = Main.proj.latlon2eastNorth(min);
+                            bbox.max = Main.proj.latlon2eastNorth(max);
+                            Main.map.mapView.recalculateCenterScale(bbox);
+                        }
+                    });
+                }
             } else if (command.equals("/import")) {
-            	if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) {
-            		if (JOptionPane.showConfirmDialog(Main.parent,
-            			"<html>" + tr("Remote Control has been asked to import data from the following URL:") + 
-                        "<br>" + url + 
+                if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) {
+                    if (JOptionPane.showConfirmDialog(Main.parent,
+                        "<html>" + tr("Remote Control has been asked to import data from the following URL:") +
+                        "<br>" + url +
                         "<br>" + tr("Do you want to allow this?"),
-            			tr("Confirm Remote Control action"),
-            			JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
-            				sendForbidden(out);
-            				return;
-            		}
-            	}
-				if (!(args.containsKey("url"))) {
-					sendBadRequest(out);
-					System.out.println("'import' remote control request must have url parameter");
-					return;	
-				}
-				try {
-					if (!Main.pref.getBoolean("remotecontrol.permission.import", true))
-						throw new LoadDeniedException();
-					
-            	    DownloadTask osmTask = new DownloadOsmTask();
-					osmTask.loadUrl(false, URLDecoder.decode(args.get("url"), "UTF-8"));
-				} catch (LoadDeniedException ex) {
-					System.out.println("RemoteControl: import forbidden by preferences");
-				} catch (Exception ex) {
-					sendError(out);
-					System.out.println("RemoteControl: Error parsing import remote control request:");
-					ex.printStackTrace();
-					return;
-				}
+                        tr("Confirm Remote Control action"),
+                        JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
+                            sendForbidden(out);
+                            return;
+                    }
+                }
+                if (!(args.containsKey("url"))) {
+                    sendBadRequest(out);
+                    System.out.println("'import' remote control request must have url parameter");
+                    return;
+                }
+                try {
+                    if (!Main.pref.getBoolean("remotecontrol.permission.import", true))
+                        throw new LoadDeniedException();
+
+                    DownloadTask osmTask = new DownloadOsmTask();
+                    osmTask.loadUrl(false, URLDecoder.decode(args.get("url"), "UTF-8"));
+                } catch (LoadDeniedException ex) {
+                    System.out.println("RemoteControl: import forbidden by preferences");
+                } catch (Exception ex) {
+                    sendError(out);
+                    System.out.println("RemoteControl: Error parsing import remote control request:");
+                    ex.printStackTrace();
+                    return;
+                }
                 // TODO: select/zoom to downloaded
             }
-			sendHeader(out, "200 OK", "text/plain", false);
+            sendHeader(out, "200 OK", "text/plain", false);
             out.write("Content-length: 4\r\n");
             out.write("\r\n");
             out.write("OK\r\n");
             out.flush();
-		}
-		catch (IOException ioe) { }
-		catch(Exception e) {
-			e.printStackTrace();
-			try {
-				sendError(out);
-			} catch (IOException e1) { }
-		} finally {
-	        try {
-	        	request.close();        
-	        } catch (IOException e) {} 
-		}
-	}
-
-	/**
-	 * Sends a 500 error: server error
-	 * @param out The writer where the error is written
-	 * @throws IOException If the error can not be written
-	 */
-	private void sendError(Writer out) throws IOException
-	{
-		sendHeader(out, "500 Internal Server Error", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Internal Error</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 500: Internal Server Error</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-
-	/**
-	 * Sends a 501 error: not implemented
-	 * @param out The writer where the error is written
-	 * @throws IOException If the error can not be written
-	 */
-	private void sendNotImplemented(Writer out) throws IOException
-	{
-		sendHeader(out, "501 Not Implemented", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Not Implemented</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 501: Not Implemented</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-
-	/**
-	 * Sends a 403 error: forbidden
-	 * @param out The writer where the error is written
-	 * @throws IOException If the error can not be written
-	 */
-	private void sendForbidden(Writer out) throws IOException
-	{
-		sendHeader(out, "403 Forbidden", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Forbidden</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 403: Forbidden</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-	/**
-	 * Sends a 403 error: forbidden
-	 * @param out The writer where the error is written
-	 * @throws IOException If the error can not be written
-	 */
-	private void sendBadRequest(Writer out) throws IOException
-	{
-		sendHeader(out, "400 Bad Request", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Bad Request</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 400: Bad Request</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-	
-	/**
-	 * Send common HTTP headers to the client.
-	 * 
-	 * @param out The Writer
-	 * @param status The status string ("200 OK", "500", etc)
-	 * @param contentType The content type of the data sent
-	 * @param endHeaders If true, adds a new line, ending the headers.
-	 * @throws IOException When error
-	 */
-	private void sendHeader(Writer out, String status, String contentType, boolean endHeaders) throws IOException
-	{
-		out.write("HTTP/1.1 " + status + "\r\n");
-		Date now = new Date();
-		out.write("Date: " + now + "\r\n");
+        }
+        catch (IOException ioe) { }
+        catch(Exception e) {
+            e.printStackTrace();
+            try {
+                sendError(out);
+            } catch (IOException e1) { }
+        } finally {
+            try {
+                request.close();
+            } catch (IOException e) {}
+        }
+    }
+
+    /**
+     * Sends a 500 error: server error
+     * @param out The writer where the error is written
+     * @throws IOException If the error can not be written
+     */
+    private void sendError(Writer out) throws IOException
+    {
+        sendHeader(out, "500 Internal Server Error", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Internal Error</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 500: Internal Server Error</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Sends a 501 error: not implemented
+     * @param out The writer where the error is written
+     * @throws IOException If the error can not be written
+     */
+    private void sendNotImplemented(Writer out) throws IOException
+    {
+        sendHeader(out, "501 Not Implemented", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Not Implemented</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 501: Not Implemented</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Sends a 403 error: forbidden
+     * @param out The writer where the error is written
+     * @throws IOException If the error can not be written
+     */
+    private void sendForbidden(Writer out) throws IOException
+    {
+        sendHeader(out, "403 Forbidden", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Forbidden</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 403: Forbidden</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+    /**
+     * Sends a 403 error: forbidden
+     * @param out The writer where the error is written
+     * @throws IOException If the error can not be written
+     */
+    private void sendBadRequest(Writer out) throws IOException
+    {
+        sendHeader(out, "400 Bad Request", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Bad Request</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 400: Bad Request</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Send common HTTP headers to the client.
+     *
+     * @param out The Writer
+     * @param status The status string ("200 OK", "500", etc)
+     * @param contentType The content type of the data sent
+     * @param endHeaders If true, adds a new line, ending the headers.
+     * @throws IOException When error
+     */
+    private void sendHeader(Writer out, String status, String contentType, boolean endHeaders) throws IOException
+    {
+        out.write("HTTP/1.1 " + status + "\r\n");
+        Date now = new Date();
+        out.write("Date: " + now + "\r\n");
         out.write("Server: JOSM RemoteControl\r\n");
         out.write("Content-type: " + contentType + "\r\n");
         if (endHeaders)
-        	out.write("\r\n");
-	}
+            out.write("\r\n");
+    }
 }
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/Util.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/Util.java	(revision 12588)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/Util.java	(revision 12778)
@@ -17,11 +17,11 @@
 /**
  * Utility class
- * 
+ *
  */
-public class Util 
+public class Util
 {
     /**
      * Utility method to retrieve the plugin for classes that can't access to the plugin object directly.
-     * 
+     *
      * @param clazz The plugin class
      * @return The YWMS plugin
@@ -29,5 +29,5 @@
     public static Plugin getPlugin(Class<? extends Plugin> clazz)
     {
-    	String classname = clazz.getName();
+        String classname = clazz.getName();
         for (PluginProxy plugin : Main.plugins)
         {
@@ -39,23 +39,23 @@
         return null;
     }
-    
-	/** 
-	 * Returns the plugin's directory of the plugin
-	 * 
-	 * @return The directory of the plugin
-	 */
-	public static String getPluginDir()
-	{
-		return Main.pref.getPreferencesDir() + "plugins/ywms/";
-	}
 
-	/**
-	 * Returns the version
-	 * @return The version of the application
-	 */
-	public static Version getVersion()
+    /**
+     * Returns the plugin's directory of the plugin
+     *
+     * @return The directory of the plugin
+     */
+    public static String getPluginDir()
+    {
+        return Main.pref.getPreferencesDir() + "plugins/ywms/";
+    }
+
+    /**
+     * Returns the version
+     * @return The version of the application
+     */
+    public static Version getVersion()
     {
         PluginInformation info = PluginInformation.getLoaded("ywms");
-        if (info == null) 
+        if (info == null)
             return null;
 
@@ -65,14 +65,14 @@
     /**
      * Utility class for displaying versions
-     * 
+     *
      * @author frsantos
      */
     public static class Version
     {
-    	/** The revision */
-    	public String revision;
-    	/** The build time */
-    	public String time;
-    	
+        /** The revision */
+        public String revision;
+        /** The build time */
+        public String time;
+
         /**
          * Constructor
@@ -80,9 +80,9 @@
          * @param time
          */
-        public Version(String revision, String time) 
+        public Version(String revision, String time)
         {
-			this.revision = revision;
-			this.time = time;
-		}
+            this.revision = revision;
+            this.time = time;
+        }
     }
 }
