org.barracudamvc.plankton.http
Class HttpConverter

java.lang.Object
  extended by org.barracudamvc.plankton.http.HttpConverter

public class HttpConverter
extends Object

This class provides a simple series of static methods to convert a Map to a URL String and vica-versa


Field Summary
static gnu.regexp.RE dre1
           
static gnu.regexp.RE dre2
           
static gnu.regexp.RE ere1
           
static gnu.regexp.RE ere2
           
static char ESC_AMP
           
static char ESC_CHAR
           
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
HttpConverter()
           
 
Method Summary
static String cvtMapToURLString(Map map)
          Convert the values in a Map to a URL String (ie. key1=val1&key2=val2&...)
static String cvtMapToURLString(Map map, String delimiter)
          Convert the values in a Map to a URL String (ie. key1=val1&key2=val2&...).
static Map cvtURLStringToMap(String paramStr)
          Convert the values in a URL String (ie. key1=val1&key2=val2&...) to a Map of key/val pairs
static Map cvtURLStringToMap(String paramStr, String delimiter)
          Convert the values in a URL String (ie. key1=val1&key2=val2&...) to a Map of key/val pairs.
static String decode(String s)
          Decode an encoded String - converts %& to & and %% to %
static String encode(String s)
          Encode a String - converts & to %& and % to %%
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

ere1

public static gnu.regexp.RE ere1

ere2

public static gnu.regexp.RE ere2

dre1

public static gnu.regexp.RE dre1

dre2

public static gnu.regexp.RE dre2

ESC_CHAR

public static final char ESC_CHAR
See Also:
Constant Field Values

ESC_AMP

public static final char ESC_AMP
See Also:
Constant Field Values
Constructor Detail

HttpConverter

public HttpConverter()
Method Detail

cvtMapToURLString

public static String cvtMapToURLString(Map map)
Convert the values in a Map to a URL String (ie. key1=val1&key2=val2&...)


cvtMapToURLString

public static String cvtMapToURLString(Map map,
                                       String delimiter)
Convert the values in a Map to a URL String (ie. key1=val1&key2=val2&...). You can specify an alternate delimeter here.


cvtURLStringToMap

public static Map cvtURLStringToMap(String paramStr)
Convert the values in a URL String (ie. key1=val1&key2=val2&...) to a Map of key/val pairs


cvtURLStringToMap

public static Map cvtURLStringToMap(String paramStr,
                                    String delimiter)
Convert the values in a URL String (ie. key1=val1&key2=val2&...) to a Map of key/val pairs. You can specify an alternate delimeter here.


encode

public static String encode(String s)
Encode a String - converts & to %& and % to %%


decode

public static String decode(String s)
Decode an encoded String - converts %& to & and %% to %


main

public static void main(String[] args)


Copyright © 2006 BarracudaMVC.org All Rights Reserved.