Lines Matching defs:protocol

68  * In general, attempts to create URLs with any other protocol will fail with a
71 * java.protocol.handler.pkgs} system property.
73 * <p>The {@link URI} class can be used to manipulate URLs of any protocol.
84 private String protocol;
134 * URL or has an unsupported protocol.
146 * protocol's default stream handler.
148 * be parsed as a URL or an invalid protocol has been found.
159 protocol = UrlUtils.getSchemePrefix(spec);
160 int schemeSpecificPartStart = protocol != null ? (protocol.length() + 1) : 0;
162 // If the context URL has a different protocol, discard it because we can't use it.
163 if (protocol != null && context != null && !protocol.equals(context.protocol)) {
169 set(context.protocol, context.getHost(), context.getPort(), context.getAuthority(),
175 } else if (protocol == null) {
182 throw new MalformedURLException("Unknown protocol: " + protocol);
196 * protocol's default port.
199 * represent a valid URL or if the protocol is invalid.
201 public URL(String protocol, String host, String file) throws MalformedURLException {
202 this(protocol, host, -1, file, null);
207 * protocol's default port.
210 * @param port the port, or {@code -1} for the protocol's default port.
213 * represent a valid URL or if the protocol is invalid.
215 public URL(String protocol, String host, int port, String file) throws MalformedURLException {
216 this(protocol, host, port, file, null);
221 * protocol's default port.
224 * @param port the port, or {@code -1} for the protocol's default port.
227 * protocol's default stream handler.
229 * represent a valid URL or if the protocol is invalid.
231 public URL(String protocol, String host, int port, String file,
236 if (protocol == null) {
237 throw new NullPointerException("protocol == null");
245 this.protocol = protocol;
264 // receiver's protocol if the handler was null.
268 throw new MalformedURLException("Unknown protocol: " + protocol);
305 protected void set(String protocol, String host, int port, String file, String ref) {
306 if (this.protocol == null) {
307 this.protocol = protocol;
319 * the same protocol, host, port, file, and reference.
375 * protocol.
385 // the requested protocol.
386 streamHandler = streamHandlers.get(protocol);
394 streamHandler = streamHandlerFactory.createURLStreamHandler(protocol);
396 streamHandlers.put(protocol, streamHandler);
403 String packageList = System.getProperty("java.protocol.handler.pkgs");
407 String className = packageName + "." + protocol + ".Handler";
412 streamHandlers.put(protocol, streamHandler);
423 if (protocol.equals("file")) {
425 } else if (protocol.equals("ftp")) {
427 } else if (protocol.equals("http")) {
434 } else if (protocol.equals("https")) {
441 } else if (protocol.equals("jar")) {
445 streamHandlers.put(protocol, streamHandler);
489 * @throws UnsupportedOperationException if the protocol handler does not
516 throw new IllegalStateException(protocol);
536 return "unknown protocol(" + protocol + ")://" + host + file;
560 throw new IOException("Unknown protocol: " + protocol);
574 return URI.getEffectivePort(protocol, port);
578 * Returns the protocol of this URL like "http" or "file". This is also
582 return protocol;
619 * Returns the default port number of the protocol used by this URL. If no
620 * default port is defined by the protocol or the {@code URLStreamHandler},
663 protected void set(String protocol, String host, int port, String authority, String userInfo,
669 set(protocol, host, port, file, ref);