public class HttpUnitUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_CHARACTER_SET |
static int |
DEFAULT_TEXT_BUFFER_SIZE |
| Constructor and Description |
|---|
HttpUnitUtils() |
| Modifier and Type | Method and Description |
|---|---|
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 void |
handleException(java.lang.Throwable th)
handle Exceptions and thowables
|
static boolean |
isEclipse()
are we running in the Eclipse IDE?
|
protected static boolean |
isEXCEPTION_DEBUG() |
static javax.xml.parsers.DocumentBuilder |
newParser()
creates a parser using JAXP API.
|
static org.w3c.dom.Document |
parse(org.xml.sax.InputSource inputSource)
parse the given inputSource with a new Parser
|
static org.w3c.dom.Document |
parse(java.io.InputStream inputStream)
parse the given inputStream with a new Parser
|
static java.lang.String[] |
parseContentTypeHeader(java.lang.String header)
Returns the content type and encoding as a pair of strings.
|
static java.lang.String |
parseISToString(java.io.InputStream is)
parse an InputStream to a string (for debugging)
|
static boolean |
setEXCEPTION_DEBUG(boolean exception_debug) |
static java.lang.String |
stripQuotes(java.lang.String value)
strip the quotes from a value
|
public static final int DEFAULT_TEXT_BUFFER_SIZE
public static final java.lang.String DEFAULT_CHARACTER_SET
public static void handleException(java.lang.Throwable th)
th - public static boolean isEclipse()
public static java.lang.String[] parseContentTypeHeader(java.lang.String header)
header - the header to parsepublic static java.lang.String stripQuotes(java.lang.String value)
value - public static java.lang.String decode(java.lang.String byteString)
public static java.lang.String decode(java.lang.String string,
java.lang.String charset)
org.apache.commons.codec.net.URLCodec class.string - URL safe string to convert into its original formjava.lang.IllegalArgumentException - thrown if URL decoding is unsuccessful,public static java.lang.String parseISToString(java.io.InputStream is)
is - public static org.w3c.dom.Document parse(org.xml.sax.InputSource inputSource)
throws org.xml.sax.SAXException,
java.io.IOException
inputSource - org.xml.sax.SAXExceptionjava.io.IOExceptionpublic static org.w3c.dom.Document parse(java.io.InputStream inputStream)
throws org.xml.sax.SAXException,
java.io.IOException
inputStream - org.xml.sax.SAXExceptionjava.io.IOExceptionpublic static javax.xml.parsers.DocumentBuilder newParser()
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected static boolean isEXCEPTION_DEBUG()
public static boolean setEXCEPTION_DEBUG(boolean exception_debug)
exception_debug - the eXCEPTION_DEBUG to set