IT. Expert System.

Android Reference

URLClassLoader


java.net

Class URLClassLoader



  • public class URLClassLoader
    extends SecureClassLoader
    This class loader is responsible for loading classes and resources from a list of URLs which can refer to either directories or JAR files. Classes loaded by this URLClassLoader are granted permission to access the URLs contained in the URL search list.
    • Constructor Detail

      • URLClassLoader

        public URLClassLoader(URL[] urls)
        Constructs a new URLClassLoader instance. The newly created instance will have the system ClassLoader as its parent. URLs that end with "/" are assumed to be directories, otherwise they are assumed to be JAR files.
        Parameters:
        urls - the list of URLs where a specific class or file could be found.
      • URLClassLoader

        public URLClassLoader(URL[] urls,
                      ClassLoader parent)
        Constructs a new URLClassLoader instance. The newly created instance will have the system ClassLoader as its parent. URLs that end with "/" are assumed to be directories, otherwise they are assumed to be JAR files.
        Parameters:
        urls - the list of URLs where a specific class or file could be found.
        parent - the class loader to assign as this loader's parent.
      • URLClassLoader

        public URLClassLoader(URL[] searchUrls,
                      ClassLoader parent,
                      URLStreamHandlerFactory factory)
        Constructs a new URLClassLoader instance. The newly created instance will have the specified ClassLoader as its parent and use the specified factory to create stream handlers. URLs that end with "/" are assumed to be directories, otherwise they are assumed to be JAR files.
        Parameters:
        searchUrls - the list of URLs where a specific class or file could be found.
        parent - the ClassLoader to assign as this loader's parent.
        factory - the factory that will be used to create protocol-specific stream handlers.
    • Method Detail

      • addURL

        protected void addURL(URL url)
        Adds the specified URL to the search list.
        Parameters:
        url - the URL which is to add.
      • findResources

        public Enumeration<URL> findResources(String name)
                                       throws IOException
        Returns all known URLs which point to the specified resource.
        Overrides:
        findResources in class ClassLoader
        Parameters:
        name - the name of the requested resource.
        Returns:
        the enumeration of URLs which point to the specified resource.
        Throws:
        IOException - if an I/O error occurs while attempting to connect.
      • getPermissions

        protected PermissionCollection getPermissions(CodeSource codesource)
        Gets all permissions for the specified codesource. First, this method retrieves the permissions from the system policy. If the protocol is "file:/" then a new permission, FilePermission, granting the read permission to the file is added to the permission collection. Otherwise, connecting to and accepting connections from the URL is granted.
        Overrides:
        getPermissions in class SecureClassLoader
        Parameters:
        codesource - the code source object whose permissions have to be known.
        Returns:
        the list of permissions according to the code source object.
      • getURLs

        public URL[] getURLs()
        Returns the search list of this URLClassLoader.
        Returns:
        the list of all known URLs of this instance.
      • newInstance

        public static URLClassLoader newInstance(URL[] urls)
        Returns a new URLClassLoader instance for the given URLs and the system ClassLoader as its parent.
        Parameters:
        urls - the list of URLs that is passed to the new URLClassLoader.
        Returns:
        the created URLClassLoader instance.
      • newInstance

        public static URLClassLoader newInstance(URL[] urls,
                                 ClassLoader parentCl)
        Returns a new URLClassLoader instance for the given URLs and the specified ClassLoader as its parent.
        Parameters:
        urls - the list of URLs that is passed to the new URLClassLoader.
        parentCl - the parent class loader that is passed to the new URLClassLoader.
        Returns:
        the created URLClassLoader instance.
      • findClass

        protected Class<?> findClass(String className)
                              throws ClassNotFoundException
        Tries to locate and load the specified class using the known URLs. If the class could be found, a class object representing the loaded class will be returned.
        Overrides:
        findClass in class ClassLoader
        Parameters:
        className - the name of the class to look for.
        Returns:
        the Class object that is found.
        Throws:
        ClassNotFoundException - if the specified class cannot be loaded.
      • findResource

        public URL findResource(String name)
        Returns an URL referencing the specified resource or null if the resource could not be found.
        Overrides:
        findResource in class ClassLoader
        Parameters:
        name - the name of the requested resource.
        Returns:
        the URL which points to the given resource.
      • definePackage

        protected Package definePackage(String packageName,
                            Manifest manifest,
                            URL url)
                                 throws IllegalArgumentException
        Defines a new package using the information extracted from the specified manifest.
        Parameters:
        packageName - the name of the new package.
        manifest - the manifest containing additional information for the new package.
        url - the URL to the code source for the new package.
        Returns:
        the created package.
        Throws:
        IllegalArgumentException - if a package with the given name already exists.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 27 / 158679731. Delta: 0.04137 с