src/share/classes/java/net/URLClassLoader.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk Sdiff src/share/classes/java/net

src/share/classes/java/net/URLClassLoader.java

Print this page




  40 import java.security.CodeSource;
  41 import java.security.Permission;
  42 import java.security.PermissionCollection;
  43 import sun.misc.Resource;
  44 import sun.misc.URLClassPath;
  45 import sun.net.www.ParseUtil;
  46 import sun.security.util.SecurityConstants;
  47 
  48 /**
  49  * This class loader is used to load classes and resources from a search
  50  * path of URLs referring to both JAR files and directories. Any URL that
  51  * ends with a '/' is assumed to refer to a directory. Otherwise, the URL
  52  * is assumed to refer to a JAR file which will be opened as needed.
  53  * <p>
  54  * The AccessControlContext of the thread that created the instance of
  55  * URLClassLoader will be used when subsequently loading classes and
  56  * resources.
  57  * <p>
  58  * The classes that are loaded are by default granted permission only to
  59  * access the URLs specified when the URLClassLoader was created.






  60  *
  61  * @author  David Connelly
  62  * @since   1.2
  63  */
  64 public class URLClassLoader extends SecureClassLoader implements Closeable {
  65     /* The search path for classes and resources */
  66     private final URLClassPath ucp;
  67 
  68     /* The context to be used when loading classes and resources */
  69     private final AccessControlContext acc;
  70 
  71     /**
  72      * Constructs a new URLClassLoader for the given URLs. The URLs will be
  73      * searched in the order specified for classes and resources after first
  74      * searching in the specified parent class loader. Any URL that ends with
  75      * a '/' is assumed to refer to a directory. Otherwise, the URL is assumed
  76      * to refer to a JAR file which will be downloaded and opened as needed.
  77      *
  78      * <p>If there is a security manager, this method first
  79      * calls the security manager's {@code checkCreateClassLoader} method




  40 import java.security.CodeSource;
  41 import java.security.Permission;
  42 import java.security.PermissionCollection;
  43 import sun.misc.Resource;
  44 import sun.misc.URLClassPath;
  45 import sun.net.www.ParseUtil;
  46 import sun.security.util.SecurityConstants;
  47 
  48 /**
  49  * This class loader is used to load classes and resources from a search
  50  * path of URLs referring to both JAR files and directories. Any URL that
  51  * ends with a '/' is assumed to refer to a directory. Otherwise, the URL
  52  * is assumed to refer to a JAR file which will be opened as needed.
  53  * <p>
  54  * The AccessControlContext of the thread that created the instance of
  55  * URLClassLoader will be used when subsequently loading classes and
  56  * resources.
  57  * <p>
  58  * The classes that are loaded are by default granted permission only to
  59  * access the URLs specified when the URLClassLoader was created.
  60  * <p>
  61  * Where a JAR file contains the {@link Name#PROFILE Profile} attribute then its
  62  * value is the name of the Java SE profile that the library minimally requires.
  63  * If this runtime does not support the profile then it causes {@link 
  64  * java.util.jar.UnsupportedProfileException} to be thrown at some unspecified
  65  * time.
  66  *
  67  * @author  David Connelly
  68  * @since   1.2
  69  */
  70 public class URLClassLoader extends SecureClassLoader implements Closeable {
  71     /* The search path for classes and resources */
  72     private final URLClassPath ucp;
  73 
  74     /* The context to be used when loading classes and resources */
  75     private final AccessControlContext acc;
  76 
  77     /**
  78      * Constructs a new URLClassLoader for the given URLs. The URLs will be
  79      * searched in the order specified for classes and resources after first
  80      * searching in the specified parent class loader. Any URL that ends with
  81      * a '/' is assumed to refer to a directory. Otherwise, the URL is assumed
  82      * to refer to a JAR file which will be downloaded and opened as needed.
  83      *
  84      * <p>If there is a security manager, this method first
  85      * calls the security manager's {@code checkCreateClassLoader} method


src/share/classes/java/net/URLClassLoader.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File