Here you can find the source of deleteFile(String file)
Parameter | Description |
---|---|
file | a parameter |
public static boolean deleteFile(String file)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**//w w w .ja va2 s .c om * Delete a file * * @param file * @return */ public static boolean deleteFile(String file) { File f = new File(file); if (f.exists() && f.isFile()) { return f.delete(); } return true; } /** * Check if it is a valid file * * @param file * @return */ public static boolean isFile(String file) { File f = new File(file); return f.exists() && f.isFile(); } }