Changeset 33514 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
- Timestamp:
- 2017-08-23T00:34:13+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
r33047 r33514 11 11 import java.io.InputStream; 12 12 import java.io.InputStreamReader; 13 import java.net.HttpURLConnection;14 13 import java.net.MalformedURLException; 15 14 import java.net.URL; … … 31 30 import org.openstreetmap.josm.data.osm.Way; 32 31 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 33 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;34 32 import org.openstreetmap.josm.io.OsmTransferException; 35 import org.openstreetmap.josm.io.ProgressInputStream; 33 36 34 /** 37 35 * Grab the SVG administrative boundaries of the active commune layer (cadastre), … … 193 191 194 192 private String grabSVG(URL url) throws IOException, OsmTransferException { 195 wmsInterface.urlConn = (HttpURLConnection) url.openConnection();196 wmsInterface.urlConn.setRequestProperty("Connection", "close");197 wmsInterface.urlConn.setRequestMethod("GET");198 wmsInterface.setCookie();199 193 File file = new File(CadastrePlugin.cacheDir + "boundary.svg"); 200 194 String svg = ""; 201 try (InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE)) {195 try (InputStream is = wmsInterface.getContent(url)) { 202 196 if (file.exists()) 203 197 file.delete();
Note:
See TracChangeset
for help on using the changeset viewer.