Java File Path Delete deleteFile(String strPath)

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

Description

delete File

License

GNU General Public License

Declaration

public static boolean deleteFile(String strPath) 

Method Source Code

//package com.java2s;
/*/*from w  w  w .j  a  va  2 s  .com*/
 * Copyright (C) 2015  University of Oregon
 *
 * You may distribute under the terms of either the GNU General Public
 * License or the Apache License, as specified in the LICENSE file.
 *
 * For more information, see the LICENSE file.
 */

import java.io.*;

public class Main {
    public static boolean deleteFile(String strPath) {
        boolean bOk = true;
        if (strPath == null)
            return false;

        File flItem = new File(strPath);
        if (flItem != null)
            flItem.delete();
        else
            bOk = false;

        return bOk;
    }
}

Related

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