Java File Path Delete DeleteFile(String _filePath)

Here you can find the source of DeleteFile(String _filePath)

Description

Delete File

License

Open Source License

Declaration

public static void DeleteFile(String _filePath) 

Method Source Code

//package com.java2s;
// modify it under the terms of the GNU General Public License

import java.io.File;

public class Main {
    public static void DeleteFile(String _filePath) {

        if (_filePath == null || _filePath.isEmpty()) {
            return;
        }//from w  w w  .  j  a v  a2 s . c  o  m

        File file = new File(_filePath);
        if (file.exists()) {
            try {
                if (!file.delete()) {
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

Related

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