code: public static boolean deleteDir(File dir) {
          if (dir.isDirectory()) {
              File[] children = dir.listFiles();
              for (File child : children) {
                  boolean success = deleteDir(child);
                  if (!success) {
                      return false;
                  }
              }
          }
          return dir.delete();
      }
docs: 删除目录
  @param dir 目录
  @return 是否成功