Here you can find the source of delFile(String filePathAndName)
Parameter | Description |
---|---|
filePathAndName | String file path and name |
public static boolean delFile(String filePathAndName)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**//from w w w. j a va 2 s . c o m * delete file * * @param filePathAndName String file path and name */ public static boolean delFile(String filePathAndName) { try { File file = new File(filePathAndName); return file.delete(); } catch (Exception e) { System.out.println("delete file failed"); e.printStackTrace(); return false; } } }