org.apache.geronimo.kernel.classloader
Class UrlResourceFinder

java.lang.Object
  extended by org.apache.geronimo.kernel.classloader.UrlResourceFinder
All Implemented Interfaces:
ResourceFinder

public class UrlResourceFinder
extends Object
implements ResourceFinder


Constructor Summary
UrlResourceFinder()
           
UrlResourceFinder(URL[] urls)
           
 
Method Summary
 void addUrl(URL url)
           
protected  void addUrls(List<URL> urls)
          Adds a list of urls to the end of this class loader.
protected  void addUrls(URL[] urls)
          Adds an array of urls to the end of this class loader.
protected  File cacheUrl(URL url)
           
protected  ResourceLocation createResourceLocation(URL codeSource, File cacheFile)
           
 void destroy()
           
 URL findResource(String resourceName)
          Find the resource by name and return URL of it if found.
 Enumeration findResources(String resourceName)
          Find all resources with given name and return enumeration of their URLs.
 ResourceHandle getResource(String resourceName)
          Get the resource by name and, if found, open connection to it and return the handle of it.
 URL[] getUrls()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlResourceFinder

public UrlResourceFinder()

UrlResourceFinder

public UrlResourceFinder(URL[] urls)
Method Detail

destroy

public void destroy()

getResource

public ResourceHandle getResource(String resourceName)
Description copied from interface: ResourceFinder
Get the resource by name and, if found, open connection to it and return the handle of it.

Specified by:
getResource in interface ResourceFinder
Parameters:
resourceName - the resource name
Returns:
resource handle or null if resource was not found

findResource

public URL findResource(String resourceName)
Description copied from interface: ResourceFinder
Find the resource by name and return URL of it if found.

Specified by:
findResource in interface ResourceFinder
Parameters:
resourceName - the resource name
Returns:
resource URL or null if resource was not found

findResources

public Enumeration findResources(String resourceName)
Description copied from interface: ResourceFinder
Find all resources with given name and return enumeration of their URLs.

Specified by:
findResources in interface ResourceFinder
Parameters:
resourceName - the resource name
Returns:
enumeration of resource URLs (possibly empty).

addUrl

public void addUrl(URL url)

getUrls

public URL[] getUrls()

addUrls

protected void addUrls(URL[] urls)
Adds an array of urls to the end of this class loader.

Parameters:
urls - the URLs to add

addUrls

protected void addUrls(List<URL> urls)
Adds a list of urls to the end of this class loader.

Parameters:
urls - the URLs to add

cacheUrl

protected File cacheUrl(URL url)
                 throws IOException
Throws:
IOException

createResourceLocation

protected ResourceLocation createResourceLocation(URL codeSource,
                                                  File cacheFile)
                                           throws IOException
Throws:
IOException


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.