Here you can find the source of deletefile(String fileName)
Parameter | Description |
---|---|
dir | a parameter |
fileName | a parameter |
public static void deletefile(String fileName)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/* ww w . j av a 2s .c om*/ * This is deleted xml file after compressing * @param dir * @param fileName */ public static void deletefile(String fileName) { File f1 = new File(fileName); if (f1.exists()) { if (f1.isFile()) { boolean success = f1.delete(); if (!success) { System.out.println("File : " + fileName + " Deletion failed."); } else { System.out.println("File : " + fileName + " deleted. "); } } } } }