1package com.jogamp.common.net;
4import java.net.URLStreamHandler;
5import java.net.URLStreamHandlerFactory;
6import java.security.PrivilegedAction;
7import java.util.HashMap;
10import com.jogamp.common.util.SecurityUtil;
15 private final Map<String, URLStreamHandler> protocolHandlers;
18 protocolHandlers =
new HashMap<String, URLStreamHandler>();
26 public synchronized final URLStreamHandler
setHandler(
final String protocol,
final URLStreamHandler handler) {
27 return protocolHandlers.put(protocol, handler);
34 public synchronized final URLStreamHandler
getHandler(
final String protocol) {
35 return protocolHandlers.get(protocol);
58 URL.setURLStreamHandlerFactory(f);
60 }
catch (
final Throwable e) {
61 System.err.println(
"GenericURLStreamHandlerFactory: Setting URLStreamHandlerFactory failed: "+e.getMessage());
synchronized final URLStreamHandler getHandler(final String protocol)
Returns the protocol handler previously set via setHandler(String, URLStreamHandler),...
static synchronized GenericURLStreamHandlerFactory register()
Returns the singleton instance of the registered GenericURLStreamHandlerFactory or null if registrati...
synchronized final URLStreamHandler setHandler(final String protocol, final URLStreamHandler handler)
Sets the handler for protocol.
synchronized final URLStreamHandler createURLStreamHandler(final String protocol)
static< T > T doPrivileged(final PrivilegedAction< T > o)
Call wrapper for java.security.AccessController#doPrivileged(PrivilegedAction).