Here you can find the source of deleteFile(String strPath)
public static boolean deleteFile(String strPath)
//package com.java2s; /*/*from w w w .j a va 2 s .com*/ * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ import java.io.*; public class Main { public static boolean deleteFile(String strPath) { boolean bOk = true; if (strPath == null) return false; File flItem = new File(strPath); if (flItem != null) flItem.delete(); else bOk = false; return bOk; } }