be.ugent.caagt.swirl.protocol

Class MappedURLStreamHandlerFactory

Implemented Interfaces:
URLStreamHandlerFactory

public class MappedURLStreamHandlerFactory
extends java.lang.Object
implements 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

URLStreamHandler
createURLStreamHandler(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(String protocol, URLStreamHandler handler)
Register a handler for a new protocol.

Constructor Details

MappedURLStreamHandlerFactory

public MappedURLStreamHandlerFactory()

Method Details

createURLStreamHandler

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

install

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

registerHandler

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