Here you can find the source of deleteRecursive(File f)
public static void deleteRecursive(File f) throws IOException
//package com.java2s; /***// w w w . j ava 2s. c om * Copyright (C) 2010 Johan Henriksson * This code is under the Endrov / BSD license. See www.endrov.net * for the full text and how to cite. */ import java.io.File; import java.io.IOException; public class Main { /** * Delete directory or file recursively */ public static void deleteRecursive(File f) throws IOException { if (f.isDirectory()) for (File c : f.listFiles()) deleteRecursive(c); f.delete(); } }