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