|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.curate.Utils
public class Utils
Utils contains a few commonly occurring methods.
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static String |
checksum(File file,
String algorithm)
Calculates and returns a checksum for the passed file using the passed algorithm. |
static String |
checksum(InputStream in,
String algorithm)
Calculates and returns a checksum for the passed IO stream using the passed algorithm. |
static void |
copy(File inFile,
File outFile)
Performs a buffered copy from one file into another. |
static void |
copy(InputStream in,
OutputStream out)
Performs a buffered copy from one IO stream into another. |
static String |
toHex(byte[] data)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static String checksum(File file,
String algorithm)
throws IOException
file - file on which to calculate checksumalgorithm - string for algorithm: 'MD5', 'SHA1', etc
IOException
public static String checksum(InputStream in,
String algorithm)
throws IOException
in - input stream on which to calculate checksumalgorithm - string for algorithm: 'MD5', 'SHA1', etc
IOExceptionpublic static String toHex(byte[] data)
public static void copy(File inFile,
File outFile)
throws IOException
inFile - outFile -
IOException
public static void copy(InputStream in,
OutputStream out)
throws IOException
in - input streamout - output stream
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||