Class HttpUnitUtils
java.lang.Object
com.meterware.httpunit.HttpUnitUtils
Utility code shared by httpunit and servletunit.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns an interpretation of the specified URL-encoded string, using the iso-8859-1 character set.static StringDecodes a URL safe string into its original form using the specified character set.static voidhandle Exceptions and thowablesstatic booleanare we running in the Eclipse IDE?protected static booleanstatic DocumentBuildercreates a parser using JAXP API.static Documentparse(InputStream inputStream) parse the given inputStream with a new Parserstatic Documentparse(InputSource inputSource) parse the given inputSource with a new Parserstatic String[]parseContentTypeHeader(String header) Returns the content type and encoding as a pair of strings.static Stringparse an InputStream to a string (for debugging)static booleansetEXCEPTION_DEBUG(boolean exception_debug) static StringstripQuotes(String value) strip the quotes from a value
-
Field Details
-
DEFAULT_TEXT_BUFFER_SIZE
public static final int DEFAULT_TEXT_BUFFER_SIZE- See Also:
-
DEFAULT_CHARACTER_SET
- See Also:
-
-
Constructor Details
-
HttpUnitUtils
public HttpUnitUtils()
-
-
Method Details
-
handleException
-
isEclipse
public static boolean isEclipse()are we running in the Eclipse IDE?- Returns:
- whether we are running in the Eclipse environment
-
parseContentTypeHeader
-
stripQuotes
-
decode
-
decode
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.URLCodecclass.- Parameters:
string- URL safe string to convert into its original form- Returns:
- original string
- Throws:
IllegalArgumentException- thrown if URL decoding is unsuccessful,
-
parseISToString
parse an InputStream to a string (for debugging)- Parameters:
is-- Returns:
- the string gotten from the inputString
-
parse
parse the given inputSource with a new Parser- Parameters:
inputSource-- Returns:
- the document parsed from the input Source
- Throws:
SAXExceptionIOException
-
parse
parse the given inputStream with a new Parser- Parameters:
inputStream-- Returns:
- the document parsed from the input Stream
- Throws:
SAXExceptionIOException
-
newParser
creates a parser using JAXP API.- Throws:
SAXException
-
isEXCEPTION_DEBUG
protected static boolean isEXCEPTION_DEBUG()- Returns:
- the eXCEPTION_DEBUG
-
setEXCEPTION_DEBUG
public static boolean setEXCEPTION_DEBUG(boolean exception_debug) - Parameters:
exception_debug- the eXCEPTION_DEBUG to set
-