Java File Path Delete deleteFile(final String filePathName)

Here you can find the source of deleteFile(final String filePathName)

Description

delete File

License

Open Source License

Declaration

public static boolean deleteFile(final String filePathName) throws IllegalArgumentException 

Method Source Code

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

import java.io.File;

public class Main {

    public static boolean deleteFile(final String filePathName) throws IllegalArgumentException {
        if (doesFileExist(filePathName)) {
            File file = new File(filePathName);
            return file.delete();
        }/*from w  w w .j  a v a  2 s.  c o m*/
        return true;
    }

    public static boolean doesFileExist(final String filePathName) {
        File file = new File(filePathName);
        return file.isFile() && file.exists();
    }
}

Related

  1. deleteEmptyParents(final File path)
  2. deleteFile(File path)
  3. deleteFile(File path)
  4. deleteFile(File path)
  5. deleteFile(final String dirPath, final String fileName)
  6. DeleteFile(String _filePath)
  7. deletefile(String delpath)
  8. deleteFile(String filePath)
  9. deleteFile(String filePath)