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

📄 url.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getRef</B>()</PRE><DL><DD>Returns the anchor (also known as the "reference") of this <code>URL</code>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the anchor (also known as the "reference") of this          <code>URL</code>.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Compares two URLs.  The result is <code>true</code> if and only if the argument is not <code>null</code> and is a <code>URL</code> object that represents the same <code>URL</code> as this object. Two URL objects are equal if they have the same protocol and reference the same host, the same port number on the host, and the same file and anchor on the host.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the URL to compare against.<DT><B>Returns:</B><DD><code>true</code> if the objects are the same;          <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Creates an integer suitable for hash table indexing.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a hash code for this <code>URL</code>.</DL></DD></DL><HR><A NAME="sameFile(java.net.URL)"><!-- --></A><H3>sameFile</H3><PRE>public boolean <B>sameFile</B>(<A HREF="../../java/net/URL.html">URL</A>&nbsp;other)</PRE><DL><DD>Compares two URLs, excluding the "ref" fields. Returns <code>true</code> if this <code>URL</code> and the  <code>other</code> argument both refer to the same resource. The two <code>URL</code>s might not both contain the same anchor.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>other</CODE> - the <code>URL</code> to compare against.<DT><B>Returns:</B><DD><code>true</code> if they reference the same remote object;          <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Constructs a string representation of this <code>URL</code>. The  string is created by calling the <code>toExternalForm</code>  method of the stream protocol handler for this object.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this object.<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>, <A HREF="../../java/net/URLStreamHandler.html#toExternalForm(java.net.URL)"><CODE>URLStreamHandler.toExternalForm(java.net.URL)</CODE></A></DL></DD></DL><HR><A NAME="toExternalForm()"><!-- --></A><H3>toExternalForm</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toExternalForm</B>()</PRE><DL><DD>Constructs a string representation of this <code>URL</code>. The  string is created by calling the <code>toExternalForm</code>  method of the stream protocol handler for this object.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this object.<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>, <A HREF="../../java/net/URLStreamHandler.html#toExternalForm(java.net.URL)"><CODE>URLStreamHandler.toExternalForm(java.net.URL)</CODE></A></DL></DD></DL><HR><A NAME="openConnection()"><!-- --></A><H3>openConnection</H3><PRE>public <A HREF="../../java/net/URLConnection.html">URLConnection</A> <B>openConnection</B>()                             throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Returns a <code>URLConnection</code> object that represents a  connection to the remote object referred to by the <code>URL</code>. <p>A new connection is opened every time by calling the <code>openConnection</code> method of the protocol handler for this URL. <p>If for the URL's protocol (such as HTTP or JAR), there exists a public, specialized URLConnection subclass belonging to one of the following packages or one of their subpackages: java.lang, java.io, java.util, java.net, the connection returned will be of that subclass. For example, for HTTP an HttpURLConnection will be returned, and for JAR a JarURLConnection will be returned.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>URLConnection</code> to the URL.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O exception occurs.<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>, <A HREF="../../java/net/URLConnection.html"><CODE>URLConnection</CODE></A>, <A HREF="../../java/net/URLStreamHandler.html#openConnection(java.net.URL)"><CODE>URLStreamHandler.openConnection(java.net.URL)</CODE></A></DL></DD></DL><HR><A NAME="openStream()"><!-- --></A><H3>openStream</H3><PRE>public final <A HREF="../../java/io/InputStream.html">InputStream</A> <B>openStream</B>()                             throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Opens a connection to this <code>URL</code> and returns an  <code>InputStream</code> for reading from that connection. This  method is a shorthand for: <blockquote><pre>     openConnection().getInputStream() </pre></blockquote><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an input stream for reading from the URL connection.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O exception occurs.<DT><B>See Also: </B><DD><A HREF="../../java/net/URL.html#openConnection()"><CODE>openConnection()</CODE></A>, <A HREF="../../java/net/URLConnection.html#getInputStream()"><CODE>URLConnection.getInputStream()</CODE></A></DL></DD></DL><HR><A NAME="getContent()"><!-- --></A><H3>getContent</H3><PRE>public final <A HREF="../../java/lang/Object.html">Object</A> <B>getContent</B>()                        throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Returns the contents of this URL. This method is a shorthand for: <blockquote><pre>     openConnection().getContent() </pre></blockquote><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the contents of this URL.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O exception occurs.<DT><B>See Also: </B><DD><A HREF="../../java/net/URLConnection.html#getContent()"><CODE>URLConnection.getContent()</CODE></A></DL></DD></DL><HR><A NAME="getContent(java.lang.Class[])"><!-- --></A><H3>getContent</H3><PRE>public final <A HREF="../../java/lang/Object.html">Object</A> <B>getContent</B>(<A HREF="../../java/lang/Class.html">Class</A>[]&nbsp;classes)                        throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Returns the contents of this URL. This method is a shorthand for: <blockquote><pre>     openConnection().getContent(Class[]) </pre></blockquote><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the content object of this URL that is the first match of               the types specified in the classes array.               null if none of the requested types are supported.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O exception occurs.<DT><B>See Also: </B><DD><A HREF="../../java/net/URLConnection.html#getContent(java.lang.Class[])"><CODE>URLConnection.getContent(Class[])</CODE></A></DL></DD></DL><HR><A NAME="setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)"><!-- --></A><H3>setURLStreamHandlerFactory</H3><PRE>public static void <B>setURLStreamHandlerFactory</B>(<A HREF="../../java/net/URLStreamHandlerFactory.html">URLStreamHandlerFactory</A>&nbsp;fac)</PRE><DL><DD>Sets an application's <code>URLStreamHandlerFactory</code>. This method can be called at most once in a given Java Virtual Machine.<p> The <code>URLStreamHandlerFactory</code> instance is used toconstruct a stream protocol handler from a protocol name.  <p> If there is a security manager, this method first calls the security manager's <code>checkSetFactory</code> method  to ensure the operation is allowed.  This could result in a SecurityException.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>fac</CODE> - the desired factory.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/Error.html">Error</A></CODE> - if the application has already set a factory.<DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its               <code>checkSetFactory</code> method doesn't allow the operation.<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>, <A HREF="../../java/net/URLStreamHandlerFactory.html"><CODE>URLStreamHandlerFactory</CODE></A>, <A HREF="../../java/lang/SecurityManager.html#checkSetFactory()"><CODE>SecurityManager.checkSetFactory()</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/URL.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/net/SocketPermission.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/net/URLClassLoader.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="URL.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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