@ThreadSafe @Singleton public final class URLProtocolRegistry extends Object
EURLProtocol, but it may be
extended by custom protocols| Modifier and Type | Method and Description |
|---|---|
ICommonsCollection<IURLProtocol> |
getAllProtocols() |
static URLProtocolRegistry |
getInstance() |
IURLProtocol |
getProtocol(IURLData aURL)
Try to evaluate the matching URL protocol from the passed URL
|
IURLProtocol |
getProtocol(String sURL)
Try to evaluate the matching URL protocol from the passed URL
|
int |
getRegisteredProtocolCount() |
String |
getWithoutProtocol(String sURL)
Return the passed URL where the protocol has been stripped (if known)
|
boolean |
hasKnownProtocol(IURLData aURL)
Check if the passed URL has any known protocol
|
boolean |
hasKnownProtocol(String sURL)
Check if the passed URL has any known protocol
|
static boolean |
isInstantiated() |
void |
registerProtocol(IURLProtocol aProtocol)
Registers a new protocol
|
void |
reinitialize()
Reinitialize all protocols.
|
public static boolean isInstantiated()
@Nonnull public static URLProtocolRegistry getInstance()
public void registerProtocol(@Nonnull IURLProtocol aProtocol)
aProtocol - The protocol to be registered. May not be null.IllegalArgumentException - If another handler for this protocol is already installed.@Nonnull @ReturnsMutableCopy public ICommonsCollection<IURLProtocol> getAllProtocols()
@Nonnegative public int getRegisteredProtocolCount()
@Nullable public IURLProtocol getProtocol(@Nullable String sURL)
sURL - The URL to get the protocol fromnull if unresolved@Nullable public IURLProtocol getProtocol(@Nullable IURLData aURL)
aURL - The URL datanull if unresolvedpublic boolean hasKnownProtocol(@Nullable String sURL)
sURL - The URL to analyzetrue if the protocol is known, false
otherwisepublic boolean hasKnownProtocol(@Nullable IURLData aURL)
aURL - The URL to analyzetrue if the protocol is known, false
otherwise@Nullable public String getWithoutProtocol(@Nullable String sURL)
sURL - The URL to strip the protocol from. May be null.public void reinitialize()
EURLProtocol values and
invokes all SPI implementations.Copyright © 2014–2017 Philip Helger. All rights reserved.