org.openorb.util.urlhandler.resource
Class Handler

java.lang.Object
  |
  +--java.net.URLStreamHandler
        |
        +--org.openorb.util.urlhandler.resource.Handler

public final class Handler
extends URLStreamHandler

This class is an extension of the URLStreamHandler class. It overrides the method openConnection and adds a level of indirection to the way resources are loaded from a URL.

Version:
$Revision: 1.6 $ $Date: 2004/02/10 21:28:45 $
Author:
Chris Wood

Constructor Summary
Handler()
          The empty default constructor is important because the java URL class does a newInstance.
Handler(ClassLoader cl)
          Creates a new Handler
 
Method Summary
protected  URLConnection openConnection(URL url)
          Opens a connection to the specified URL.
 
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, setURL, setURL, toExternalForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Handler

public Handler()
The empty default constructor is important because the java URL class does a newInstance.

Handler

public Handler(ClassLoader cl)
Creates a new Handler
Parameters:
cl - the classloader used for loading ressources, null falls back to the current thread classloader
Method Detail

openConnection

protected URLConnection openConnection(URL url)
                                throws IOException
Opens a connection to the specified URL.
Overrides:
openConnection in class URLStreamHandler
Parameters:
url - A URL to open a connection to.
Returns:
The established connection.
Throws:
IOException - When the file specified by the URL could not be found.