Here you can find the source of findDeleteClasspathFile(String filename)
public static void findDeleteClasspathFile(String filename)
/*//from w ww . ja v a2 s . c o m * ************************************************************************************* * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * * ************************************************************************************* */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main{ public static void findDeleteClasspathFile(String filename) { URL url = FileUtil.class.getClassLoader().getResource(filename); if (url != null) { File file = new File(url.getFile()); file.delete(); } } }