703 |
protected void set(String protocol, String host, int port, String file, |
protected void set(String protocol, String host, int port, String file, |
704 |
String ref) |
String ref) |
705 |
{ |
{ |
706 |
URLStreamHandler protocolHandler = getURLStreamHandler(protocol); |
URLStreamHandler protocolHandler = null; |
707 |
|
protocol = protocol.toLowerCase(); |
708 |
|
if (! this.protocol.equals(protocol)) |
709 |
|
protocolHandler = getURLStreamHandler(protocol); |
710 |
|
|
711 |
// It is an hidden feature of the JDK. If the protocol does not exist, |
// It is an hidden feature of the JDK. If the protocol does not exist, |
712 |
// we keep the previously initialized protocol. |
// we keep the previously initialized protocol. |
713 |
if (protocolHandler != null) |
if (protocolHandler != null) |
714 |
{ |
{ |
715 |
this.ph = protocolHandler; |
this.ph = protocolHandler; |
716 |
this.protocol = protocol.toLowerCase(); |
this.protocol = protocol; |
717 |
} |
} |
718 |
this.authority = ""; |
this.authority = ""; |
719 |
this.port = port; |
this.port = port; |
749 |
protected void set(String protocol, String host, int port, String authority, |
protected void set(String protocol, String host, int port, String authority, |
750 |
String userInfo, String path, String query, String ref) |
String userInfo, String path, String query, String ref) |
751 |
{ |
{ |
752 |
URLStreamHandler protocolHandler = getURLStreamHandler(protocol); |
URLStreamHandler protocolHandler = null; |
753 |
|
protocol = protocol.toLowerCase(); |
754 |
|
if (! this.protocol.equals(protocol)) |
755 |
|
protocolHandler = getURLStreamHandler(protocol); |
756 |
|
|
757 |
// It is an hidden feature of the JDK. If the protocol does not exist, |
// It is an hidden feature of the JDK. If the protocol does not exist, |
758 |
// we keep the previously initialized protocol. |
// we keep the previously initialized protocol. |
759 |
if (protocolHandler != null) |
if (protocolHandler != null) |
760 |
{ |
{ |
761 |
this.ph = protocolHandler; |
this.ph = protocolHandler; |
762 |
this.protocol = protocol.toLowerCase(); |
this.protocol = protocol; |
763 |
} |
} |
764 |
this.host = host; |
this.host = host; |
765 |
this.userInfo = userInfo; |
this.userInfo = userInfo; |