public class FileUtil extends Object
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
delete(File file)
same as file.delete() if 'file' is file; recursively deletes all elements inside if 'file' is directory.
|
static void |
moveFolder(File folder,
File dest,
CopyOption... options)
Move target folder to destination folder.
|
static String |
readFromFile(File file) |
static String |
readFromStream(InputStream stream) |
static void |
writeToFile(File file,
String str) |
public static void writeToFile(File file, String str) throws IOException
file - target filestr - string to saveIOExceptionpublic static String readFromFile(File file) throws UnsupportedEncodingException, IOException
public static String readFromStream(InputStream stream) throws UnsupportedEncodingException, IOException
public static void delete(File file)
file - folder or filepublic static void moveFolder(File folder, File dest, CopyOption... options) throws IOException
folder - dest - options - IOException