Creates a URLName object from the specified protocol, host, port number, file, username, and password. Specifying a port number of -1 indicates that the URL should use the default port for the protocol. @param protocol the protocol @param host the host name @param port the port number @param file
( String protocol, String host, int port, String file, String username, String password )
| 120 | * @param password the password |
| 121 | */ |
| 122 | public URLName( |
| 123 | String protocol, |
| 124 | String host, |
| 125 | int port, |
| 126 | String file, |
| 127 | String username, |
| 128 | String password |
| 129 | ) |
| 130 | { |
| 131 | this.protocol = protocol; |
| 132 | this.host = host; |
| 133 | this.port = port; |
| 134 | int refStart; |
| 135 | if (file != null && (refStart = file.indexOf('#')) != -1) { |
| 136 | this.file = file.substring(0, refStart); |
| 137 | this.ref = file.substring(refStart + 1); |
| 138 | } else { |
| 139 | this.file = file; |
| 140 | this.ref = null; |
| 141 | } |
| 142 | this.username = doEncode ? encode(username) : username; |
| 143 | this.password = doEncode ? encode(password) : password; |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Construct a URLName from a java.net.URL object. |
nothing calls this directly
no test coverage detected