private void visit(Set<String> names, String prefix, File file) { for (File child : file.listFiles()) { if (child.isFile()) { names.add(prefix + child.getName()); } else if (child.isDirectory()) { visit(names, prefix + child.getName() + "/", child); } } }
private static void delete(File directory) { for (File file : directory.listFiles()) { if (file.isDirectory()) { delete(file); } else { assertTrue(file.delete()); } } assertTrue(directory.delete()); }