Changeset 12431 in osm for applications
- Timestamp:
- 2008-12-20T02:02:42+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
r9465 r12431 7 7 import java.io.*; 8 8 import java.net.Socket; 9 import java.net.URLDecoder; 9 10 import java.util.Date; 10 11 import java.util.HashMap; … … 41 42 * Constructor 42 43 * 43 * @param request The WMS request44 * @param request 44 45 */ 45 46 public RequestProcessor(Socket request) … … 109 110 if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) { 110 111 if (JOptionPane.showConfirmDialog(Main.parent, 111 tr("Remote Control has been asked to load data from the API. Request details: {0}. Do you want to allow this?", url), 112 "<html>" + tr("Remote Control has been asked to load data from the API.") + 113 "<br>" + tr("Request details: {0}", url) + "<br>" + tr("Do you want to allow this?"), 112 114 tr("Confirm Remote Control action"), 113 115 JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) { … … 202 204 }); 203 205 } 206 } else if (command.equals("/import")) { 207 if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) { 208 if (JOptionPane.showConfirmDialog(Main.parent, 209 "<html>" + tr("Remote Control has been asked to import data from the following URL:") + 210 "<br>" + url + 211 "<br>" + tr("Do you want to allow this?"), 212 tr("Confirm Remote Control action"), 213 JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) { 214 sendForbidden(out); 215 return; 216 } 217 } 218 if (!(args.containsKey("url"))) { 219 sendBadRequest(out); 220 System.out.println("'import' remote control request must have url parameter"); 221 return; 222 } 223 try { 224 if (!Main.pref.getBoolean("remotecontrol.permission.import", true)) 225 throw new LoadDeniedException(); 226 227 DownloadTask osmTask = new DownloadOsmTask(); 228 osmTask.loadUrl(false, URLDecoder.decode(args.get("url"), "UTF-8")); 229 } catch (LoadDeniedException ex) { 230 System.out.println("RemoteControl: import forbidden by preferences"); 231 } catch (Exception ex) { 232 sendError(out); 233 System.out.println("RemoteControl: Error parsing import remote control request:"); 234 ex.printStackTrace(); 235 return; 236 } 237 // TODO: select/zoom to downloaded 204 238 } 205 239 sendHeader(out, "200 OK", "text/plain", false);
Note:
See TracChangeset
for help on using the changeset viewer.