org.mmbase.util
Class URLParamEscape

java.lang.Object
  |
  +--org.mmbase.util.URLParamEscape

public class URLParamEscape
extends java.lang.Object

Escapes and Unescapes undesirable characters using % (URLEncoding) but keeps param makers alive (needs to be checked if used and if it can't be combined in URLEscape). The only difference with URLEscape is that the plus-sign ('+') is escaped.


Constructor Summary
URLParamEscape()
           
 
Method Summary
static java.lang.String escapeurl(java.lang.String str)
          Escape a url.
static void main(java.lang.String[] args)
          Method for testing this class from the command line
static java.lang.String unescapeurl(java.lang.String str)
          Unescape a url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLParamEscape

public URLParamEscape()
Method Detail

escapeurl

public static java.lang.String escapeurl(java.lang.String str)
Escape a url. Replaces 'invalid characters' with their Escaped code, i.e. the questionmark (?) is escaped with %3F.
Parameters:
url - the urls to escape
Returns:
the escaped url.

unescapeurl

public static java.lang.String unescapeurl(java.lang.String str)
Unescape a url. Replaces escapesequenced with the actual character. i.e %3F is replaced with the the questionmark (?).
Parameters:
url - the urls to unescape
Returns:
the unescaped url.

main

public static void main(java.lang.String[] args)
Method for testing this class from the command line


MMBase 2002