Java Delete File deleteFile(String fileName)

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

Description

delete File

License

Open Source License

Parameter

Parameter Description
fileName a parameter

Return

: boolean

Declaration

public static boolean deleteFile(String fileName) 

Method Source Code

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

import java.io.File;

public class Main {

    public static boolean deleteFile(String fileName) {
        File file = new File(fileName);
        if (file.exists() && file.isFile()) {
            return file.delete();
        }/*from   w  w  w . j  a  v  a 2  s  .  co m*/
        return true;
    }
}

Related

  1. deletefile(String fileName)
  2. deleteFile(String FileName)
  3. deleteFile(String fileName)
  4. deleteFile(String filename)
  5. deleteFile(String fileName)
  6. deleteFile(String fileName)
  7. deleteFile(String fileName)
  8. deleteFile(String fileName)
  9. deleteFile(String fileName)