Class FileUtil


  • public class FileUtil
    extends Object
    File-related utility functions.
    • Constructor Detail

      • FileUtil

        public FileUtil()
    • Method Detail

      • setContents

        public static void setContents​(String textFileName,
                                       String contents)
                                throws IOException
        Saves the String to a file with the given filename.
        Parameters:
        textFileName - the pathname of the file to create (or overwrite)
        contents - the data to save
        Throws:
        IOException - if an I/O error occurs.
      • setContents

        public static void setContents​(String textFileName,
                                       List lines)
                                throws IOException
        Saves the List of Strings to a file with the given filename.
        Parameters:
        textFileName - the pathname of the file to create (or overwrite)
        lines - the Strings to save as lines in the file
        Throws:
        IOException - if an I/O error occurs.