Top Fields Constructors Methods
com.jogamp.common.net

public Class GenericURLStreamHandlerFactory

extends Object
implements URLStreamHandlerFactory
Class Inheritance
All Implemented Interfaces
java.net.URLStreamHandlerFactory
Imports
java.net.URL, .URLStreamHandler, .URLStreamHandlerFactory, java.security.AccessController, .PrivilegedAction, java.util.HashMap, .Map

Field Summary

Modifier and TypeField and Description
private static GenericURLStreamHandlerFactory
private final Map<String, URLStreamHandler>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final synchronized URLStreamHandler
createURLStreamHandler(final String
the protocol ("ftp", "http", "nntp", etc.).
protocol
)

Implements java.net.URLStreamHandlerFactory.createURLStreamHandler.

Creates a new URLStreamHandler instance with the specified protocol.
public final synchronized URLStreamHandler
getHandler(final String protocol)

Returns the protocol handler previously set via setHandler(String, URLStreamHandler), or null if none was set.

public static synchronized GenericURLStreamHandlerFactory
register()

Returns the singleton instance of the registered GenericURLStreamHandlerFactory or null if registration was not successful.

public final synchronized URLStreamHandler

Returns:

the previous set handler, or null if none was set.
setHandler
(final String protocol, final URLStreamHandler handler)

Sets the handler for protocol.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryback to summary
private static GenericURLStreamHandlerFactory factory
protocolHandlersback to summary
private final Map<String, URLStreamHandler> protocolHandlers

Constructor Detail

GenericURLStreamHandlerFactoryback to summary
private GenericURLStreamHandlerFactory()

Method Detail

createURLStreamHandlerback to summary
public final synchronized URLStreamHandler createURLStreamHandler(final String protocol)

Implements java.net.URLStreamHandlerFactory.createURLStreamHandler.

Doc from java.net.URLStreamHandlerFactory.createURLStreamHandler.

Creates a new URLStreamHandler instance with the specified protocol.

Parameters
protocol:String

the protocol ("ftp", "http", "nntp", etc.).

Returns:URLStreamHandler

a URLStreamHandler for the specific protocol, or null if this factory cannot create a handler for the specific protocol

Annotations
@Override
getHandlerback to summary
public final synchronized URLStreamHandler getHandler(final String protocol)

Returns the protocol handler previously set via setHandler(String, URLStreamHandler), or null if none was set.

registerback to summary
public static synchronized GenericURLStreamHandlerFactory register()

Returns the singleton instance of the registered GenericURLStreamHandlerFactory or null if registration was not successful.

Registration is only performed once.

setHandlerback to summary
public final synchronized URLStreamHandler setHandler(final String protocol, final URLStreamHandler handler)

Sets the handler for protocol.

Returns:URLStreamHandler

the previous set handler, or null if none was set.