java upload file deletion method and delete files

    public static  boolean deleteFile(String path) {
        In Flag Boolean = to false ;
 // path database stores path 
       File File = new new File (relative path + path);
         // path to the file is not empty then delete 
        IF (file.isFile ()) {
            file.delete();
            flag = true;
        }
        return flag;
    }

 

Guess you like

Origin www.cnblogs.com/yanchaohui/p/11579422.html