Save This Page
Home » openjdk-7 » sun » misc » [javadoc | source]
sun.misc
public class: URLClassPath [javadoc | source]
java.lang.Object
   sun.misc.URLClassPath
This class is used to maintain a search path of URLs for loading classes and resources from both JAR files and directories.
Nested Class Summary:
static class  URLClassPath.JarLoader   
Field Summary
static final  String USER_AGENT_JAVA_VERSION     
static final  String JAVA_VERSION     
 Stack<URL> urls     
 ArrayList<Loader> loaders     
 HashMap<String, Loader> lmap     
Constructor:
 public URLClassPath(URL[] urls) 
 public URLClassPath(URL[] urls,
    URLStreamHandlerFactory factory) 
    Creates a new URLClassPath for the given URLs. The URLs will be searched in the order specified for classes and resources. A URL ending with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file.
    Parameters:
    urls - the directory and JAR file URLs to search for classes and resources
    factory - the URLStreamHandlerFactory to use when creating new URLs
Method from sun.misc.URLClassPath Summary:
addURL,   check,   checkURL,   closeLoaders,   findResource,   findResources,   getResource,   getResource,   getResources,   getResources,   getURLs,   pathToURLs
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.misc.URLClassPath Detail:
 public synchronized  void addURL(URL url) 
    Appends the specified URL to the search path of directory and JAR file URLs from which to load classes and resources.

    If the URL specified is null or is already in the list of URLs, then invoking this method has no effect.

 static  void check(URL url) throws IOException 
 public URL checkURL(URL url) 
 public synchronized List<IOException> closeLoaders() 
 public URL findResource(String name,
    boolean check) 
    Finds the resource with the specified name on the URL search path or null if not found or security check fails.
 public Enumeration<URL> findResources(String name,
    boolean check) 
    Finds all resources on the URL search path with the given name. Returns an enumeration of the URL objects.
 public Resource getResource(String name) 
 public Resource getResource(String name,
    boolean check) 
    Finds the first Resource on the URL search path which has the specified name. Returns null if no Resource could be found.
 public Enumeration<Resource> getResources(String name) 
 public Enumeration<Resource> getResources(String name,
    boolean check) 
    Finds all resources on the URL search path with the given name. Returns an enumeration of the Resource objects.
 public URL[] getURLs() 
    Returns the original search path of URLs.
 public static URL[] pathToURLs(String path) 
    Convert class path specification into an array of file URLs. The path of the file is encoded before conversion into URL form so that reserved characters can safely appear in the path.