public class FileUtils extends Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFile(File from,
File to)
Copies a file to another location.
|
static void |
copyFile(String fromFilename,
String toFilename)
Copies a file to another location.
|
static String |
getMd5(File file) |
static String |
getSha1(File file) |
static byte[] |
readBytes(File file) |
static String |
readChars(File file,
String charset) |
static Object |
readObject(File file)
To read an object in a quick & dirty way.
|
static String |
readUtf8(File file) |
static void |
updateChecksum(File file,
Checksum checksum) |
static void |
writeBytes(File file,
byte[] content) |
static void |
writeChars(File file,
String charset,
CharSequence text) |
static void |
writeObject(File file,
Object object)
To store an object in a quick & dirty way.
|
static void |
writeUtf8(File file,
CharSequence text) |
public static byte[] readBytes(File file) throws IOException
IOExceptionpublic static void writeBytes(File file, byte[] content) throws IOException
IOExceptionpublic static String readUtf8(File file) throws IOException
IOExceptionpublic static String readChars(File file, String charset) throws IOException
IOExceptionpublic static void writeUtf8(File file, CharSequence text) throws IOException
IOExceptionpublic static void writeChars(File file, String charset, CharSequence text) throws IOException
IOExceptionpublic static void copyFile(File from, File to) throws IOException
IOExceptionpublic static void copyFile(String fromFilename, String toFilename) throws IOException
IOExceptionpublic static Object readObject(File file) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic static void writeObject(File file, Object object) throws IOException
IOExceptionpublic static String getMd5(File file) throws IOException
IOExceptionpublic static String getSha1(File file) throws IOException
IOExceptionpublic static void updateChecksum(File file, Checksum checksum) throws IOException
IOExceptionCopyright © 2016. All rights reserved.