Java File Path Delete deleteFile(String filePathAndName)

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

Description

delete File

License

Open Source License

Declaration

public static boolean deleteFile(String filePathAndName) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {

    public static boolean deleteFile(String filePathAndName) {
        boolean flag = false;
        try {//from  w w w  .ja  v a  2  s  . com
            String filePath = filePathAndName;
            File myDelFile = new File(filePath);
            if (myDelFile.exists()) {
                myDelFile.delete();
                flag = true;
            } else {
                flag = false;
            }
        } catch (Exception e) {
        }
        return flag;
    }
}

Related

  1. deleteFile(String filePath)
  2. deleteFile(String filePath)
  3. deleteFile(String filePath)
  4. deleteFile(String filePath)
  5. deleteFile(String filePath)
  6. deleteFile(String filePathName)
  7. deleteFile(String p_filePath, boolean pb_recursive)
  8. deleteFile(String path)
  9. deleteFile(String path)