Changeset 30859 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
- Timestamp:
- 2014-12-19T17:12:01+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r30738 r30859 115 115 urlConn.connect(); 116 116 if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) { 117 System.out.println("GET "+searchFormURL);117 Main.info("GET "+searchFormURL); 118 118 BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); 119 119 while(in.readLine() != null) {} // read the buffer otherwise we sent POST too early … … 124 124 cookie = cookie.substring(0, cookie.indexOf(";")); 125 125 cookieTimestamp = new Date().getTime(); 126 System.out.println("received cookie=" + cookie + " at " + new Date(cookieTimestamp));126 Main.info("received cookie=" + cookie + " at " + new Date(cookieTimestamp)); 127 127 cookied = true; 128 128 } 129 129 } 130 130 } else { 131 System.out.println("Request to home page failed. Http error:"+urlConn.getResponseCode()+". Try again "+retries+" times");131 Main.warn("Request to home page failed. Http error:"+urlConn.getResponseCode()+". Try again "+retries+" times"); 132 132 CadastrePlugin.safeSleep(3000); 133 133 retries --; … … 135 135 } 136 136 } catch (MalformedURLException e) { 137 throw (IOException) new IOException( 138 "Illegal url.").initCause(e); 137 throw new IOException("Illegal url.", e); 139 138 } 140 139 } … … 148 147 long now = new Date().getTime(); 149 148 if ((now - cookieTimestamp) > cCookieExpiration) { 150 System.out.println("cookie received at "+new Date(cookieTimestamp)+" expired (now is "+new Date(now)+")");149 Main.info("cookie received at "+new Date(cookieTimestamp)+" expired (now is "+new Date(now)+")"); 151 150 return true; 152 151 } … … 222 221 throw new IOException("Cannot open Cadastre interface. GET response:"+urlConn.getResponseCode()); 223 222 } 224 System.out.println("GET "+interfaceURL);223 Main.info("GET "+interfaceURL); 225 224 BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); 226 225 // read the buffer otherwise we sent POST too early … … 305 304 lines = lines.substring(lines.indexOf(cInterfaceVector),lines.length()); 306 305 lines = lines.substring(0, lines.indexOf("'")); 307 System.out.println("interface ref.:"+lines);306 Main.info("interface ref.:"+lines); 308 307 return lines; 309 308 } else if (wmsLayer.isRaster() && lines.indexOf(cInterfaceRasterTA) != -1) { // "afficherCarteTa.do" … … 320 319 wmsLayer.setCodeCommune(listOfFeuilles.elementAt(res).ref); 321 320 lines = buildRasterFeuilleInterfaceRef(listOfFeuilles.elementAt(res).ref); 322 System.out.println("interface ref.:"+lines);321 Main.info("interface ref.:"+lines); 323 322 return lines; 324 323 } … … 351 350 String lov = new String(input.substring(i+c0ptionListStart.length()-1, j)); 352 351 if (lov.indexOf(">") != -1) { 353 System.out.println("parse "+lov);352 Main.info("parse "+lov); 354 353 listOfCommunes.add(lov); 355 354 } else 356 System.err.println("unable to parse commune string:"+lov);355 Main.error("unable to parse commune string:"+lov); 357 356 } 358 357 input = input.substring(j+cOptionListEnd.length()); … … 481 480 throw new IOException("Cannot get Cadastre response."); 482 481 } 483 System.out.println("GET "+searchFormURL);482 Main.info("GET "+searchFormURL); 484 483 try (BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()))) { 485 484 while ((ln = in.readLine()) != null) { … … 541 540 // wmsLayer.Y0 = Y0; 542 541 // } 543 // System.out.println("parse georef:"+unknown_yet+","+angle+","+scale_origin+","+dpi+","+fX+","+542 // Main.info("parse georef:"+unknown_yet+","+angle+","+scale_origin+","+dpi+","+fX+","+ 544 543 // fY+","+X0+","+Y0); 545 544 // } … … 550 549 for (Layer l : Main.map.mapView.getAllLayers()) { 551 550 if (l instanceof WMSLayer && l.getName().equals(wmsLayer.getName()) && (l != wmsLayer)) { 552 System.out.println("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened.");551 Main.info("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened."); 553 552 // remove the duplicated layer 554 553 Main.main.removeLayer(wmsLayer);
Note:
See TracChangeset
for help on using the changeset viewer.
