Changeset 9509 in josm for trunk/src/org
- Timestamp:
- 2016-01-17T19:46:20+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r9067 r9509 129 129 protected void finish() { 130 130 rememberDownloadedData(rawData); 131 if (isCanceled() || isFailed())132 return;133 131 if (rawData == null) 134 132 return; -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r8995 r9509 6 6 import java.io.IOException; 7 7 import java.io.InputStream; 8 import java.net.SocketException; 8 9 import java.util.List; 9 10 11 import org.openstreetmap.josm.Main; 10 12 import org.openstreetmap.josm.data.Bounds; 11 13 import org.openstreetmap.josm.data.DataSource; … … 49 51 GpxData result = null; 50 52 String url = "trackpoints?bbox="+b.getMinLon()+','+b.getMinLat()+','+b.getMaxLon()+','+b.getMaxLat()+"&page="; 51 for (int i = 0; !done ; ++i) {53 for (int i = 0; !done && !isCanceled(); ++i) { 52 54 progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, (i + 1) * 5000)); 53 55 try (InputStream in = getInputStream(url+i, progressMonitor.createSubTaskMonitor(1, true))) { … … 65 67 } else { 66 68 done = true; 69 } 70 } catch (OsmTransferException | SocketException ex) { 71 if (isCanceled()) { 72 final OsmTransferCanceledException canceledException = new OsmTransferCanceledException("Operation canceled"); 73 canceledException.initCause(ex); 74 Main.warn(canceledException); 67 75 } 68 76 } … … 209 217 } 210 218 return notes; 211 } catch (IOException e) { 212 throw new OsmTransferException(e); 213 } catch (SAXException e) { 219 } catch (IOException | SAXException e) { 214 220 throw new OsmTransferException(e); 215 221 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.