class ImporterSpreadsheetCSV extends AbstractImporterSpreadsheet {

    protected char fieldDelimiter = ',';
    protected Charset charset = StandardCharsets.UTF_8;

    @Override
    public SheetParser createParserWithoutHeaders() throws IOException {
        return createParser(false);
    }

    @Override
    public SheetParser createParser() throws IOException {
        boolean withFirstRecordAsHeader
            = generalConfig.getMode() == SpreadsheetGeneralConfiguration.Mode.NODES_TABLE
            || generalConfig.getMode() == SpreadsheetGeneralConfiguration.Mode.EDGES_TABLE;

        return createParser(withFirstRecordAsHeader);
    }

    private SheetParser createParser(boolean withFirstRecordAsHeader) throws IOException {<FILL_FUNCTION_BODY>}

    @Override
    public void refreshAutoDetections() {
        autoDetectCharset();
        autoDetectFieldDelimiter();
        super.refreshAutoDetections();
    }

    private void autoDetectCharset() {
        //Try to auto-detect the charset:
        try {
            FileInputStream is = new FileInputStream(file);
            CharsetToolkit charsetToolkit = new CharsetToolkit(is);
            charsetToolkit.setDefaultCharset(StandardCharsets.UTF_8);
            charset = charsetToolkit.getCharset();
        } catch (Exception ex) {
        }
    }

    private void autoDetectFieldDelimiter() {
        FileObject fileObject = FileUtil.toFileObject(file);
        //Return if file is empty
        if (fileObject.getSize() == 0) {
            return;
        }

        //Very simple naive detector but should work in most cases:
        try (LineNumberReader reader = ImportUtils.getTextReader(fileObject)) {
            String line = reader.readLine().trim()
                .replaceAll(" , ", ",").replaceAll(" ; ", ";");

            //Check for typical delimiter chars in the header
            int commaCount = 0;
            int semicolonCount = 0;
            int tabCount = 0;
            int spaceCount = 0;

            boolean inQuote = false;
            for (char c : line.toCharArray()) {
                if (c == '"' || c == '\'') {
                    inQuote = !inQuote;
                }

                if (!inQuote) {
                    switch (c) {
                        case ',':
                            commaCount++;
                            break;
                        case ';':
                            semicolonCount++;
                            break;
                        case '\t':
                            tabCount++;
                            break;
                        case ' ':
                            spaceCount++;
                            break;
                    }
                }
            }

            int max = Collections.max(Arrays.asList(commaCount, semicolonCount, tabCount, spaceCount));
            if (commaCount == max) {
                fieldDelimiter = ',';
            } else if (semicolonCount == max) {
                fieldDelimiter = ';';
            } else if (tabCount == max) {
                fieldDelimiter = '\t';
            } else if (spaceCount == max) {
                fieldDelimiter = ' ';
            }
        } catch (IOException ex) {
        }
    }

    public char getFieldDelimiter() {
        return fieldDelimiter;
    }

    public void setFieldDelimiter(char fieldDelimiter) {
        this.fieldDelimiter = fieldDelimiter;
    }

    public Charset getCharset() {
        return charset;
    }

    public void setCharset(Charset charset) {
        this.charset = charset;
    }
}

        try {
            CSVParser csvParser =
                SpreadsheetUtils.configureCSVParser(file, fieldDelimiter, charset, withFirstRecordAsHeader);
            return new CSVSheetParser(csvParser);
        } catch (Exception ex) {
            if (report != null) {
                SpreadsheetUtils.logError(report, ex.getMessage(), null);
                return EmptySheet.INSTANCE;
            } else {
                return new ErrorSheet(ex.getMessage());
            }
        }
    
<methods>public non-sealed void <init>() ,public boolean cancel() ,public abstract org.gephi.io.importer.plugin.file.spreadsheet.sheet.SheetParser createParser() throws java.io.IOException,public abstract org.gephi.io.importer.plugin.file.spreadsheet.sheet.SheetParser createParserWithoutHeaders() throws java.io.IOException,public boolean execute(org.gephi.io.importer.api.ContainerLoader) ,public Class#RAW getColumnClass(java.lang.String) ,public Map<java.lang.String,Class#RAW> getColumnsClasses() ,public org.gephi.io.importer.api.ContainerLoader getContainer() ,public java.io.File getFile() ,public List<org.gephi.io.importer.plugin.file.spreadsheet.sheet.SheetRow> getFirstRows(int) throws java.io.IOException,public List<org.gephi.io.importer.plugin.file.spreadsheet.sheet.SheetRow> getFirstRows(org.gephi.io.importer.plugin.file.spreadsheet.sheet.SheetParser, int) throws java.io.IOException,public Map<java.lang.String,java.lang.Integer> getHeadersMap() throws java.io.IOException,public org.gephi.io.importer.plugin.file.spreadsheet.process.SpreadsheetGeneralConfiguration.Mode getMode() ,public org.gephi.io.importer.api.Report getReport() ,public TimeRepresentation getTimeRepresentation() ,public DateTimeZone getTimeZone() ,public void refreshAutoDetections() ,public void setColumnClass(java.lang.String, Class#RAW) ,public void setColumnsClasses(Map<java.lang.String,Class#RAW>) ,public void setFile(java.io.File) ,public void setMode(org.gephi.io.importer.plugin.file.spreadsheet.process.SpreadsheetGeneralConfiguration.Mode) ,public void setProgressTicket(org.gephi.utils.progress.ProgressTicket) ,public void setReader(java.io.Reader) ,public void setTimeRepresentation(TimeRepresentation) ,public void setTimeZone(DateTimeZone) <variables>private static final int MAX_ROWS_TO_ANALYZE_COLUMN_TYPES,protected boolean cancel,protected org.gephi.io.importer.api.ContainerLoader container,protected java.io.File file,protected final org.gephi.io.importer.plugin.file.spreadsheet.process.SpreadsheetGeneralConfiguration generalConfig,protected org.gephi.io.importer.plugin.file.spreadsheet.process.AbstractImportProcess importer,protected org.gephi.utils.progress.ProgressTicket progressTicket,protected org.gephi.io.importer.api.Report report