com.ivata.mask.web.format
Class URLFormat

java.lang.Object
  extended bycom.ivata.mask.web.format.URLFormat
All Implemented Interfaces:
HTMLFormat

public class URLFormat
extends java.lang.Object
implements HTMLFormat

Format a URL by encoding the characters.

ASCII characters 'a' through 'z', 'A' through 'Z', and '0' through '9' remain the same. So do the unreserved characters - _ . ! ~ * ' ().

All other ASCII characters are converted into the form "%ab" where ab is the hex value of the character code.

Note: we used to have our own implementation, but this is now just a wrapper for URLEncoder.

Since:
ivata masks 0.4 (2002-09-24)
Version:
$Revision: 1.3 $
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
URLFormat()
           
 
Method Summary
 java.lang.String format(java.lang.String uRLText)
           Convert the given URL by converting the disallowed characters into two-byte hex representations, preceded by '%'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFormat

public URLFormat()
Method Detail

format

public final java.lang.String format(java.lang.String uRLText)

Convert the given URL by converting the disallowed characters into two-byte hex representations, preceded by '%'.

Specified by:
format in interface HTMLFormat
Parameters:
uRLText - URL to be converted.
Returns:
a string representing the URL, containing only allowed characters.


Copyright © 2001-2005 ivata limited. All Rights Reserved.