删除目录

// delete folder
	public void deleteFolder(File dir){
		File filelist [] = dir.listFiles();
		int listlen = filelist.length;
		for(int i=0;i<listlen;i++){
			if(filelist[i].isDirectory()){
				deleteFolder(filelist[i]);
			}else{
				filelist[i].delete();
			}
		}
		dir.delete();
	}
	

 

你可能感兴趣的:(删除)