if (fileToDelete.exists()) { fileToDelete.delete(); }
    public static boolean deleteFile(File fileToDelete) {        boolean result = true;        if (fileToDelete != null && fileToDelete.exists()) {            if (fileToDelete.isDirectory()) {                File[] files = fileToDelete.listFiles();                if (files == null) {                    result = false;                } else {                    for (int i = 0; i < files.length; i++) {                        File file = files[i];                        if (!file.getName().equals(".") && !file.getName().equals("..")) {                            if (file.isDirectory()) {                                result &= deleteFile(file);                            }                            result &= file.delete();                        }                    }                }            }            result &= fileToDelete.delete();            if (fileToDelete.exists()) {                fileToDelete.delete();            }        }        return result;    }