Class 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
    Author:
    Mark Taylor
    See Also:
    URL
    • Constructor Summary

      Constructors 
      Constructor 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • 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<java.lang.String,​java.lang.String> classMap)
        Constructs a handler factory initialised with a given protocol->classname map.
        Parameters:
        classMap - handler class map
    • Method Detail

      • getHandlerClassMap

        public java.util.Map<java.lang.String,​java.lang.String> 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