Here you can find the source of deleteFile(String file)
public static void deleteFile(String file)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.File; public class Main { public static void deleteFile(String file) { File f = new File(file); if (f.exists() && !f.delete()) { throw new IllegalStateException("Deletion failed " + file); }/* w ww .j a v a 2s .c om*/ } }