Package uk.ac.starlink.util
Class CustomURLStreamHandlerFactory
- java.lang.Object
-
- uk.ac.starlink.util.CustomURLStreamHandlerFactory
-
- All Implemented Interfaces:
java.net.URLStreamHandlerFactory
public class CustomURLStreamHandlerFactory extends java.lang.Object implements java.net.URLStreamHandlerFactory
Customisable implementation ofURLStreamHandlerFactory
. 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 implementURLStreamHandler
(and have no-arg constructors).- Since:
- 25 Aug 2006
- Author:
- Mark Taylor
- See Also:
URL
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URLStreamHandler
createURLStreamHandler(java.lang.String protocol)
java.util.Map
getHandlerClassMap()
Returns the protocol->>classname map that describes this factory.
-
-
-
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 interfacejava.net.URLStreamHandlerFactory
-
-