/** * Returns the handler for a particular protocol. If protocol is * <code>null</code> or no match is found in the handlers map it * returns the default protocol handler. * @param protocol The protocol to get a handler for. */ public static synchronized ParsedURLProtocolHandler getHandler (String protocol) { if (protocol == null) return defaultHandler; Map handlers = getHandlersMap(); ParsedURLProtocolHandler ret; ret = (ParsedURLProtocolHandler)handlers.get(protocol); if (ret == null) ret = defaultHandler; return ret; }
/** * Returns the handler for a particular protocol. If protocol is * <code>null</code> or no match is found in the handlers map it * returns the default protocol handler. * @param protocol The protocol to get a handler for. */ public static synchronized ParsedURLProtocolHandler getHandler (String protocol) { if (protocol == null) return defaultHandler; Map handlers = getHandlersMap(); ParsedURLProtocolHandler ret; ret = (ParsedURLProtocolHandler)handlers.get(protocol); if (ret == null) ret = defaultHandler; return ret; }
/** * Returns the handler for a particular protocol. If protocol is * <code>null</code> or no match is found in the handlers map it * returns the default protocol handler. * @param protocol The protocol to get a handler for. */ public static synchronized ParsedURLProtocolHandler getHandler (String protocol) { if (protocol == null) return defaultHandler; Map handlers = getHandlersMap(); ParsedURLProtocolHandler ret; ret = (ParsedURLProtocolHandler)handlers.get(protocol); if (ret == null) ret = defaultHandler; return ret; }
/** * Registers a Protocol handler by adding it to the handlers map. * If the given protocol handler returns <code>null</code> as it's * supported protocol then it is registered as the default * protocol handler. * @param handler the new Protocol Handler to register */ public static synchronized void registerHandler (ParsedURLProtocolHandler handler) { if (handler.getProtocolHandled() == null) { defaultHandler = handler; return; } Map handlers = getHandlersMap(); handlers.put(handler.getProtocolHandled(), handler); }
/** * Registers a Protocol handler by adding it to the handlers map. * If the given protocol handler returns <code>null</code> as it's * supported protocol then it is registered as the default * protocol handler. * @param handler the new Protocol Handler to register */ public static synchronized void registerHandler (ParsedURLProtocolHandler handler) { if (handler.getProtocolHandled() == null) { defaultHandler = handler; return; } Map handlers = getHandlersMap(); handlers.put(handler.getProtocolHandled(), handler); }
/** * Registers a Protocol handler by adding it to the handlers map. * If the given protocol handler returns <code>null</code> as it's * supported protocol then it is registered as the default * protocol handler. * @param handler the new Protocol Handler to register */ public static synchronized void registerHandler (ParsedURLProtocolHandler handler) { if (handler.getProtocolHandled() == null) { defaultHandler = handler; return; } Map handlers = getHandlersMap(); handlers.put(handler.getProtocolHandled(), handler); }