Class FileUtil


  • public class FileUtil
    extends Object
    • Constructor Detail

      • FileUtil

        public FileUtil()
    • Method Detail

      • isFilenameValid

        public static boolean isFilenameValid​(String file)
        Only check if a given filename is valid according to the OS rules. You still need to handle other failures when actually creating the file (e.g. insufficient permissions, lack of drive space, security restrictions).
        Parameters:
        file - the name of a file
        Returns:
        true if the file is valid, false otherwise
      • deleteDirectory

        public static void deleteDirectory​(File dir)
      • deleteFile

        public static void deleteFile​(File file)