Changeset 18378 in josm for trunk/src/org
- Timestamp:
- 2022-02-09T22:40:12+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryPatterns.java
r18371 r18378 93 93 static String handleApiKeyTemplate(final String id, final String url) { 94 94 if (id != null && url != null) { 95 try { 96 final String apiKey = FeatureAdapter.retrieveApiKey(id); 97 return PATTERN_API_KEY.matcher(url).replaceAll(apiKey); 98 } catch (IOException | NullPointerException e) { 99 // Match rough behavior in JMapViewer TemplatedTMSTileSource, but with better error message. 100 throw new IllegalArgumentException(tr("Could not retrieve API key for imagery with id={0}. Cannot add layer.", id), e); 95 final Matcher matcher = PATTERN_API_KEY.matcher(url); 96 if (matcher.matches()) { 97 try { 98 final String apiKey = FeatureAdapter.retrieveApiKey(id); 99 return matcher.replaceAll(apiKey); 100 } catch (IOException | NullPointerException e) { 101 // Match rough behavior in JMapViewer TemplatedTMSTileSource, but with better error message. 102 throw new IllegalArgumentException(tr("Could not retrieve API key for imagery with id={0}. Cannot add layer.", id), e); 103 } 101 104 } 102 105 }
Note:
See TracChangeset
for help on using the changeset viewer.