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

📄 classloader.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<A NAME="getResources(java.lang.String)"><!-- --></A><H3>getResources</H3><PRE>public final <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>getResources</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)                               throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Finds all the resources with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.<p> The name of a resource is a "/"-separated path name that identifies the resource.<p> The search order is described in the documentation for <A HREF="../../java/lang/ClassLoader.html#getResource(java.lang.String)"><CODE>getResource(String)</CODE></A>.<p><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - resource name<DT><B>Returns:</B><DD>an enumeration of URL to the resource. If no resources could         be found, the enumeration will be empty. Resources that the          doesn't have access to will not be in the enumeration.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if I/O errors occur<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/ClassLoader.html#getResource(java.lang.String)"><CODE>getResource(java.lang.String)</CODE></A>, <A HREF="../../java/lang/ClassLoader.html#findResources(java.lang.String)"><CODE>findResources(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="findResources(java.lang.String)"><!-- --></A><H3>findResources</H3><PRE>protected <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>findResources</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)                             throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Returns an Enumeration of URLs representing all the resources with the given name. Class loader implementations should override this method to specify where to load resources from.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the resource name<DT><B>Returns:</B><DD>an Enumeration of URLs for the resources<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if I/O errors occur<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="findResource(java.lang.String)"><!-- --></A><H3>findResource</H3><PRE>protected <A HREF="../../java/net/URL.html">URL</A> <B>findResource</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)</PRE><DL><DD>Finds the resource with the given name. Class loader implementations should override this method to specify where to find resources.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the resource name<DT><B>Returns:</B><DD>a URL for reading the resource, or <code>null</code>         if the resource could not be found<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="getSystemResource(java.lang.String)"><!-- --></A><H3>getSystemResource</H3><PRE>public static <A HREF="../../java/net/URL.html">URL</A> <B>getSystemResource</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)</PRE><DL><DD>Find a resource of the specified name from the search path used to load classes.<p> In JDK1.1, the search path used is that of the virtual machine's built-in class loader.<p> Since the Java 2 SDK v1.2, this method locates the resource through the system class loader (see <A HREF="../../java/lang/ClassLoader.html#getSystemClassLoader()"><CODE>getSystemClassLoader()</CODE></A>).<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the resource name<DT><B>Returns:</B><DD>a URL for reading the resource, or <code>null</code> if         the resource could not be found<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="getSystemResources(java.lang.String)"><!-- --></A><H3>getSystemResources</H3><PRE>public static <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>getSystemResources</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)                                      throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Finds all resources of the specified name from the search path used to load classes. The resources thus found are returned as an <code>Enumeration</code> of <code>URL</code> objects. <p> The search order is described in the documentation for <A HREF="../../java/lang/ClassLoader.html#getSystemResource(java.lang.String)"><CODE>getSystemResource(String)</CODE></A>. <p><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the resource name<DT><B>Returns:</B><DD>an enumeration of resource URLs<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if I/O errors occur<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="getResourceAsStream(java.lang.String)"><!-- --></A><H3>getResourceAsStream</H3><PRE>public <A HREF="../../java/io/InputStream.html">InputStream</A> <B>getResourceAsStream</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)</PRE><DL><DD>Returns an input stream for reading the specified resource. The search order is described in the documentation for <A HREF="../../java/lang/ClassLoader.html#getResource(java.lang.String)"><CODE>getResource(String)</CODE></A>.<p><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the resource name<DT><B>Returns:</B><DD>an input stream for reading the resource, or <code>null</code>         if the resource could not be found<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="getSystemResourceAsStream(java.lang.String)"><!-- --></A><H3>getSystemResourceAsStream</H3><PRE>public static <A HREF="../../java/io/InputStream.html">InputStream</A> <B>getSystemResourceAsStream</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)</PRE><DL><DD>Open for reading, a resource of the specified name from the search path used to load classes.<p> The search order is described in the documentation for <A HREF="../../java/lang/ClassLoader.html#getSystemResource(java.lang.String)"><CODE>getSystemResource(String)</CODE></A>. <p><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the resource name<DT><B>Returns:</B><DD>an input stream for reading the resource, or <code>null</code> 	       if the resource could not be found<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="getSystemClassLoader()"><!-- --></A><H3>getSystemClassLoader</H3><PRE>public static <A HREF="../../java/lang/ClassLoader.html">ClassLoader</A> <B>getSystemClassLoader</B>()</PRE><DL><DD>Returns the system class loader for delegation. This is the default delegation parent for new <code>ClassLoader</code> instances, and is typically the class loader used to start the application. <p> If a security manager is present, and the caller's class loader is not null and the caller's class loader is not the same as or an ancestor of the system class loader, then this method calls the security manager's <code>checkPermission</code>  method with a <code>RuntimePermission("getClassLoader")</code>  permission to ensure it's ok to access the system class loader. If not, a <code>SecurityException</code> will be thrown.<DD><DL><DT><B>Returns:</B><DD>the system <code>ClassLoader</code> for delegation, or         <code>null</code> if none<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its         <code>checkPermission</code> method doesn't allow         access to the system class loader.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>SecurityManager.checkPermission(java.security.Permission)</CODE></A>, <A HREF="../../java/lang/RuntimePermission.html"><CODE>RuntimePermission</CODE></A></DL></DD></DL><HR><A NAME="definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL)"><!-- --></A><H3>definePackage</H3><PRE>protected <A HREF="../../java/lang/Package.html">Package</A> <B>definePackage</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name,                                <A HREF="../../java/lang/String.html">String</A>&nbsp;specTitle,                                <A HREF="../../java/lang/String.html">String</A>&nbsp;specVersion,                                <A HREF="../../java/lang/String.html">String</A>&nbsp;specVendor,                                <A HREF="../../java/lang/String.html">String</A>&nbsp;implTitle,                                <A HREF="../../java/lang/String.html">String</A>&nbsp;implVersion,                                <A HREF="../../java/lang/String.html">String</A>&nbsp;implVendor,                                <A HREF="../../java/net/URL.html">URL</A>&nbsp;sealBase)                         throws <A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></PRE><DL><DD>Defines a package by name in this ClassLoader. This allows class loaders to define the packages for their classes. Packages must be created before the class is defined, and package names must be unique within a class loader and cannot be redefined or changed once created.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the package name<DD><CODE>specTitle</CODE> - the specification title<DD><CODE>specVersion</CODE> - the specification version<DD><CODE>specVendor</CODE> - the specification vendor<DD><CODE>implTitle</CODE> - the implementation title<DD><CODE>implVersion</CODE> - the implementation version<DD><CODE>implVendor</CODE> - the implementation vendor<DD><CODE>sealBase</CODE> - If not null, then this package is sealed with                    respect to the given code source URL. Otherwise,			  the package is not sealed.<DT><B>Returns:</B><DD>the newly defined <code>Package</code> object<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if package name duplicates an            existing package either in this class loader or one of            its ancestors<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="getPackage(java.lang.String)"><!-- --></A><H3>getPackage</H3><PRE>protected <A HREF="../../java/lang/Package.html">Package</A> <B>getPackage</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;name)</PRE><DL><DD>Returns a Package that has been defined by this class loader or any of its ancestors.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the package name<DT><B>Returns:</B><DD>the Package corresponding to the given name, or null if not         found<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="getPackages()"><!-- --></A><H3>getPackages</H3><PRE>protected <A HREF="../../java/lang/Package.html">Package</A>[] <B>getPackages</B>()</PRE><DL><DD>Returns all of the Packages defined by this class loader and its ancestors.<DD><DL><DT><B>Returns:</B><DD>the array of <code>Package</code> objects defined by this <code>ClassLoader</code><DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="findLibrary(java.lang.String)"><!-- --></A><H3>findLibrary</H3><PRE>protected <A HREF="../../java/lang/String.html">String</A> <B>findLibrary</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;libname)</PRE><DL><DD>Returns the absolute path name of a native library. The VM invokes this method to locate the native libraries that belong to classes loaded with this class loader. If this method returns <code>null</code>, the VM searches the library along the path specified as the <code>java.library.path</code> property.<DD><DL><DT><B>Parameters:</B><DD><CODE>libname</CODE> - the library name<DT><B>Returns:</B><DD>the absolute path of the native library<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#loadLibrary(java.lang.String)"><CODE>System.loadLibrary(java.lang.String)</CODE></A>, <A HREF="../../java/lang/System.html#mapLibraryName(java.lang.String)"><CODE>System.mapLibraryName(java.lang.String)</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/ClassLoader.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/lang/Class.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/lang/Compiler.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="ClassLoader.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 + -