public final class SimpleURLCanonicalizer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.String,java.lang.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 java.lang.String |
canonicalize(java.lang.String url)
Canonicalize the supplied URL.
|
private static void |
canonicalize(URLBuilder url)
Canonicalize the supplied URLBuilder data.
|
static void |
deregisterSchemePortMapping(java.lang.String scheme)
Deregister a scheme-to-port mapping.
|
static java.lang.Integer |
getRegisteredPort(java.lang.String scheme)
Obtain the default port registered for a scheme.
|
static void |
registerSchemePortMapping(java.lang.String scheme,
java.lang.Integer port)
Register a new scheme-to-port mapping.
|
private static java.util.Map<java.lang.String,java.lang.Integer> schemePortMap
private SimpleURLCanonicalizer()
public static void registerSchemePortMapping(@Nonnull @NotEmpty java.lang.String scheme, @Nonnull java.lang.Integer port)
scheme - the scheme to registerport - the default port for that schemepublic static void deregisterSchemePortMapping(@Nonnull
java.lang.String scheme)
scheme - the scheme to deregister@Nullable public static java.lang.Integer getRegisteredPort(@Nonnull @NotEmpty java.lang.String scheme)
scheme - the scheme to look up@Nonnull @NotEmpty public static java.lang.String canonicalize(@Nonnull @NotEmpty java.lang.String url) throws java.net.MalformedURLException
url - the URL to canonicalizejava.net.MalformedURLException - if the URL is not a valid URLprivate static void canonicalize(@Nonnull
URLBuilder url)
url - the URLBuilder to canonicalize