- Timestamp:
- 2018-01-20T19:54:16+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r13328 r13346 235 235 } 236 236 237 doAttemptGetCapabilities(serviceUrlStr, getCapabilitiesUrl); 238 } 239 240 private void doAttemptGetCapabilities(String serviceUrlStr, URL getCapabilitiesUrl) 241 throws IOException, WMSGetCapabilitiesException { 237 242 final Response response = HttpClient.create(getCapabilitiesUrl).connect(); 238 243 … … 241 246 } 242 247 243 parseCapabilities(serviceUrlStr, response.getContent()); 248 try { 249 parseCapabilities(serviceUrlStr, response.getContent()); 250 } catch (WMSGetCapabilitiesException e) { 251 String url = getCapabilitiesUrl.toExternalForm(); 252 // ServiceException for servers handling only WMS 1.3.0 ? 253 if (e.getCause() == null && url.contains("VERSION=1.1.1")) { 254 doAttemptGetCapabilities(serviceUrlStr, new URL(url.replace("VERSION=1.1.1", "VERSION=1.3.0"))); 255 if (serviceUrl.toExternalForm().contains("VERSION=1.1.1")) { 256 serviceUrl = new URL(serviceUrl.toExternalForm().replace("VERSION=1.1.1", "VERSION=1.3.0")); 257 } 258 } else { 259 throw e; 260 } 261 } 244 262 } 245 263
Note:
See TracChangeset
for help on using the changeset viewer.