Class FileUtil


  • public class FileUtil
    extends Object
    Useful file utilities.
    Version:
    1.7
    • Constructor Detail

      • FileUtil

        public FileUtil()
    • Method Detail

      • extension

        public static String extension​(String path)
      • deleteFiles

        public static void deleteFiles​(String directoryName)
        Deletes the files in the directory, but does not remove the directory.
      • directoryExists

        public static boolean directoryExists​(String directoryName)
        Returns true if the given directory exists.
      • readText

        public static String readText​(File file)
                               throws IOException
        Gets the contents of a text file as a single String
        Parameters:
        file -
        Returns:
        text file contents
        Throws:
        IOException
      • copyFile

        public static void copyFile​(File source,
                                    File destination)
                             throws IOException
        Copies the source file to the destination filename. Posted by Mark Thornton on Usenet.
        Throws:
        IOException