be.ugent.caagt.swirl.protocol
Class MappedURLStreamHandlerFactory

java.lang.Object
  extended by be.ugent.caagt.swirl.protocol.MappedURLStreamHandlerFactory
All Implemented Interfaces:
java.net.URLStreamHandlerFactory

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

URLStreamHandlerFactory which allows run time registration of new handlers. This is mainly useful in those cases where it is not easy to configure new protocols the standard way, i.e., by means of the 'java.protocol.handler.pkgs' system property.

See Also:
URL.URL(String,String,int,String)

Constructor Summary
MappedURLStreamHandlerFactory()
           
 
Method Summary
 java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
          Return the handler associated wit the given protocol, or null if a default handler should be tried
 void install()
          Request that this factory be used before the default factory for resolving URL's.
 void registerHandler(java.lang.String protocol, java.net.URLStreamHandler handler)
          Register a handler for a new protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedURLStreamHandlerFactory

public MappedURLStreamHandlerFactory()
Method Detail

createURLStreamHandler

public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
Return the handler associated wit the given protocol, or null if a default handler should be tried

Specified by:
createURLStreamHandler in interface java.net.URLStreamHandlerFactory

registerHandler

public void registerHandler(java.lang.String protocol,
                            java.net.URLStreamHandler handler)
Register a handler for a new protocol.


install

public void install()
Request that this factory be used before the default factory for resolving URL's.