public final class SimpleURLCanonicalizer extends Object
Modifier and Type | Field and Description |
---|---|
private static Map<String,Integer> |
schemePortMap
The scheme-to-port mapping data.
|
Modifier | Constructor and Description |
---|---|
private |
SimpleURLCanonicalizer()
Constructor to prevent instantiation.
|
Modifier and Type | Method and Description |
---|---|
static String |
canonicalize(String url)
Canonicalize the supplied URL.
|
private static void |
canonicalize(URLBuilder url)
Canonicalize the supplied URLBuilder data.
|
static void |
deregisterSchemePortMapping(String scheme)
Deregister a scheme-to-port mapping.
|
static Integer |
getRegisteredPort(String scheme)
Obtain the default port registered for a scheme.
|
static void |
registerSchemePortMapping(String scheme,
Integer port)
Register a new scheme-to-port mapping.
|
private SimpleURLCanonicalizer()
public static void registerSchemePortMapping(@Nonnull @NotEmpty String scheme, @Nonnull Integer port)
scheme
- the scheme to registerport
- the default port for that schemepublic static void deregisterSchemePortMapping(@Nonnull String scheme)
scheme
- the scheme to deregister@Nullable public static Integer getRegisteredPort(@Nonnull @NotEmpty String scheme)
scheme
- the scheme to look up@Nonnull @NotEmpty public static String canonicalize(@Nonnull @NotEmpty String url) throws MalformedURLException
url
- the URL to canonicalizeMalformedURLException
- if the URL is not a valid URLprivate static void canonicalize(@Nonnull URLBuilder url)
url
- the URLBuilder to canonicalizeCopyright © 1999–2017. All rights reserved.