uk.ac.starlink.util
Class CustomURLStreamHandlerFactory

java.lang.Object
  extended byuk.ac.starlink.util.CustomURLStreamHandlerFactory
All Implemented Interfaces:
URLStreamHandlerFactory

public class CustomURLStreamHandlerFactory
extends Object
implements 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(Map classMap)
          Constructs a handler factory initialised with a given protocol->classname map.
 
Method Summary
 URLStreamHandler createURLStreamHandler(String protocol)
           
 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(Map classMap)
Constructs a handler factory initialised with a given protocol->classname map.

Method Detail

getHandlerClassMap

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

Returns:
handler class map

createURLStreamHandler

public URLStreamHandler createURLStreamHandler(String protocol)
Specified by:
createURLStreamHandler in interface URLStreamHandlerFactory

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