刪除文件夾

deleteAllFilesOfDir(new File("/mnt/nand/jzby")); file

public static void deleteAllFilesOfDir(File path) {
  if (!path.exists())
   return;
  if (path.isFile()) {
   path.delete();
   return;
  }
  File[] files = path.listFiles();
  for (int i = 0; i < files.length; i++) {
   deleteAllFilesOfDir(files[i]);
  }
  path.delete();
 } static

相關文章
相關標籤/搜索