Here you can find the source of deleteFile(String file)
Parameter | Description |
---|---|
file | file to be deleted |
Parameter | Description |
---|---|
IOException | if an IO Exception occurs |
public static void deleteFile(String file) throws IOException
//package com.java2s; /* DigiDoc4J library/* ww w . jav a 2 s . com*/ * * This software is released under either the GNU Library General Public * License (see LICENSE.LGPL). * * Note that the only valid version of the LGPL license as far as this * project is concerned is the original GNU Library General Public License * Version 2.1, February 1999 */ import java.io.*; public class Main { /** * @param file file to be deleted * @throws IOException if an IO Exception occurs */ public static void deleteFile(String file) throws IOException { File f = new File(file); if (f.exists()) f.delete(); } }