Class UrlUtil


  • public class UrlUtil
    extends java.lang.Object
    Utilities for working with URLs.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.BitSet VALID_SCHEME_CHARS
      Valid characters in a scheme.
    • Constructor Summary

      Constructors 
      Constructor Description
      UrlUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VALID_SCHEME_CHARS

        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.

    • Constructor Detail

      • UrlUtil

        public UrlUtil()
    • Method Detail

      • isAbsoluteUrl

        public static boolean isAbsoluteUrl​(java.lang.String url)
        Determine if a URL is absolute by JSTL's definition.
      • getScheme

        public static java.lang.String getScheme​(java.lang.CharSequence url)