/**
     * 删除目录
     *
     */
    public static boolean deleteDir(File dir) {
        if (dir.isDirectory()) {
            String[] children = dir.list();
            for (int i = 0; i < children.length; i++) {
                boolean success = deleteDir(new File(dir, children[i]));
                if (!success) {
                    return false;
                }
            }
        }
        return dir.delete();
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-08-05
  • 2022-12-23
  • 2022-01-29
  • 2021-10-09
猜你喜欢
  • 2021-06-27
  • 2021-10-25
  • 2021-06-06
  • 2022-01-16
  • 2022-12-23
  • 2021-08-02
  • 2021-09-21
相关资源
相似解决方案