uk.ac.starlink.util
Class CustomURLStreamHandlerFactory

java.lang.Object
  extended by uk.ac.starlink.util.CustomURLStreamHandlerFactory
All Implemented Interfaces:
java.net.URLStreamHandlerFactory

public class CustomURLStreamHandlerFactory
extends java.lang.Object
implements java.net.URLStreamHandlerFactory

Customisable implementation of URLStreamHandlerFactory. The handlers it can dispense are configured using a map; the keys of the map are protocol names and its values are the names of classes which implement URLStreamHandler (and have no-arg constructors).

Since:
25 Aug 2006
See Also:
URL

Constructor Summary
CustomURLStreamHandlerFactory()
          Constructs a no-op handler factory.
CustomURLStreamHandlerFactory(java.util.Map classMap)
          Constructs a handler factory initialised with a given protocol->classname map.
 
Method Summary
 java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
           
 java.util.Map getHandlerClassMap()
          Returns the protocol->>classname map that describes this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomURLStreamHandlerFactory

public CustomURLStreamHandlerFactory()
Constructs a no-op handler factory.


CustomURLStreamHandlerFactory

public CustomURLStreamHandlerFactory(java.util.Map classMap)
Constructs a handler factory initialised with a given protocol->classname map.

Parameters:
classMap - handler class map
Method Detail

getHandlerClassMap

public java.util.Map getHandlerClassMap()
Returns the protocol->>classname map that describes this factory. It may be altered to modify behaviour.

Returns:
handler class map

createURLStreamHandler

public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
Specified by:
createURLStreamHandler in interface java.net.URLStreamHandlerFactory

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.