Changeset 5745 in josm for trunk


Ignore:
Timestamp:
2013-02-25T21:47:20+01:00 (7 years ago)
Author:
Don-vip
Message:

see #8453 - Do not consider remote .gpx files as downloaded from OSM API server

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r5691 r5745  
    185185        return null;
    186186    }
     187   
     188    /**
     189     * Determines if the given URL denotes an OSM gpx-related API call.
     190     * @param url The url to check
     191     * @return true if the url matches "Trace ID" API call or "Trackpoints bbox" API call, false otherwise
     192     * @see GpxData#fromServer
     193     * @since 5745
     194     */
     195    public static final boolean isFromServer(String url) {
     196        return url != null && (url.matches(PATTERN_TRACE_ID) || url.matches(PATTERN_TRACKPOINTS_BBOX));
     197    }
    187198}
  • trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java

    r5679 r5745  
    99
    1010import org.apache.tools.bzip2.CBZip2InputStream;
     11import org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask;
    1112import org.openstreetmap.josm.data.gpx.GpxData;
    1213import org.openstreetmap.josm.data.osm.DataSet;
     
    168169                gpxParsedProperly = reader.parse(false);
    169170                GpxData result = reader.getGpxData();
    170                 result.fromServer = true;
     171                result.fromServer = DownloadGpsTask.isFromServer(url);
    171172                return result;
    172173            }
Note: See TracChangeset for help on using the changeset viewer.