Lines Matching defs:protocol

70  * In general, attempts to create URLs with any other protocol will fail with a
73 * java.protocol.handler.pkgs} system property.
75 * <p>The {@link URI} class can be used to manipulate URLs of any protocol.
86 private String protocol;
136 * URL or has an unsupported protocol.
148 * protocol's default stream handler.
150 * be parsed as a URL or an invalid protocol has been found.
161 protocol = UrlUtils.getSchemePrefix(spec);
162 int schemeSpecificPartStart = protocol != null ? (protocol.length() + 1) : 0;
164 // If the context URL has a different protocol, discard it because we can't use it.
165 if (protocol != null && context != null && !protocol.equals(context.protocol)) {
171 set(context.protocol, context.getHost(), context.getPort(), context.getAuthority(),
177 } else if (protocol == null) {
184 throw new MalformedURLException("Unknown protocol: " + protocol);
198 * protocol's default port.
201 * represent a valid URL or if the protocol is invalid.
203 public URL(String protocol, String host, String file) throws MalformedURLException {
204 this(protocol, host, -1, file, null);
209 * protocol's default port.
212 * @param port the port, or {@code -1} for the protocol's default port.
215 * represent a valid URL or if the protocol is invalid.
217 public URL(String protocol, String host, int port, String file) throws MalformedURLException {
218 this(protocol, host, port, file, null);
223 * protocol's default port.
226 * @param port the port, or {@code -1} for the protocol's default port.
229 * protocol's default stream handler.
231 * represent a valid URL or if the protocol is invalid.
233 public URL(String protocol, String host, int port, String file,
238 if (protocol == null) {
239 throw new NullPointerException("protocol == null");
247 this.protocol = protocol;
266 // receiver's protocol if the handler was null.
270 throw new MalformedURLException("Unknown protocol: " + protocol);
307 protected void set(String protocol, String host, int port, String file, String ref) {
308 if (this.protocol == null) {
309 this.protocol = protocol;
321 * the same protocol, host, port, file, and reference.
377 * protocol.
387 // the requested protocol.
388 streamHandler = streamHandlers.get(protocol);
396 streamHandler = streamHandlerFactory.createURLStreamHandler(protocol);
398 streamHandlers.put(protocol, streamHandler);
405 String packageList = System.getProperty("java.protocol.handler.pkgs");
409 String className = packageName + "." + protocol + ".Handler";
414 streamHandlers.put(protocol, streamHandler);
425 if (protocol.equals("file")) {
427 } else if (protocol.equals("ftp")) {
429 } else if (protocol.equals("http")) {
431 } else if (protocol.equals("https")) {
433 } else if (protocol.equals("jar")) {
437 streamHandlers.put(protocol, streamHandler);
481 * @throws UnsupportedOperationException if the protocol handler does not
508 throw new IllegalStateException(protocol);
528 return "unknown protocol(" + protocol + ")://" + host + file;
552 throw new IOException("Unknown protocol: " + protocol);
566 return URI.getEffectivePort(protocol, port);
570 * Returns the protocol of this URL like "http" or "file". This is also
574 return protocol;
611 * Returns the default port number of the protocol used by this URL. If no
612 * default port is defined by the protocol or the {@code URLStreamHandler},
655 protected void set(String protocol, String host, int port, String authority, String userInfo,
661 set(protocol, host, port, file, ref);