public class CustomURLStreamHandlerFactory
extends java.lang.Object
implements java.net.URLStreamHandlerFactory
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).URL
Constructor and Description |
---|
CustomURLStreamHandlerFactory()
Constructs a no-op handler factory.
|
CustomURLStreamHandlerFactory(java.util.Map<java.lang.String,java.lang.String> classMap)
Constructs a handler factory initialised with a given
protocol->classname map.
|
Modifier and Type | Method and Description |
---|---|
java.net.URLStreamHandler |
createURLStreamHandler(java.lang.String protocol) |
java.util.Map<java.lang.String,java.lang.String> |
getHandlerClassMap()
Returns the protocol->classname map that describes this factory.
|
public CustomURLStreamHandlerFactory()
public CustomURLStreamHandlerFactory(java.util.Map<java.lang.String,java.lang.String> classMap)
classMap
- handler class mappublic java.util.Map<java.lang.String,java.lang.String> getHandlerClassMap()
public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
createURLStreamHandler
in interface java.net.URLStreamHandlerFactory