Package com.sun.ts.lib.util.sec.misc
Class URLClassPath
java.lang.Object
com.sun.ts.lib.util.sec.misc.URLClassPath
This class is used to maintain a search path of URLs for loading classes and resources from both JAR files and
 directories.
- Author:
- David Connelly
- 
Constructor SummaryConstructorsConstructorDescriptionURLClassPath(URL[] urls) URLClassPath(URL[] urls, URLStreamHandlerFactory factory) Creates a new URLClassPath for the given URLs.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAppends the specified URL to the search path of directory and JAR file URLs from which to load classes and resources.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.findResources(String name, boolean check) Finds all resources on the URL search path with the given name.getResource(String name) getResource(String name, boolean check) Finds the first Resource on the URL search path which has the specified name.getResources(String name) getResources(String name, boolean check) Finds all resources on the URL search path with the given name.URL[]getURLs()Returns the original search path of URLs.static URL[]pathToURLs(String path) Convert class path specification into an array of file URLs.
- 
Constructor Details- 
URLClassPathCreates 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
 
- 
URLClassPath
 
- 
- 
Method Details- 
addURLAppends the specified URL to the search path of directory and JAR file URLs from which to load classes and resources.
- 
getURLsReturns the original search path of URLs.
- 
findResourceFinds the resource with the specified name on the URL search path or null if not found or security check fails.- Parameters:
- name- the name of the resource
- check- whether to perform a security check
- Returns:
- a URLfor the resource, ornullif the resource could not be found.
 
- 
getResourceFinds the first Resource on the URL search path which has the specified name. Returns null if no Resource could be found.- Parameters:
- name- the name of the Resource
- check- whether to perform a security check
- Returns:
- the Resource, or null if not found
 
- 
findResourcesFinds all resources on the URL search path with the given name. Returns an enumeration of the URL objects.- Parameters:
- name- the resource name
- Returns:
- an Enumeration of all the urls having the specified name
 
- 
getResource
- 
getResourcesFinds all resources on the URL search path with the given name. Returns an enumeration of the Resource objects.- Parameters:
- name- the resource name
- Returns:
- an Enumeration of all the resources having the specified name
 
- 
getResources
- 
pathToURLsConvert 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.
- 
checkURL
 
-