public class JDOMUtils
extends java.lang.Object
| Constructor and Description |
|---|
JDOMUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getResourcePath(java.lang.Object object,
java.lang.String resource)
Return the fully qualified path of the requested resource object.
|
static java.lang.String |
MD5Encode(java.lang.String str)
Make an MD5 Hash from a particular string.
|
static java.lang.String |
toJavaScriptSafeString(java.lang.String content)
Convert a string to a JavaScript safe string (escape quotes and remove cr and lf).
|
static void |
XML2JDOM(java.io.File file,
org.jdom.Document doc)
Generates a Document from a XML file
|
static void |
XML2JDOM(java.io.Reader is,
org.jdom.Document doc)
Generates a Document from a XML input stream
|
static void |
XML2JDOM(java.lang.String xml,
org.jdom.Document doc)
Generates a Document from a XML string.
|
public static void XML2JDOM(java.io.Reader is,
org.jdom.Document doc)
throws java.io.IOException,
org.jdom.JDOMException
is - the input xml streamorg.jdom.JDOMException - if something goes wrong during the parsing processjava.io.IOException - if something goes wrong reading streampublic static void XML2JDOM(java.lang.String xml,
org.jdom.Document doc)
throws java.io.IOException,
org.jdom.JDOMException
xml - the input xml stringorg.jdom.JDOMException - if something goes wrong during the parsing processjava.io.IOException - if something goes wrong reading the streampublic static void XML2JDOM(java.io.File file,
org.jdom.Document doc)
throws java.io.IOException,
org.jdom.JDOMException
file - the input xml file handlejava.io.IOException - if something goes wrong during the parsing processorg.jdom.JDOMExceptionpublic static java.lang.String MD5Encode(java.lang.String str)
throws java.io.UnsupportedEncodingException
str - - the string to be hashed.java.io.UnsupportedEncodingExceptionpublic static java.lang.String getResourcePath(java.lang.Object object,
java.lang.String resource)
object - the requested object typethe - desired resourcepublic static java.lang.String toJavaScriptSafeString(java.lang.String content)
content - the input string