class="java"> /** * 删除文件及目录 * @param folder */ public void deleteFolder(File folder){ File[] files = folder.listFiles(); if (files != null) { for (File file : files) { if (file.isDirectory()) { deleteFolder(file); } else { file.delete(); } } } folder.delete(); }