private static void deletefile(String file) {
        try {
            File f1 = new File(file);
            boolean success = f1.delete();
            if (success) {
                EIError.debugMsg("File deleted " + file, EIError.ErrorLevel.Notice);
            } else {
                EIError.debugMsg("Couldn't delete file " + file, EIError.ErrorLevel.Error);
            }
        } catch (Exception e) {
            EIError.debugMsg("Couldn't delete file " + file + " " + e.getMessage(), EIError.ErrorLevel.Error);
        }
    }