📄 urlclassloader.html
字号:
Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../java/security/PermissionCollection.html">PermissionCollection</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URLClassLoader.html#getPermissions(java.security.CodeSource)">getPermissions</A></B>(<A HREF="../../java/security/CodeSource.html">CodeSource</A> codesource)</CODE><BR> Returns the permissions for the given codesource object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/net/URL.html">URL</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URLClassLoader.html#getURLs()">getURLs</A></B>()</CODE><BR> Returns the search path of URLs for loading classes and resources.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/net/URLClassLoader.html">URLClassLoader</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URLClassLoader.html#newInstance(java.net.URL[])">newInstance</A></B>(<A HREF="../../java/net/URL.html">URL</A>[] urls)</CODE><BR> Creates a new instance of URLClassLoader for the specified URLs and default parent class loader.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/net/URLClassLoader.html">URLClassLoader</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/net/URLClassLoader.html#newInstance(java.net.URL[], java.lang.ClassLoader)">newInstance</A></B>(<A HREF="../../java/net/URL.html">URL</A>[] urls, <A HREF="../../java/lang/ClassLoader.html">ClassLoader</A> parent)</CODE><BR> Creates a new instance of URLClassLoader for the specified URLs and parent class loader.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.security.SecureClassLoader"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.security.<A HREF="../../java/security/SecureClassLoader.html">SecureClassLoader</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/security/SecureClassLoader.html#defineClass(java.lang.String, byte[], int, int, java.security.CodeSource)">defineClass</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.ClassLoader"><!-- --></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/ClassLoader.html">ClassLoader</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/ClassLoader.html#defineClass(byte[], int, int)">defineClass</A>, <A HREF="../../java/lang/ClassLoader.html#defineClass(java.lang.String, byte[], int, int)">defineClass</A>, <A HREF="../../java/lang/ClassLoader.html#defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain)">defineClass</A>, <A HREF="../../java/lang/ClassLoader.html#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)">definePackage</A>, <A HREF="../../java/lang/ClassLoader.html#findLibrary(java.lang.String)">findLibrary</A>, <A HREF="../../java/lang/ClassLoader.html#findLoadedClass(java.lang.String)">findLoadedClass</A>, <A HREF="../../java/lang/ClassLoader.html#findSystemClass(java.lang.String)">findSystemClass</A>, <A HREF="../../java/lang/ClassLoader.html#getPackage(java.lang.String)">getPackage</A>, <A HREF="../../java/lang/ClassLoader.html#getPackages()">getPackages</A>, <A HREF="../../java/lang/ClassLoader.html#getParent()">getParent</A>, <A HREF="../../java/lang/ClassLoader.html#getResource(java.lang.String)">getResource</A>, <A HREF="../../java/lang/ClassLoader.html#getResourceAsStream(java.lang.String)">getResourceAsStream</A>, <A HREF="../../java/lang/ClassLoader.html#getResources(java.lang.String)">getResources</A>, <A HREF="../../java/lang/ClassLoader.html#getSystemClassLoader()">getSystemClassLoader</A>, <A HREF="../../java/lang/ClassLoader.html#getSystemResource(java.lang.String)">getSystemResource</A>, <A HREF="../../java/lang/ClassLoader.html#getSystemResourceAsStream(java.lang.String)">getSystemResourceAsStream</A>, <A HREF="../../java/lang/ClassLoader.html#getSystemResources(java.lang.String)">getSystemResources</A>, <A HREF="../../java/lang/ClassLoader.html#loadClass(java.lang.String)">loadClass</A>, <A HREF="../../java/lang/ClassLoader.html#loadClass(java.lang.String, boolean)">loadClass</A>, <A HREF="../../java/lang/ClassLoader.html#resolveClass(java.lang.Class)">resolveClass</A>, <A HREF="../../java/lang/ClassLoader.html#setSigners(java.lang.Class, java.lang.Object[])">setSigners</A></CODE></TD></TR></TABLE> <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#equals(java.lang.Object)">equals</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#hashCode()">hashCode</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#toString()">toString</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> <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="URLClassLoader(java.net.URL[], java.lang.ClassLoader)"><!-- --></A><H3>URLClassLoader</H3><PRE>public <B>URLClassLoader</B>(<A HREF="../../java/net/URL.html">URL</A>[] urls, <A HREF="../../java/lang/ClassLoader.html">ClassLoader</A> parent)</PRE><DL><DD>Constructs a new URLClassLoader for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader. Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file which will be downloaded and opened as needed. <p>If there is a security manager, this method first calls the security manager's <code>checkCreateClassLoader</code> method to ensure creation of a class loader is allowed.<DD><DL><DT><B>Parameters:</B><DD><CODE>urls</CODE> - the URLs from which to load classes and resources<DD><CODE>parent</CODE> - the parent class loader for delegation<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its <code>checkCreateClassLoader</code> method doesn't allow creation of a class loader.<DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkCreateClassLoader()"><CODE>SecurityManager.checkCreateClassLoader()</CODE></A></DL></DD></DL><HR><A NAME="URLClassLoader(java.net.URL[])"><!-- --></A><H3>URLClassLoader</H3><PRE>public <B>URLClassLoader</B>(<A HREF="../../java/net/URL.html">URL</A>[] urls)</PRE><DL><DD>Constructs a new URLClassLoader for the specified URLs using the default delegation parent <code>ClassLoader</code>. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader. Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file which will be downloaded and opened as needed. <p>If there is a security manager, this method first calls the security manager's <code>checkCreateClassLoader</code> method to ensure creation of a class loader is allowed.<DD><DL><DT><B>Parameters:</B><DD><CODE>urls</CODE> - the URLs from which to load classes and resources<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its <code>checkCreateClassLoader</code> method doesn't allow creation of a class loader.<DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkCreateClassLoader()"><CODE>SecurityManager.checkCreateClassLoader()</CODE></A></DL></DD></DL><HR><A NAME="URLClassLoader(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory)"><!-- --></A><H3>URLClassLoader</H3><PRE>public <B>URLClassLoader</B>(<A HREF="../../java/net/URL.html">URL</A>[] urls, <A HREF="../../java/lang/ClassLoader.html">ClassLoader</A> parent, <A HREF="../../java/net/URLStreamHandlerFactory.html">URLStreamHandlerFactory</A> factory)</PRE><DL><DD>Constructs a new URLClassLoader for the specified URLs, parent class loader, and URLStreamHandlerFactory. The parent argument will be used as the parent class loader for delegation. The factory argument will be used as the stream handler factory to obtain protocol handlers when creating new URLs. <p>If there is a security manager, this method first calls the security manager's <code>checkCreateClassLoader</code> method to ensure creation of a class loader is allowed.<DD><DL><DT><B>Parameters:</B><DD><CODE>urls</CODE> - the URLs from which to load classes and resources<DD><CODE>parent</CODE> - the parent class loader for delegation<DD><CODE>factory</CODE> - the URLStreamHandlerFactory to use when creating URLs<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its <code>checkCreateClassLoader</code> method doesn't allow creation of a class loader.<DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkCreateClassLoader()"><CODE>SecurityManager.checkCreateClassLoader()</CODE></A></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="addURL(java.net.URL)"><!-- --></A><H3>addURL</H3><PRE>protected void <B>addURL</B>(<A HREF="../../java/net/URL.html">URL</A> url)</PRE><DL><DD>Appends the specified URL to the list of URLs to search for classes and resources.<DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - the URL to be added to the search path of URLs</DL></DD></DL><HR><A NAME="getURLs()"><!-- --></A><H3>getURLs</H3><PRE>public <A HREF="../../java/net/URL.html">URL</A>[] <B>getURLs</B>()</PRE><DL><DD>Returns the search path of URLs for loading classes and resources. This includes the original list of URLs specified to the constructor, along with any URLs subsequently appended by the addURL() method.<DD><DL><DT><B>Returns:</B><DD>the search path of URLs for loading classes and resources.</DL></DD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -