private CSVRecord getNextRecord() { try { return CSVParser.this.nextRecord(); } catch (final IOException e) { throw new IllegalStateException( e.getClass().getSimpleName() + " reading next record: " + e.toString(), e); } }
/** * Parses the CSV input according to the given format and returns the content as a list of * {@link CSVRecord CSVRecords}. * * <p> * The returned content starts at the current parse-position in the stream. * </p> * * @return list of {@link CSVRecord CSVRecords}, may be empty * @throws IOException * on parse error or input read-failure */ public List<CSVRecord> getRecords() throws IOException { CSVRecord rec; final List<CSVRecord> records = new ArrayList<>(); while ((rec = this.nextRecord()) != null) { records.add(rec); } return records; }
if (formatHeader.length == 0) { final CSVRecord nextRecord = this.nextRecord(); if (nextRecord != null) { headerRecord = nextRecord.values(); this.nextRecord();
private CSVRecord getNextRecord() { try { return CSVParser.this.nextRecord(); } catch (final IOException e) { // TODO: This is not great, throw an ISE instead? throw new RuntimeException(e); } }
private CSVRecord getNextRecord() { try { return CSVParser.this.nextRecord(); } catch (final IOException e) { throw new IllegalStateException( e.getClass().getSimpleName() + " reading next record: " + e.toString(), e); } }
private CSVRecord getNextRecord() { try { return CSVParser.this.nextRecord(); } catch (final IOException e) { throw new IllegalStateException( e.getClass().getSimpleName() + " reading next record: " + e.toString(), e); } }
/** * Parses the CSV input according to the given format and returns the content as a list of * {@link CSVRecord CSVRecords}. * * <p> * The returned content starts at the current parse-position in the stream. * </p> * * @return list of {@link CSVRecord CSVRecords}, may be empty * @throws IOException * on parse error or input read-failure */ public List<CSVRecord> getRecords() throws IOException { CSVRecord rec; final List<CSVRecord> records = new ArrayList<>(); while ((rec = this.nextRecord()) != null) { records.add(rec); } return records; }
/** * Parses the CSV input according to the given format and returns the content as a list of * {@link CSVRecord CSVRecords}. * * <p> * The returned content starts at the current parse-position in the stream. * </p> * * @return list of {@link CSVRecord CSVRecords}, may be empty * @throws IOException * on parse error or input read-failure */ public List<CSVRecord> getRecords() throws IOException { CSVRecord rec; List<CSVRecord> records = new ArrayList<CSVRecord>(); while ((rec = this.nextRecord()) != null) { records.add(rec); } return records; }
/** * Parses the CSV input according to the given format and returns the content as a list of * {@link CSVRecord CSVRecords}. * * <p> * The returned content starts at the current parse-position in the stream. * </p> * * @return list of {@link CSVRecord CSVRecords}, may be empty * @throws IOException * on parse error or input read-failure */ public List<CSVRecord> getRecords() throws IOException { CSVRecord rec; final List<CSVRecord> records = new ArrayList<>(); while ((rec = this.nextRecord()) != null) { records.add(rec); } return records; }
public String[][] getInfo() throws IOException { final CSVParser parser = new CSVParser(new FileReader(new InputStreamReader(new GZIPInputStream(fileinput)), CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(true)); String[][] result = parser.nextRecord().values(); return result; }
if (formatHeader.length == 0) { final CSVRecord nextRecord = this.nextRecord(); if (nextRecord != null) { headerRecord = nextRecord.values(); this.nextRecord();
if (formatHeader.length == 0) { final CSVRecord nextRecord = this.nextRecord(); if (nextRecord != null) { headerRecord = nextRecord.values(); this.nextRecord();
if (formatHeader.length == 0) { final CSVRecord nextRecord = this.nextRecord(); if (nextRecord != null) { headerRecord = nextRecord.values(); this.nextRecord();