wt.httpgw
Class WTURLEncoder

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.ByteArrayOutputStream
          extended bywt.httpgw.WTURLEncoder

public class WTURLEncoder
extends ByteArrayOutputStream

The class contains a utility method for converting a String into a MIME format called "x-www-form-urlencoded" and vice versa.

To convert a String, each character is examined in turn:


Deployment Notes:



Deprecated

See Also:
EncodingConverter

Supported API: false
Extendable: false

Field Summary
(package private) static WTURLEncoder byteBuf
          Deprecated.  
(package private) static ByteArrayOutputStream convertBuf
          Deprecated.  
private static EncodingConverter cvDecoder
          Deprecated.  
private static EncodingConverter cvEncoder
          Deprecated.  
(package private) static OutputStreamWriter defaultWriter
          Deprecated.  
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
private WTURLEncoder()
          Deprecated.  
 
Method Summary
static String decode(String s)
          Deprecated. Translates a string from x-www-form-urlencoded format back into a string.
static String decode(String encoded, String encoding)
          Deprecated. Translates a string from x-www-form-urlencoded format back the original string.
static String encode(String s)
          Deprecated.  
static void encode(StringBuffer buf, String s)
          Deprecated.  
static void encode(StringBuffer buf, String s, String encoding)
          Deprecated.  
static String encode(String s, String encoding)
          Deprecated.  
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

byteBuf

static WTURLEncoder byteBuf
Deprecated. 

convertBuf

static ByteArrayOutputStream convertBuf
Deprecated. 

defaultWriter

static OutputStreamWriter defaultWriter
Deprecated. 

cvDecoder

private static EncodingConverter cvDecoder
Deprecated. 

cvEncoder

private static EncodingConverter cvEncoder
Deprecated. 
Constructor Detail

WTURLEncoder

private WTURLEncoder()
Deprecated. 
Method Detail

encode

public static String encode(String s)
Deprecated.  

Translates a string into x-www-form-urlencoded format. Hex escaped characters are first encoded using UTF8 character encoding before Hex escaping the resulting bytes. This produces an encoded string that can be decoded without loss of data.

Parameters:
s - String to be translated.
Returns:
the translated String.
See Also:
wt.httpgw.EncodingConverter.encode(String)

encode

public static String encode(String s,
                            String encoding)
Deprecated.  

Translates a string into x-www-form-urlencoded format. Hex escaped characters are first encoded using the given character encoding before Hex escaping the resulting bytes.

Parameters:
s - String to be translated.
encoding - the character encoding name
Returns:
the translated String.
See Also:
wt.httpgw.EncodingConverter.encode(String,String)

encode

public static void encode(StringBuffer buf,
                          String s)
Deprecated.  

Translates a string into x-www-form-urlencoded format. Hex escaped characters are first encoded using UTF8 character encoding before Hex escaping the resulting bytes. This produces an encoded string that can be decoded without loss of data.

Parameters:
buf - StringBuffer to receive encoded characters.
s - String to be translated.
See Also:
wt.httpgw.EncodingConverter.encode(StringBuffer,String)

encode

public static void encode(StringBuffer buf,
                          String s,
                          String encoding)
Deprecated.  

Translates a string into x-www-form-urlencoded format. Hex escaped characters are first encoded using the given character encoding before Hex escaping the resulting bytes.

Parameters:
buf - StringBuffer to receive encoded characters.
s - String to be translated.
encoding - the character encoding name
See Also:
wt.httpgw.EncodingConverter.encode(StringBuffer,String,String)

decode

public static String decode(String s)
Deprecated. 
Translates a string from x-www-form-urlencoded format back into a string. Hex escaped bytes are converted and the resulting sequence of 8-bit values is converted to characters using UTF8 encoding. This produces a decoded string from the results of encode without loss data.

Parameters:
s - String to be translated.
Returns:
the translated String.
See Also:
wt.httpgw.EncodingConverter.deocde(String)

decode

public static String decode(String encoded,
                            String encoding)
Deprecated. 
Translates a string from x-www-form-urlencoded format back the original string. Hex escaped bytes are converted and the resulting sequence of 8-bit values is converted to characters using the given character encoding.

Parameters:
encoded - String to be translated.
encoding - the character encoding name
Returns:
the translated String.
See Also:
wt.httpgw.EncodingConverter.deocde(String,String)