Here you can find the source of delete(File f)
public static void delete(File f)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void delete(File f) { if (f.isDirectory()) { for (File c : f.listFiles()) delete(c);// www . ja va 2s . c om } if (!f.delete()) System.out.println( "Failed to delete file: " + f + " file does " + f.exists() + " exists (false = not..)"); } }