public class

WebURLEncoder

extends Object
java.lang.Object
   ↳ com.microstrategy.utils.WebURLEncoder

Class Overview

This class provides methods to encode a string for use in a URL.

Summary

Public Methods
static String doubleEncode(String input, String encodeFormat)
Encode the input String with the encode(String, String) method, and then replace (1) character '%' with character '-' and (2) '-' with "--".
static String encode(String input, 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,_,-,*,.
static String encode(String input, String encodeFormat)
a-z,A-Z,0-9,_,-,,.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String doubleEncode (String input, String encodeFormat)

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
UnsupportedEncodingException thrown if the named encoding is not supported.

public static String encode (String input, 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

Parameters
input the unencoded string
encodeFormat the string format
maxLength maximum string length
Returns
  • the encoded string
Throws
UnsupportedEncodingException thrown if the named encoding is not supported.

public static String encode (String input, 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

Parameters
input the unencoded string
encodeFormat the string format
Returns
  • the encoded string
Throws
UnsupportedEncodingException thrown if the named encoding is not supported.