Here you can find the source of delete(File f)
static void delete(File f)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { static void delete(File f) { boolean success = f.delete(); String path = f.getAbsolutePath(); if (success) { System.out.println("delete file : " + path); } else {/*www .j a va 2 s. c o m*/ throw new IllegalStateException("deleting file failed. " + path); } } }