Class UriEncodeUtil


  • class UriEncodeUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int caseDiff
      The difference between the value a character in lower cases and the upper case character value.
      private static java.lang.String dfltEncName
      The default encoding ("UTF-8").
      private static java.util.BitSet unreservedAndReserved
      Set of 256 characters with the bits that don't need encoding set to on.
    • Constructor Summary

      Constructors 
      Constructor Description
      UriEncodeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String encode​(java.lang.String s)
      Encodes a String in the default encoding and default uri scheme to an HTML-encoded String.
      static java.lang.String encode​(java.lang.String s, java.lang.String enc)
      Encodes a String in a specific encoding and uri scheme to an HTML-encoded String.
      • Methods inherited from class java.lang.Object

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

      • unreservedAndReserved

        private static java.util.BitSet unreservedAndReserved
        Set of 256 characters with the bits that don't need encoding set to on.
      • caseDiff

        private static final int caseDiff
        The difference between the value a character in lower cases and the upper case character value.
        See Also:
        Constant Field Values
      • dfltEncName

        private static java.lang.String dfltEncName
        The default encoding ("UTF-8").
    • Constructor Detail

      • UriEncodeUtil

        UriEncodeUtil()
    • Method Detail

      • encode

        public static java.lang.String encode​(java.lang.String s)
        Encodes a String in the default encoding and default uri scheme to an HTML-encoded String.
        Parameters:
        s - the original string
        Returns:
        the encoded string
      • encode

        public static java.lang.String encode​(java.lang.String s,
                                              java.lang.String enc)
        Encodes a String in a specific encoding and uri scheme to an HTML-encoded String.
        Parameters:
        s - the original string
        enc - the encoding
        Returns:
        the encoded string