public class UrlUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.BitSet |
VALID_SCHEME_CHARS
Valid characters in a scheme.
|
Constructor and Description |
---|
UrlUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getScheme(java.lang.CharSequence url) |
static boolean |
isAbsoluteUrl(java.lang.String url)
Determine if a URL is absolute by JSTL's definition.
|
private static final java.util.BitSet VALID_SCHEME_CHARS
Valid characters in a scheme.
RFC 1738 says the following:
Scheme names consist of a sequence of characters. The lower case letters "a"--"z", digits, and the characters plus ("+"), period ("."), and hyphen ("-") are allowed. For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names (e.g., allow "HTTP" as well as "http").
We treat as absolute any URL that begins with such a scheme name, followed by a colon.