Here you can find the source of deleteFiles(final ArrayList
public static void deleteFiles(final ArrayList<File> files)
//package com.java2s; //License from project: GNU General Public License import java.io.File; import java.util.ArrayList; public class Main { public static void deleteFiles(final ArrayList<File> files) { if (files == null) return; for (int i = 0; i < files.size(); i++) { File file = files.get(i); if (file == null) continue; deleteFile(file);//from w ww . j a v a2s.com } } public static void deleteFile(final File file) { if (file.isDirectory()) { for (String aChild : file.list()) { deleteFile(new File(file, aChild)); } } } }