Java File Path Delete deleteFile(String path, String filename)

Here you can find the source of deleteFile(String path, String filename)

Description

delete File

License

Open Source License

Declaration

public static boolean deleteFile(String path, String filename) throws IOException 

Method Source Code


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

import java.io.*;

public class Main {
    public static boolean deleteFile(String path, String filename) throws IOException {
        File dir = new File(path);
        if (!dir.exists())
            throw new FileNotFoundException("Directory " + path + " doesn't exist.");
        File serverFile = new File(dir.getAbsolutePath() + File.separator + filename);
        boolean result = serverFile.delete();
        return result;
    }//from  w  w w  .j av a 2s  . com
}

Related

  1. deleteFile(String path)
  2. deleteFile(String path)
  3. deleteFile(String path)
  4. deleteFile(String path)
  5. deleteFile(String path)
  6. deleteFile(String strFolderPath, String strFileName)
  7. deleteFile(String strPath)
  8. deleteFile(String strPath, String fileName)
  9. DeleteFileFolder(String path)