⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 url.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the host name of this <code>URL</code>, if applicable.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#getPath()">getPath</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the path part of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#getPort()">getPort</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the port number of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#getProtocol()">getProtocol</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the protocol name of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#getQuery()">getQuery</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the query part of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#getRef()">getRef</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the anchor (also known as the "reference") of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#getUserInfo()">getUserInfo</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the userInfo part of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#hashCode()">hashCode</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an integer suitable for hash table indexing.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/net/URLConnection.html">URLConnection</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#openConnection()">openConnection</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>URLConnection</code> object that represents a  connection to the remote object referred to by the <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/io/InputStream.html">InputStream</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#openStream()">openStream</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Opens a connection to this <code>URL</code> and returns an  <code>InputStream</code> for reading from that connection.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#sameFile(java.net.URL)">sameFile</A></B>(<A HREF="../../java/net/URL.html">URL</A>&nbsp;other)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares two URLs, excluding the "ref" fields.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)">set</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;protocol,    <A HREF="../../java/lang/String.html">String</A>&nbsp;host,    int&nbsp;port,    <A HREF="../../java/lang/String.html">String</A>&nbsp;file,    <A HREF="../../java/lang/String.html">String</A>&nbsp;ref)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the fields of the URL.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)">set</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;protocol,    <A HREF="../../java/lang/String.html">String</A>&nbsp;host,    int&nbsp;port,    <A HREF="../../java/lang/String.html">String</A>&nbsp;authority,    <A HREF="../../java/lang/String.html">String</A>&nbsp;userInfo,    <A HREF="../../java/lang/String.html">String</A>&nbsp;path,    <A HREF="../../java/lang/String.html">String</A>&nbsp;query,    <A HREF="../../java/lang/String.html">String</A>&nbsp;ref)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the specified 8 fields of the URL.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)">setURLStreamHandlerFactory</A></B>(<A HREF="../../java/net/URLStreamHandlerFactory.html">URLStreamHandlerFactory</A>&nbsp;fac)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets an application's <code>URLStreamHandlerFactory</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#toExternalForm()">toExternalForm</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a string representation of this <code>URL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URL.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a string representation of this <code>URL</code>.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="URL(java.lang.String, java.lang.String, int, java.lang.String)"><!-- --></A><H3>URL</H3><PRE>public <B>URL</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;protocol,           <A HREF="../../java/lang/String.html">String</A>&nbsp;host,           int&nbsp;port,           <A HREF="../../java/lang/String.html">String</A>&nbsp;file)    throws <A HREF="../../java/net/MalformedURLException.html">MalformedURLException</A></PRE><DL><DD>Creates a <code>URL</code> object from the specified  <code>protocol</code>, <code>host</code>, <code>port</code>  number, and <code>file</code>. Specifying a <code>port</code>  number of <code>-1</code> indicates that the URL should use  the default port for the protocol.  <p> If this is the first URL object being created with the specified  protocol, a <i>stream protocol handler</i> object, an instance of  class <code>URLStreamHandler</code>, is created for that protocol: <ol> <li>If the application has previously set up an instance of     <code>URLStreamHandlerFactory</code> as the stream handler factory,     then the <code>createURLStreamHandler</code> method of that instance     is called with the protocol string as an argument to create the     stream protocol handler. <li>If no <code>URLStreamHandlerFactory</code> has yet been set up,     or if the factory's <code>createURLStreamHandler</code> method     returns <code>null</code>, then the constructor finds the      value of the system property:     <blockquote><pre>         java.protocol.handler.pkgs     </pre></blockquote>     If the value of that system property is not <code>null</code>,     it is interpreted as a list of packages separated by a vertical     slash character '<code>|</code>'. The constructor tries to load      the class named:     <blockquote><pre>         &lt;<i>package</i>&gt;.&lt;<i>protocol</i>&gt;.Handler     </pre></blockquote>     where &lt;<i>package</i>&gt; is replaced by the name of the package     and &lt;<i>protocol</i>&gt; is replaced by the name of the protocol.     If this class does not exist, or if the class exists but it is not     a subclass of <code>URLStreamHandler</code>, then the next package     in the list is tried. <li>If the previous step fails to find a protocol handler, then the     constructor tries to load the class named:     <blockquote><pre>         sun.net.www.protocol.&lt;<i>protocol</i>&gt;.Handler     </pre></blockquote>     If this class does not exist, or if the class exists but it is not a     subclass of <code>URLStreamHandler</code>, then a     <code>MalformedURLException</code> is thrown. </ol><DD><DL><DT><B>Parameters:</B><DD><CODE>protocol</CODE> - the name of the protocol to use.<DD><CODE>host</CODE> - the name of the host.<DD><CODE>port</CODE> - the port number on the host.<DD><CODE>file</CODE> - the file on the host<DT><B>Throws:</B><DD><CODE><A HREF="../../java/net/MalformedURLException.html">MalformedURLException</A></CODE> - if an unknown protocol is specified.<DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A>, <A HREF="../../java/net/URL.html#setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)"><CODE>setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)</CODE></A>, <A HREF="../../java/net/URLStreamHandler.html"><CODE>URLStreamHandler</CODE></A>, <A HREF="../../java/net/URLStreamHandlerFactory.html#createURLStreamHandler(java.lang.String)"><CODE>URLStreamHandlerFactory.createURLStreamHandler(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="URL(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>URL</H3><PRE>public <B>URL</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;protocol,           <A HREF="../../java/lang/String.html">String</A>&nbsp;host,           <A HREF="../../java/lang/String.html">String</A>&nbsp;file)    throws <A HREF="../../java/net/MalformedURLException.html">MalformedURLException</A></PRE><DL><DD>Creates a URL from the specified <code>protocol</code>  name, <code>host</code> name, and <code>file</code> name. The  default port for the specified protocol is used.  <p> This method is equivalent to calling the four-argument  constructor with the arguments being <code>protocol</code>,  <code>host</code>, <code>-1</code>, and <code>file</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>protocol</CODE> - the name of the protocol to use.<DD><CODE>host</CODE> - the name of the host.<DD><CODE>file</CODE> - the file on the host.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/net/MalformedURLException.html">MalformedURLException</A></CODE> - if an unknown protocol is specified.<DT><B>See Also: </B><DD><A HREF="../../java/net/URL.html#URL(java.lang.String, java.lang.String, int, java.lang.String)"><CODE>URL(java.lang.String, java.lang.String, int, java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler)"><!-- --></A><H3>URL</H3><PRE>public <B>URL</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;protocol,           <A HREF="../../java/lang/String.html">String</A>&nbsp;host,           int&nbsp;port,           <A HREF="../../java/lang/String.html">String</A>&nbsp;file,           <A HREF="../../java/net/URLStreamHandler.html">URLStreamHandler</A>&nbsp;handler)    throws <A HREF="../../java/net/MalformedURLException.html">MalformedURLException</A></PRE><DL><DD>Creates a <code>URL</code> object from the specified  <code>protocol</code>, <code>host</code>, <code>port</code>  number, <code>file</code>, and <code>handler</code>. Specifying a <code>port</code> number of <code>-1</code> indicates that the URL should use the default port for the protocol. Specifying a <code>handler</code> of <code>null</code> indicates that the URL should use a default stream handler for the protocol, as outlined for:     java.net.URL#URL(java.lang.String, java.lang.String, int,                      java.lang.String)  <p>If the handler is not null and there is a security manager,  the security manager's <code>checkPermission</code> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -