mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8223892: Improved handling of jar files
Reviewed-by: dfuchs, chegar, michaelm, rhalade, ahgross
This commit is contained in:
parent
8e2b10070e
commit
d6304e88e6
2 changed files with 24 additions and 1 deletions
|
@ -484,6 +484,16 @@ public final class URL implements java.io.Serializable {
|
|||
throw new MalformedURLException(s);
|
||||
}
|
||||
}
|
||||
if ("jar".equalsIgnoreCase(protocol)) {
|
||||
if (handler instanceof sun.net.www.protocol.jar.Handler) {
|
||||
// URL.openConnection() would throw a confusing exception
|
||||
// so generate a better exception here instead.
|
||||
String s = ((sun.net.www.protocol.jar.Handler) handler).checkNestedProtocol(file);
|
||||
if (s != null) {
|
||||
throw new MalformedURLException(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue