public class FileIOUtils extends Object
| Constructor and Description |
|---|
FileIOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyDirectoryAndOverwriteFilesIfNeeded(File srcDir,
File destDir)
Method similar to FileUtils.copyDirectory, but with overwrite
|
static List<File> |
getRecursivelyAllFilesInAllSubfolders(File folder,
String suffix) |
static List<File> |
getRecursivelyAllFilesInAllSubfolders(String base,
String suffix)
Scan the
base folder, and return a list of all files with the given name ending |
static List<String> |
readFile(File file)
Read file line by line into list.
|
static <T> T |
readXML(String fileName)
Write string to file
|
static void |
writeFile(String content,
File file)
Write string to file
|
static void |
writeFile(String content,
String fileName)
Write string to file
|
static void |
writeXML(Object data,
String fileName)
Write string to file
|
public static List<String> readFile(File file)
file - - file to read frompublic static void writeFile(String content, String fileName)
fileName - - name of the file to write tocontent - - text to write into the filepublic static void writeFile(String content, File file)
file - - file to write tocontent - - text to write into the filepublic static void writeXML(Object data, String fileName)
fileName - - name of the file to write todata - a Object object.public static <T> T readXML(String fileName)
T - a T object.fileName - - name of the file to write topublic static List<File> getRecursivelyAllFilesInAllSubfolders(File folder, String suffix) throws IllegalArgumentException
IllegalArgumentExceptionpublic static List<File> getRecursivelyAllFilesInAllSubfolders(String base, String suffix) throws IllegalArgumentException
base folder, and return a list of all files with the given name endingbase - suffix - IllegalArgumentExceptionpublic static void copyDirectoryAndOverwriteFilesIfNeeded(File srcDir, File destDir) throws IllegalArgumentException, IOException
srcDir - destDir - IllegalArgumentExceptionIOExceptionCopyright © 2010–2017 EvoSuite. All rights reserved.