Class WebURLEncoder


  • public class WebURLEncoder
    extends java.lang.Object
    This class provides methods to encode a string for use in a URL.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String doubleEncode​(java.lang.String input, java.lang.String encodeFormat)
      Encode the input String with the encode(String, String) method, and then replace (1) character '%' with character '-' and (2) '-' with "--".
      static java.lang.String encode​(java.lang.String input, java.lang.String encodeFormat)
      a-z,A-Z,0-9,_,-,,. remain unencoded ' ' space is converted to a + all other characters are first encoded and then each byte is represented using a %HH format
      static java.lang.String encode​(java.lang.String input, java.lang.String encodeFormat, int maxLength)
      This method URL encodes a string and truncates the string to the maximum lenght specified in maxLength a-z,A-Z,0-9,_,-,*,. remain unencoded all other characters are first encoded and then each byte is represented using a %HH format
      • Methods inherited from class java.lang.Object

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

      • encode

        public static java.lang.String encode​(java.lang.String input,
                                              java.lang.String encodeFormat)
                                       throws java.io.UnsupportedEncodingException
        a-z,A-Z,0-9,_,-,,. remain unencoded ' ' space is converted to a + all other characters are first encoded and then each byte is represented using a %HH format
        Parameters:
        input - the unencoded string
        encodeFormat - the string format
        Returns:
        the encoded string
        Throws:
        java.io.UnsupportedEncodingException - thrown if the named encoding is not supported.
      • encode

        public static java.lang.String encode​(java.lang.String input,
                                              java.lang.String encodeFormat,
                                              int maxLength)
                                       throws java.io.UnsupportedEncodingException
        This method URL encodes a string and truncates the string to the maximum lenght specified in maxLength a-z,A-Z,0-9,_,-,*,. remain unencoded all other characters are first encoded and then each byte is represented using a %HH format
        Parameters:
        input - the unencoded string
        encodeFormat - the string format
        maxLength - maximum string length
        Returns:
        the encoded string
        Throws:
        java.io.UnsupportedEncodingException - thrown if the named encoding is not supported.
        Since:
        MicroStrategy Web 8.0.0
      • doubleEncode

        public static java.lang.String doubleEncode​(java.lang.String input,
                                                    java.lang.String encodeFormat)
                                             throws java.io.UnsupportedEncodingException
        Encode the input String with the encode(String, String) method, and then replace (1) character '%' with character '-' and (2) '-' with "--".
        Parameters:
        input - the input string to encode
        encodeFormat - the format of the string
        Returns:
        the encoded string
        Throws:
        java.io.UnsupportedEncodingException - thrown if the named encoding is not supported.
        Since:
        MicroStrategy Web 7.5.1