- java.lang.Object
-
- aeonics.Protocols
-
- All Implemented Interfaces:
java.net.URLStreamHandlerFactory
public class Protocols extends java.lang.Object implements java.net.URLStreamHandlerFactory
This class can be used to register multiple protocol schemes usable via theURL
class. This is because an application can only callURL.setURLStreamHandlerFactory(URLStreamHandlerFactory)
once which is not compatible with a modular system that needs to register multiple protocols.
-
-
Constructor Summary
Constructors Constructor Description Protocols()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URLStreamHandler
createURLStreamHandler(java.lang.String protocol)
static void
register(java.lang.String protocol, java.net.URLStreamHandler handler)
Registers a new protocol schemestatic void
unregister(java.lang.String protocol)
Unregisters a protocol scheme
-
-
-
Method Detail
-
createURLStreamHandler
public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
- Specified by:
createURLStreamHandler
in interfacejava.net.URLStreamHandlerFactory
-
register
public static void register(java.lang.String protocol, java.net.URLStreamHandler handler)
Registers a new protocol scheme- Parameters:
protocol
- the protocol name (i.e.: for "http://" the protocol is "http")handler
- the URLStreamHandler to handle the protocol
-
unregister
public static void unregister(java.lang.String protocol)
Unregisters a protocol scheme- Parameters:
protocol
- the protocol name (i.e.: for "http://" the protocol is "http")
-
-