Java File Path Delete delFile(String filePathAndName)

Here you can find the source of delFile(String filePathAndName)

Description

delete file

License

Apache License

Parameter

Parameter Description
filePathAndName String file path and name

Declaration

public static boolean delFile(String filePathAndName) 

Method Source Code


//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;
        }
    }
}

Related

  1. deleteTree(final File path)
  2. deleteWallpaper(String file_name, Map dimmensions, String basepath, List resolution_directories)
  3. delFile(String filePath)
  4. delFile(String filePath, String fileName)
  5. delFile(String filePathAndName)
  6. delFile(String filePathAndName)
  7. delFile(String filePathAndName)
  8. DelFile(String in_Path, ArrayList arrFileList)
  9. delFile(String path)