Here you can find the source of deleteFile(String path)
Parameter | Description |
---|---|
path | a parameter |
public static int deleteFile(String path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*w ww.j a v a 2 s . c o m*/ * deleteFile * * @param path * @return */ public static int deleteFile(String path) { int res = 0; File temp = new File(path); if (temp.exists() && temp.delete()) { res = 1; } return res; } /** * existFile * * @param path * @return */ public static boolean exists(String path) { try { File temp = new File(path); return temp.exists(); } catch (Exception e) { // ignore } return false; } }