public class MwsUtl extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable a)
Close a Closeable if it is not null.
|
static String |
escapeAppName(String s)
Escape application name before using to form user agent string.
|
static String |
escapeAppVersion(String s)
Escape an application version string.
|
static String |
escapeAttributeName(String s)
Standardize and escape an attribute name.
|
static String |
escapeAttributeValue(String s)
Standardize and escape an attribute value.
|
static DatatypeFactory |
getDTF()
Get a thread local DatatypeFactory.
|
static TransformerFactory |
getTF()
Get a thread local transformer factory.
|
protected static String |
urlEncode(String value,
boolean path)
URL encode a value.
|
static RuntimeException |
wrap(Throwable e)
Wrap Checked exceptions in runtime exception.
|
protected static String urlEncode(String value, boolean path)
value - path - true if is a path and '/' should not be encoded.public static void close(Closeable a)
a - The Closeable or null.public static String escapeAppName(String s)
Clean up white space and then escape back slash and forward slash characters.
s - public static String escapeAppVersion(String s)
s - public static String escapeAttributeName(String s)
Clean white space. Escape back-slashes and equals-sign with a back-slash.
s - The attribute name to standardize and escape.public static String escapeAttributeValue(String s)
Clean white space. Escape back-slashes, semi-colons, and right parenthesis with a back-slash.
s - The attribute value to standardize and escape.public static DatatypeFactory getDTF()
DatatypeFactory is NOT required to be thread safe. This method uses a thread local to create one per calling thread.
public static TransformerFactory getTF()
public static RuntimeException wrap(Throwable e)
e - Copyright © 2014. All Rights Reserved.