Changeset 7434 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-08-20T03:07:15+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r7299 r7434 28 28 import org.openstreetmap.josm.io.IllegalDataException; 29 29 import org.openstreetmap.josm.io.MissingOAuthAccessTokenException; 30 import org.openstreetmap.josm.io.OfflineAccessException; 30 31 import org.openstreetmap.josm.io.OsmApi; 31 32 import org.openstreetmap.josm.io.OsmApiException; … … 496 497 497 498 /** 499 * Explains a {@link OfflineAccessException} which has caused an {@link OsmTransferException}. 500 * This is most likely happening when JOSM tries to access OSM API or JOSM website while in offline mode. 501 * 502 * @param e the exception 503 * @return The HTML formatted error message to display 504 * @since 7434 505 */ 506 public static String explainOfflineAccessException(OsmTransferException e) { 507 OfflineAccessException oae = getNestedException(e, OfflineAccessException.class); 508 Main.error(e); 509 return tr("<html>Failed to download data.<br>" 510 + "<br>Details: {0}</html>", oae.getMessage()); 511 } 512 513 /** 498 514 * Explains a {@link OsmApiException} which was thrown because of an internal server 499 515 * error in the OSM API server.. -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r7401 r7434 30 30 */ 31 31 public WikiReader() { 32 this.baseurl = Main.pref.get("help.baseurl", Main.getJOSMWebsite()); 32 this(Main.pref.get("help.baseurl", Main.getJOSMWebsite())); 33 } 34 35 /** 36 * Returns the base URL of wiki. 37 * @return the base URL of wiki 38 * @since 7434 39 */ 40 public final String getBaseUrlWiki() { 41 return baseurl + "/wiki/"; 33 42 } 34 43 … … 46 55 try (BufferedReader in = Utils.openURLReader(u)) { 47 56 boolean txt = url.endsWith("?format=txt"); 48 if (url.startsWith( baseurl) && !txt)57 if (url.startsWith(getBaseUrlWiki()) && !txt) 49 58 return readFromTrac(in, u); 50 59 return readNormal(in, !txt); … … 64 73 languageCode = LanguageInfo.getWikiLanguagePrefix(LocaleType.DEFAULTNOTENGLISH); 65 74 if(languageCode != null) { 66 res = readLang(new URL( baseurl + "/wiki/"+ languageCode + text));75 res = readLang(new URL(getBaseUrlWiki() + languageCode + text)); 67 76 } 68 77 … … 70 79 languageCode = LanguageInfo.getWikiLanguagePrefix(LocaleType.BASELANGUAGE); 71 80 if(languageCode != null) { 72 res = readLang(new URL( baseurl + "/wiki/"+ languageCode + text));81 res = readLang(new URL(getBaseUrlWiki() + languageCode + text)); 73 82 } 74 83 } … … 77 86 languageCode = LanguageInfo.getWikiLanguagePrefix(LocaleType.ENGLISH); 78 87 if(languageCode != null) { 79 res = readLang(new URL( baseurl + "/wiki/"+ languageCode + text));88 res = readLang(new URL(getBaseUrlWiki() + languageCode + text)); 80 89 } 81 90 }
Note:
See TracChangeset
for help on using the changeset viewer.