Changeset 13358 in josm for trunk/src/org/openstreetmap/josm/tools/HttpClient.java
- Timestamp:
- 2018-01-26T23:21:57+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r13179 r13358 61 61 private boolean finishOnCloseOutput = true; 62 62 63 // Pattern to detect Tomcat error message. Be careful with change of format: 64 // CHECKSTYLE.OFF: LineLength 65 // https://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?r1=1740707&r2=1779641&pathrev=1779641&diff_format=h 66 // CHECKSTYLE.ON: LineLength 67 private static final Pattern TOMCAT_ERR_MESSAGE = Pattern.compile( 68 ".*<p><b>[^<]+</b>[^<]+</p><p><b>[^<]+</b> (?:<u>)?([^<]*)(?:</u>)?</p><p><b>[^<]+</b> (?:<u>)?[^<]*(?:</u>)?</p>.*", 69 Pattern.CASE_INSENSITIVE); 70 63 71 static { 64 72 CookieHandler.setDefault(new CookieManager()); … … 687 695 } 688 696 } 697 698 /** 699 * Returns a {@link Matcher} against predefined Tomcat error messages. 700 * If it matches, error message can be extracted from {@code group(1)}. 701 * @param data HTML contents to check 702 * @return a {@link Matcher} against predefined Tomcat error messages 703 * @since 13358 704 */ 705 public static Matcher getTomcatErrorMatcher(String data) { 706 return data != null ? TOMCAT_ERR_MESSAGE.matcher(data) : null; 707 } 689 708 }
Note:
See TracChangeset
for help on using the changeset viewer.