File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
spring-core/src/main/java/org/springframework/util Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -341,8 +341,11 @@ public static URL extractArchiveURL(URL jarUrl) throws MalformedURLException {
341
341
342
342
int endIndex = urlFile .indexOf (WAR_URL_SEPARATOR );
343
343
if (endIndex != -1 ) {
344
- // Tomcat's "jar: war:file:...mywar.war*/WEB-INF/lib/myjar.jar!/myentry.txt"
344
+ // Tomcat's "war:file:...mywar.war*/WEB-INF/lib/myjar.jar!/myentry.txt"
345
345
String warFile = urlFile .substring (0 , endIndex );
346
+ if (URL_PROTOCOL_WAR .equals (jarUrl .getProtocol ())) {
347
+ return new URL (warFile );
348
+ }
346
349
int startIndex = warFile .indexOf (WAR_URL_PREFIX );
347
350
if (startIndex != -1 ) {
348
351
return new URL (warFile .substring (startIndex + WAR_URL_PREFIX .length ()));
@@ -356,8 +359,6 @@ public static URL extractArchiveURL(URL jarUrl) throws MalformedURLException {
356
359
/**
357
360
* Create a URI instance for the given URL,
358
361
* replacing spaces with "%20" URI encoding first.
359
- * <p>Furthermore, this method works on JDK 1.4 as well,
360
- * in contrast to the {@code URL.toURI()} method.
361
362
* @param url the URL to convert into a URI instance
362
363
* @return the URI instance
363
364
* @throws URISyntaxException if the URL wasn't a valid URI
You can’t perform that action at this time.
0 commit comments