- java.lang.Object
-
- ilusr.core.io.FileUtilities
-
public class FileUtilities extends Object
- Author:
- Jeff Riggle
-
-
Constructor Summary
Constructors Constructor Description FileUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteDir(File dir)
static String
getFileContent(File file)
static String
getFileContentWithReturns(File file)
static <T> File
getResourceFile(Class<T> clz, String fileName)
static void
saveToFile(String fileLocation, String content)
-
-
-
Method Detail
-
getResourceFile
public static <T> File getResourceFile(Class<T> clz, String fileName) throws URISyntaxException
- Parameters:
clz
- A @see Class that is in the same package as the resource file.fileName
- The name of the resource file to create.- Returns:
- A @see java.io.File
- Throws:
URISyntaxException
-
getFileContentWithReturns
public static String getFileContentWithReturns(File file) throws IOException
- Throws:
IOException
-
getFileContent
public static String getFileContent(File file) throws IOException
- Parameters:
file
- The file to read from.- Returns:
- The content of the file in a String format.
- Throws:
IOException
-
deleteDir
public static void deleteDir(File dir)
- Parameters:
dir
- The directory to delete.
-
saveToFile
public static void saveToFile(String fileLocation, String content) throws IOException
- Parameters:
fileLocation
- The location to save the file to.content
- The content to save int the file.- Throws:
IOException
-
-