Module ilusr.core
Package ilusr.core.io

Class FileUtilities


  • public class FileUtilities
    extends Object
    Author:
    Jeff Riggle
    • Constructor Detail

      • FileUtilities

        public FileUtilities()
    • 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
      • 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