public class HttpUnitUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARACTER_SET |
static int |
DEFAULT_TEXT_BUFFER_SIZE |
Constructor and Description |
---|
HttpUnitUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
decode(String byteString)
Returns an interpretation of the specified URL-encoded string, using the iso-8859-1 character set.
|
static String |
decode(String string,
String charset)
Decodes a URL safe string into its original form using the
specified character set.
|
static void |
handleException(Throwable th)
handle Exceptions and thowables
|
static boolean |
isEclipse()
are we running in the Eclipse IDE?
|
protected static boolean |
isEXCEPTION_DEBUG() |
static DocumentBuilder |
newParser()
creates a parser using JAXP API.
|
static Document |
parse(InputSource inputSource)
parse the given inputSource with a new Parser
|
static Document |
parse(InputStream inputStream)
parse the given inputStream with a new Parser
|
static String[] |
parseContentTypeHeader(String header)
Returns the content type and encoding as a pair of strings.
|
static String |
parseISToString(InputStream is)
parse an InputStream to a string (for debugging)
|
static boolean |
setEXCEPTION_DEBUG(boolean exception_debug) |
static String |
stripQuotes(String value)
strip the quotes from a value
|
public static final int DEFAULT_TEXT_BUFFER_SIZE
public static final String DEFAULT_CHARACTER_SET
public static void handleException(Throwable th)
th
- public static boolean isEclipse()
public static String[] parseContentTypeHeader(String header)
header
- the header to parsepublic static String stripQuotes(String value)
value
- public static String decode(String byteString)
public static String decode(String string, String charset)
org.apache.commons.codec.net.URLCodec
class.string
- URL safe string to convert into its original formIllegalArgumentException
- thrown if URL decoding is unsuccessful,public static String parseISToString(InputStream is)
is
- public static Document parse(InputSource inputSource) throws SAXException, IOException
inputSource
- SAXException
IOException
public static Document parse(InputStream inputStream) throws SAXException, IOException
inputStream
- SAXException
IOException
public static DocumentBuilder newParser() throws SAXException
SAXException
protected static boolean isEXCEPTION_DEBUG()
public static boolean setEXCEPTION_DEBUG(boolean exception_debug)
exception_debug
- the eXCEPTION_DEBUG to setCopyright © 2012. All Rights Reserved.