List of usage examples for org.springframework.batch.item.file FlatFileParseException FlatFileParseException
public FlatFileParseException(String message, String input, int lineNumber)
From source file:org.jasig.ssp.util.importer.job.csv.FlatFileItemReaderNewLine.java
private String applyRecordSeparatorPolicy(String line) throws IOException { String record = line;/*from ww w . j av a 2s . c om*/ while (line != null && !recordSeparatorPolicy.isEndOfRecord(record)) { line = this.reader.readLine(); if (line == null) { if (StringUtils.hasText(record)) { // A record was partially complete since it hasn't ended but // the line is null throw new FlatFileParseException("Unexpected end of file before record complete", record, lineCount); } else { // Record has no text but it might still be post processed // to something (skipping preProcess since that was already // done) break; } } else { lineCount++; } record = recordSeparatorPolicy.preProcess(record) + line; } return recordSeparatorPolicy.postProcess(record); }