Changeset 6882 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks
- Timestamp:
- 2014-02-25T00:21:39+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java
r6798 r6882 19 19 public class DownloadOsmCompressedTask extends DownloadOsmTask { 20 20 21 static final String PATTERN_ GZ = "https?://.*/.*\\.osm.(gz|bz2?)";21 static final String PATTERN_COMPRESS = "https?://.*/.*\\.osm.(gz|bz2?|zip)"; 22 22 23 23 @Override 24 24 public String[] getPatterns() { 25 return new String[]{PATTERN_ GZ};25 return new String[]{PATTERN_COMPRESS}; 26 26 } 27 27 … … 31 31 } 32 32 33 /* (non-Javadoc)34 * @see org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask#download(boolean, org.openstreetmap.josm.data.Bounds, org.openstreetmap.josm.gui.progress.ProgressMonitor)35 */36 33 @Override 37 34 public Future<?> download(boolean newLayer, Bounds downloadArea, … … 54 51 if (url.matches("https?://.*/.*\\.osm.bz2?")) { 55 52 return reader.parseOsmBzip2(subTaskMonitor); 53 } else if (url.matches("https?://.*/.*\\.osm.gz")) { 54 return reader.parseOsmGzip(subTaskMonitor); 56 55 } else { 57 return reader.parseOsm Gzip(subTaskMonitor);56 return reader.parseOsmZip(subTaskMonitor); 58 57 } 59 58 } 60 59 }; 61 60 currentBounds = null; 62 // Extract .osm.gz/bz/bz2 filename from URL to set the new layer name63 extractOsmFilename("https?://.*/(.*\\.osm.(gz|bz2? ))", url);61 // Extract .osm.gz/bz/bz2/zip filename from URL to set the new layer name 62 extractOsmFilename("https?://.*/(.*\\.osm.(gz|bz2?|zip))", url); 64 63 return Main.worker.submit(downloadTask); 65 64 }
Note:
See TracChangeset
for help on using the changeset viewer.