Changeset 11262 in josm for trunk/src/org
- Timestamp:
- 2016-11-16T13:53:46+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r11247 r11262 1392 1392 1393 1393 /** 1394 * Returns the OSM website URL depending on the selected {@link OsmApi}. 1395 * @return the OSM website URL depending on the selected {@link OsmApi} 1396 */ 1397 private static String getOSMWebsiteDependingOnSelectedApi() { 1398 final String api = OsmApi.getOsmApi().getServerUrl(); 1399 if (OsmApi.DEFAULT_API_URL.equals(api)) { 1400 return getOSMWebsite(); 1401 } else { 1402 return api.replaceAll("/api$", ""); 1403 } 1404 } 1405 1406 /** 1394 1407 * Replies the base URL for browsing information about a primitive. 1395 1408 * @return the base URL, i.e. https://www.openstreetmap.org … … 1398 1411 public static String getBaseBrowseUrl() { 1399 1412 if (Main.pref != null) 1400 return Main.pref.get("osm-browse.url", getOSMWebsite()); 1401 return getOSMWebsite(); 1413 return Main.pref.get("osm-browse.url", getOSMWebsiteDependingOnSelectedApi()); 1414 return getOSMWebsiteDependingOnSelectedApi(); 1402 1415 } 1403 1416 … … 1409 1422 public static String getBaseUserUrl() { 1410 1423 if (Main.pref != null) 1411 return Main.pref.get("osm-user.url", getOSMWebsite() + "/user"); 1412 return getOSMWebsite() + "/user"; 1424 return Main.pref.get("osm-user.url", getOSMWebsiteDependingOnSelectedApi() + "/user"); 1425 return getOSMWebsiteDependingOnSelectedApi() + "/user"; 1413 1426 } 1414 1427 -
trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java
r10212 r11262 61 61 try { 62 62 progressMonitor.indeterminateSubTask(tr("Contacting OSM Server...")); 63 StringBuilder sb = new StringBuilder(); 64 sb.append(primitiveType.getAPIName()) 65 .append('/').append(id).append("/history"); 63 final String urlStr = primitiveType.getAPIName() + '/' + id + "/history"; 66 64 67 try (InputStream in = getInputStream( sb.toString(), progressMonitor.createSubTaskMonitor(1, true))) {65 try (InputStream in = getInputStream(urlStr, progressMonitor.createSubTaskMonitor(1, true))) { 68 66 if (in == null) 69 67 return null;
Note:
See TracChangeset
for help on using the changeset viewer.