use of au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy in project the-app by devops-dojo.
the class AbstractCsvReader method parseCsv.
public List<T> parseCsv() throws IOException {
ClassPathResource classPathResource = new ClassPathResource(getClassPathFilePath(), this.getClass().getClassLoader());
InputStreamReader ioReader = new InputStreamReader(classPathResource.getInputStream(), "UTF-8");
CSVReader reader = new CSVReader(ioReader, ';');
ColumnPositionMappingStrategy<T> strat = new ColumnPositionMappingStrategy<>();
strat.setType(getDestinationClass());
strat.setColumnMapping(getColumnMapping());
CsvToBean<T> csv = getParser();
return csv.parse(strat, reader);
}
Aggregations