org.foray.common.url
Interface ProtocolRegistrationStrategy

All Known Implementing Classes:
AbstractProtocolRegistration, FactoryProtocolRegistration, PropertyProtocolRegistration, UniversalProtocolRegistration

public interface ProtocolRegistrationStrategy

A strategy that registers all custom URL protocols in a standard way.


Method Summary
 URLStreamHandler getURLStreamHandler(String protocol)
          Finds the registered URLStreamHandler for a given protocol.
 void registerProtocolHandler(String protocol, URLStreamHandler handler)
          Registers a URLStreamHandler for the given protocol.
 

Method Detail

registerProtocolHandler

void registerProtocolHandler(String protocol,
                             URLStreamHandler handler)
Registers a URLStreamHandler for the given protocol. When implemented, this method should be synchronized. If a handler already exists for the given protocol, this method does nothing.

Parameters:
protocol - The protocol to be registered.
handler - The URLStreamHandler instance which should be used for URLs whose protocol is protocol.

getURLStreamHandler

URLStreamHandler getURLStreamHandler(String protocol)
Finds the registered URLStreamHandler for a given protocol.

Parameters:
protocol - The protocol for which a URLStreamHandler is desired.
Returns:
The URLStreamHandler registered with this registration scheme, or null if the protocol has not been registered.


Copyright © 2017. All rights reserved.