Name: dfC67450 Date: 09/03/99
The method setURL(URL, String, String, int, String, String, String, String, String)
of URLStreamHandler does not allow to change the protocol name.
Its source:
protected void setURL(URL u, String protocol, String host, int port,
String authority, String userInfo, String path,
String query, String ref) {
if (this != u.handler) {
throw new SecurityException("handler for url different from " +
"this handler");
}
// ensure that no one can reset the protocol on a given URL.
u.set(u.getProtocol(), host, port, authority, userInfo, path, query, ref);
}
But doc for both URLStreamHandler and URL is silent about this feature.
======================================================================
- duplicates
-
JDK-4232053 URLStreamHandler.setURL docs are incomplete
- Resolved