Changeset 5486 in josm for trunk/src


Ignore:
Timestamp:
2012-09-01T16:36:47+02:00 (12 years ago)
Author:
Don-vip
Message:

Allow to download remote files using https://

Location:
trunk/src/org/openstreetmap/josm/actions/downloadtasks
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java

    r5175 r5486  
    3333    private static final String PATTERN_TRACKPOINTS_BBOX = "http://.*/api/0.6/trackpoints\\?bbox=.*,.*,.*,.*";
    3434
    35     private static final String PATTERN_EXTERNAL_GPX_SCRIPT = "http://.*exportgpx.*";
    36     private static final String PATTERN_EXTERNAL_GPX_FILE = "http://.*/(.*\\.gpx)";
     35    private static final String PATTERN_EXTERNAL_GPX_SCRIPT = "https?://.*exportgpx.*";
     36    private static final String PATTERN_EXTERNAL_GPX_FILE = "https?://.*/(.*\\.gpx)";
    3737
    3838    protected String newLayerName = null;
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeCompressedTask.java

    r5361 r5486  
    1717    @Override
    1818    public boolean acceptsUrl(String url) {
    19         return url != null && url.matches("http://.*/.*\\.osc.(gz|bz2?)"); // Remote .osc.gz / .osc.bz / .osc.bz2 files
     19        return url != null && url.matches("https?://.*/.*\\.osc.(gz|bz2?)"); // Remote .osc.gz / .osc.bz / .osc.bz2 files
    2020    }
    2121       
     
    3030            protected DataSet parseDataSet() throws OsmTransferException {
    3131                ProgressMonitor subTaskMonitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
    32                 if (url.matches("http://.*/.*\\.osc.bz2?")) {
     32                if (url.matches("https?://.*/.*\\.osc.bz2?")) {
    3333                    return reader.parseOsmChangeBzip2(subTaskMonitor);
    3434                } else {
     
    3939        currentBounds = null;
    4040        // Extract .osc.gz/bz/bz2 filename from URL to set the new layer name
    41         extractOsmFilename("http://.*/(.*\\.osc.(gz|bz2?))", url);
     41        extractOsmFilename("https?://.*/(.*\\.osc.(gz|bz2?))", url);
    4242        return Main.worker.submit(downloadTask);
    4343    }
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java

    r5476 r5486  
    3939        return url != null && (
    4040                url.matches("http://.*/api/0.6/changeset/\\p{Digit}+/download") // OSM API 0.6 changesets
    41              || url.matches("http://.*/.*\\.osc")                               // Remote .osc files
     41             || url.matches("https?://.*/.*\\.osc")                             // Remote .osc files
    4242                );
    4343    }
     
    6262                progressMonitor);
    6363        // Extract .osc filename from URL to set the new layer name
    64         extractOsmFilename("http://.*/(.*\\.osc)", url);
     64        extractOsmFilename("https?://.*/(.*\\.osc)", url);
    6565        return Main.worker.submit(downloadTask);
    6666    }
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java

    r5361 r5486  
    1818    @Override
    1919    public boolean acceptsUrl(String url) {
    20         return url != null && url.matches("http://.*/.*\\.osm.(gz|bz2?)"); // Remote .osm.gz / .osm.bz / .osm.bz2 files
     20        return url != null && url.matches("https?://.*/.*\\.osm.(gz|bz2?)"); // Remote .osm.gz / .osm.bz / .osm.bz2 files
    2121    }
    2222   
     
    4040            protected DataSet parseDataSet() throws OsmTransferException {
    4141                ProgressMonitor subTaskMonitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);
    42                 if (url.matches("http://.*/.*\\.osm.bz2?")) {
     42                if (url.matches("https?://.*/.*\\.osm.bz2?")) {
    4343                    return reader.parseOsmBzip2(subTaskMonitor);
    4444                } else {
     
    4949        currentBounds = null;
    5050        // Extract .osm.gz/bz/bz2 filename from URL to set the new layer name
    51         extractOsmFilename("http://.*/(.*\\.osm.(gz|bz2?))", url);
     51        extractOsmFilename("https?://.*/(.*\\.osm.(gz|bz2?))", url);
    5252        return Main.worker.submit(downloadTask);
    5353    }
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r5402 r5486  
    129129        currentBounds = null;
    130130        // Extract .osm filename from URL to set the new layer name
    131         extractOsmFilename("http://.*/(.*\\.osm)", url);
     131        extractOsmFilename("https?://.*/(.*\\.osm)", url);
    132132        return Main.worker.submit(downloadTask);
    133133    }
     
    147147             || url.matches("http://.*/interpreter\\?data=.*")                      // Overpass API
    148148             || url.matches("http://.*/xapi\\?.*\\[@meta\\].*")                     // Overpass API XAPI compatibility layer
    149              || url.matches("http://.*/.*\\.osm")                                   // Remote .osm files
     149             || url.matches("https?://.*/.*\\.osm")                                 // Remote .osm files
    150150                );
    151151    }
Note: See TracChangeset for help on using the changeset viewer.