|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.test.fesl.util.DataUtils
public class DataUtils
Utility class for managing documents.
| Constructor Summary | |
|---|---|
DataUtils()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataUtils()
| Method Detail |
|---|
public static Document getDocumentFromFile(String filename)
throws Exception
file - the filename of the file to load.
Exception
public static Document getDocumentFromFile(File file)
throws Exception
file - the file to load.
Exception
public static Document getDocumentFromBytes(byte[] data)
throws Exception
file - the file to load.
Exception
public static byte[] loadFile(String filename)
throws Exception
filename - name of file to load.
Exception
public static byte[] loadFile(File file)
throws Exception
File - to load.
Exception
public static String getHash(byte[] data)
throws NoSuchAlgorithmException
data - the byte array on which to compute the hash.
NoSuchAlgorithmException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||