com.meterware.httpunit
Class HttpUnitUtils

java.lang.Object
  extended bycom.meterware.httpunit.HttpUnitUtils

public class HttpUnitUtils
extends java.lang.Object

Utility code shared by httpunit and servletunit.


Field Summary
static int DEFAULT_BUFFER_SIZE
           
static java.lang.String DEFAULT_CHARACTER_SET
           
static int DEFAULT_TEXT_BUFFER_SIZE
           
 
Constructor Summary
HttpUnitUtils()
           
 
Method Summary
static java.lang.String decode(java.lang.String byteString)
          Returns an interpretation of the specified URL-encoded string, using the iso-8859-1 character set.
static java.lang.String decode(java.lang.String string, java.lang.String charset)
          Decodes a URL safe string into its original form using the specified character set.
static javax.xml.parsers.DocumentBuilder newParser()
          creates a parser using JAXP API.
static java.lang.String[] parseContentTypeHeader(java.lang.String header)
          Returns the content type and encoding as a pair of strings.
static java.lang.String stripQuotes(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEXT_BUFFER_SIZE

public static final int DEFAULT_TEXT_BUFFER_SIZE
See Also:
Constant Field Values

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values

DEFAULT_CHARACTER_SET

public static final java.lang.String DEFAULT_CHARACTER_SET
See Also:
Constant Field Values
Constructor Detail

HttpUnitUtils

public HttpUnitUtils()
Method Detail

parseContentTypeHeader

public static java.lang.String[] parseContentTypeHeader(java.lang.String header)
Returns the content type and encoding as a pair of strings. If no character set is specified, the second entry will be null.


stripQuotes

public static java.lang.String stripQuotes(java.lang.String value)

decode

public static java.lang.String decode(java.lang.String byteString)
Returns an interpretation of the specified URL-encoded string, using the iso-8859-1 character set.

Since:
1.6

decode

public static java.lang.String decode(java.lang.String string,
                                      java.lang.String charset)
Decodes a URL safe string into its original form using the specified character set. Escaped characters are converted back to their original representation. This method is copied from the Jakarta Commons Codec; org.apache.commons.codec.net.URLCodec class.

Parameters:
string - URL safe string to convert into its original form
Returns:
original string
Throws:
java.lang.IllegalArgumentException - thrown if URL decoding is unsuccessful,

newParser

public static javax.xml.parsers.DocumentBuilder newParser()
                                                   throws org.xml.sax.SAXException
creates a parser using JAXP API.

Throws:
org.xml.sax.SAXException

Copyright © 2000-2006 Russell Gold. See license agreement for rights granted.