Class MGL_FileUtils

java.lang.Object
tech.mgl.core.utils.MGL_FileUtils

public class MGL_FileUtils extends Object
  • Constructor Details

    • MGL_FileUtils

      public MGL_FileUtils()
  • Method Details

    • getFileCreate

      public static File getFileCreate(String path)
      获取文件 如不存在自动创建
      Parameters:
      path - create path
      Returns:
      File
    • getFileCPDir

      public static File getFileCPDir(String path)
      自动创建父目录的 并获取文件
      Parameters:
      path - 指定目录
      Returns:
      File
    • getDirectoryCDir

      public static File getDirectoryCDir(String path)
      获取目录 如不存在自动创建
      Parameters:
      path - 指定路径
      Returns:
      File 返回指定的目录文件类型
    • getAll

      public static List<Path> getAll(String path)
      获取指定路径下的所有文件及文件夹
      Parameters:
      path - 指定的路径
      Returns:
      List
    • delete

      public static boolean delete(String path)
    • delete

      public static boolean delete(File file)
    • deleteAll

      public static void deleteAll(String dir)
      迭代删除所有子文件夹文件夹及文件
      Parameters:
      dir - 指定路径