org.mule.util
Class MuleUrlStreamHandlerFactory
java.lang.Object
org.mule.util.MuleUrlStreamHandlerFactory
- All Implemented Interfaces:
- URLStreamHandlerFactory
public class MuleUrlStreamHandlerFactory
- extends Object
- implements URLStreamHandlerFactory
A factory for loading URL protocol handlers. This factory is necessary to make
Mule work in cases where the standard approach using system properties does not
work, e.g. in application servers or with maven's surefire tests.
Client classes can register a subclass of URLStreamHandler
for a given
protocol. This implementation first checks its registered handlers before
resorting to the default mechanism.
- See Also:
URL.URL(String, String, int, String)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MuleUrlStreamHandlerFactory
public MuleUrlStreamHandlerFactory()
installUrlStreamHandlerFactory
public static void installUrlStreamHandlerFactory()
- Install an instance of this class as UrlStreamHandlerFactory. This may be done exactly
once as
URL
will throw an Error
on subsequent invocations.
This method takes care that multiple invocations are possible, but the
UrlStreamHandlerFactory is installed only once.
registerHandler
public static void registerHandler(String protocol,
URLStreamHandler handler)
createURLStreamHandler
public URLStreamHandler createURLStreamHandler(String protocol)
- Specified by:
createURLStreamHandler
in interface URLStreamHandlerFactory
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.