Home | History | Annotate | Download | only in net

Lines Matching refs:protocol

59  * The URL above indicates that the protocol to use is
60 * {@code http} (HyperText Transfer Protocol) and that the
64 * meaning of this name on the host machine is both protocol
72 * the protocol is used instead. For example, the default port for
117 * the protocol, host name, or port number is missing, the value is
147 // static final String BUILTIN_HANDLERS_PREFIX = "sun.net.www.protocol";
153 * for protocol handlers. The value of this property (if any) should
155 * for a protocol handler to load. The policy of this class is that
156 * all protocol handlers will be in a class called <protocolname>.Handler,
159 * default package prefix, sun.net.www.protocol, is used. The search
163 private static final String protocolPathProp = "java.protocol.handler.pkgs";
166 * The protocol to use (ftp, http, nntp, ... etc.) .
169 private String protocol;
178 * The protocol port to connect to.
237 * {@code protocol}, {@code host}, {@code port}
251 * protocol.<p>
254 * protocol, a <i>stream protocol handler</i> object, an instance of
255 * class {@code URLStreamHandler}, is created for that protocol:
260 * is called with the protocol string as an argument to create the
261 * stream protocol handler.
267 * java.protocol.handler.pkgs
274 * &lt;<i>package</i>&gt;.&lt;<i>protocol</i>&gt;.Handler
277 * and &lt;<i>protocol</i>&gt; is replaced by the name of the protocol.
281 * <li>If the previous step fails to find a protocol handler, then the
284 * &lt;<i>system default package</i>&gt;.&lt;<i>protocol</i>&gt;.Handler
291 * <p>Protocol handlers for the following protocols are guaranteed
296 * Protocol handlers for additional protocols may also be
301 * @param protocol the name of the protocol to use.
305 * @exception MalformedURLException if an unknown protocol is specified.
313 public URL(String protocol, String host, int port, String file)
316 this(protocol, host, port, file, null);
320 * Creates a URL from the specified {@code protocol}
322 * default port for the specified protocol is used.
325 * constructor with the arguments being {@code protocol},
330 * @param protocol the name of the protocol to use.
333 * @exception MalformedURLException if an unknown protocol is specified.
337 public URL(String protocol, String host, String file)
339 this(protocol, host, -1, file);
344 * {@code protocol}, {@code host}, {@code port}
347 * the URL should use the default port for the protocol. Specifying
349 * should use a default stream handler for the protocol, as outlined
362 * @param protocol the name of the protocol to use.
367 * @exception MalformedURLException if an unknown protocol is specified.
381 public URL(String protocol, String host, int port, String file,
391 protocol = protocol
392 this.protocol = protocol;
428 (handler = getURLStreamHandler(protocol)) == null) {
429 throw new MalformedURLException("unknown protocol: " + protocol);
442 * @exception MalformedURLException if no protocol is specified, or an
443 * unknown protocol is found, or {@code spec} is {@code null}.
489 * @exception MalformedURLException if no protocol is specified, or an
490 * unknown protocol is found, or {@code spec} is {@code null}.
509 * @exception MalformedURLException if no protocol is specified, or an
510 * unknown protocol is found, or {@code spec} is {@code null}.
572 protocol = newProtocol;
574 newProtocol.equalsIgnoreCase(context.protocol))) {
575 // inherit the protocol handler from the context
589 protocol = context.protocol;
600 if (protocol == null) {
601 throw new MalformedURLException("no protocol: "+original);
604 // Get the protocol handler if not specified or the protocol
607 (handler = getURLStreamHandler(protocol)) == null) {
608 throw new MalformedURLException("unknown protocol: "+protocol);
642 * Returns true if specified string is a valid protocol name.
644 private boolean isValidProtocol(String protocol) {
645 int len = protocol.length();
648 char c = protocol.charAt(0);
652 c = protocol.charAt(i);
673 * @param protocol the name of the protocol to use
679 void set(String protocol, String host, int port,
682 this.protocol = protocol;
706 * @param protocol the name of the protocol to use
716 void set(String protocol, String host, int port,
720 this.protocol = protocol;
791 * Gets the default port number of the protocol associated
804 * Gets the protocol name of this {@code URL}.
806 * @return the protocol of this {@code URL}.
809 return protocol;
857 * Two URL objects are equal if they have the same protocol, reference
862 * the same protocol, host, port, file, and reference.
934 * method of the stream protocol handler for this object.
948 * method of the stream protocol handler for this object.
984 * URLStreamHandler.openConnection(URL)} method of the protocol handler for
991 * <P>If for the URL's protocol (such as HTTP or JAR), there
1011 * made through the specified proxy; Protocol handlers that do not
1029 * implements the protocol handler doesn't support
1119 *construct a stream protocol handler from a protocol name.
1151 * A table of protocol handlers.
1158 * @param protocol the protocol to use
1160 static URLStreamHandler getURLStreamHandler(String protocol) {
1162 URLStreamHandler handler = handlers.get(protocol);
1169 handler = factory.createURLStreamHandler(protocol);
1173 // Try java protocol handler
1188 packagePrefixList += "sun.net.www.protocol";
1201 String clsName = packagePrefix + "." + protocol +
1229 handler = createBuiltinHandler(protocol);
1242 handler2 = handlers.get(protocol);
1251 handler2 = factory.createURLStreamHandler(protocol);
1263 handlers.put(protocol, handler);
1275 * Returns an instance of the built-in handler for the given protocol, or null if none exists.
1277 private static URLStreamHandler createBuiltinHandler(String protocol)
1280 if (protocol.equals("file")) {
1281 handler = new sun.net.www.protocol.file.Handler();
1282 } else if (protocol.equals("ftp")) {
1283 handler = new sun.net.www.protocol.ftp.Handler();
1284 } else if (protocol.equals("jar")) {
1285 handler = new sun.net.www.protocol.jar.Handler();
1286 } else if (protocol.equals("http")) {
1289 } else if (protocol.equals("https")) {
1300 result.add("sun.net.www.protocol.file.Handler");
1301 result.add("sun.net.www.protocol.ftp.Handler");
1302 result.add("sun.net.www.protocol.jar.Handler");
1310 * @serialField protocol String
1326 new ObjectStreamField("protocol", String.class),
1343 * the protocol variable returns a valid URLStreamHandler and
1360 String protocol = (String)gf.get("protocol", null);
1361 if (getURLStreamHandler(protocol) == null) {
1362 throw new IOException("unknown protocol: " + protocol);
1378 tempState = new UrlDeserializedState(protocol, host, port, authority,
1409 String protocol = tempState.getProtocol();
1452 this.protocol = protocol;
1488 // Android-changed: Some built-in handlers (eg. HttpHandler) are not in sun.net.www.protocol.
1494 this.protocol = null;
1551 private final String protocol;
1559 public UrlDeserializedState(String protocol,
1563 this.protocol = protocol;
1573 return protocol;
1603 int len = protocol.length() + 1;
1612 result.append(protocol);