public class DataUtils
extends java.lang.Object
| Constructor and Description |
|---|
DataUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.w3c.dom.Document |
getDocumentFromBytes(byte[] data)
Creates an XML document object from a byte array.
|
static org.w3c.dom.Document |
getDocumentFromFile(java.io.File file)
Creates an XML document object from a file.
|
static org.w3c.dom.Document |
getDocumentFromFile(java.lang.String filename)
Creates an XML document object from a file.
|
static java.lang.String |
getHash(byte[] data)
Generates an MD5 checksum of a series of bytes.
|
static byte[] |
loadFile(java.io.File file)
Loads a file into a byte array.
|
static byte[] |
loadFile(java.lang.String filename)
Loads a file into a byte array.
|
public static org.w3c.dom.Document getDocumentFromFile(java.lang.String filename)
throws java.lang.Exception
file - the filename of the file to load.java.lang.Exceptionpublic static org.w3c.dom.Document getDocumentFromFile(java.io.File file)
throws java.lang.Exception
file - the file to load.java.lang.Exceptionpublic static org.w3c.dom.Document getDocumentFromBytes(byte[] data)
throws java.lang.Exception
file - the file to load.java.lang.Exceptionpublic static byte[] loadFile(java.lang.String filename)
throws java.lang.Exception
filename - name of file to load.java.lang.Exceptionpublic static byte[] loadFile(java.io.File file)
throws java.lang.Exception
File - to load.java.lang.Exceptionpublic static java.lang.String getHash(byte[] data)
throws java.security.NoSuchAlgorithmException
data - the byte array on which to compute the hash.java.security.NoSuchAlgorithmExceptionCopyright © 2014 DuraSpace. All Rights Reserved.