dsto.dfc.net.streams.resource
Class Handler

java.lang.Object
  extended by java.net.URLStreamHandler
      extended by dsto.dfc.net.streams.resource.Handler

public class Handler
extends URLStreamHandler

Handler for URL's using the "resource:" protocol. Searches the current Java resource path (using Class.getResource(java.lang.String) for the URL contents.

Version:
$Revision$

Constructor Summary
Handler()
           
 
Method Summary
static Handler getInstance()
          Get the singleton instance of this class.
 URLConnection openConnection(URL url)
           
static void register()
          Register this class as the handler for the "resource:" URL protocol.
 
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, 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()
Method Detail

getInstance

public static Handler getInstance()
Get the singleton instance of this class. Other instances may be safely created as well.


register

public static void register()
                     throws UnsupportedOperationException
Register this class as the handler for the "resource:" URL protocol. May be called more than once.

Throws:
UnsupportedOperationException

openConnection

public URLConnection openConnection(URL url)
                             throws IOException
Specified by:
openConnection in class URLStreamHandler
Throws:
IOException


Copyright © 2008 Commonwealth of Australia