package no.valg.valgnatt.database.forberedvalg.csv;

import java.io.IOException;

import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.io.ICsvReader;
import org.supercsv.prefs.CsvPreference;

public abstract class Csv {

    private String fileName;
    private CellProcessor[] processors;
    private String[] header;

    public Csv(String fileName, CellProcessor... processors) {
        this.fileName = fileName;
        this.processors = processors;
    }

    public String getFileName() {
        return fileName;
    }

    public CellProcessor[] getProcessors() {
        return processors;
    }

    public CsvPreference getPreference() {
        return CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE;
    }

    public void readHeader(ICsvReader csvReader) throws IOException {
        header = csvReader.getHeader(true);
    }

    public String[] getHeader() {
        return header;
    }

    public void setHeader(String[] header) {
        this.header = header;
    }
}
