private CSVParser createCSVParser(CSVParserSettings parserSettings) { CSVFormat csvFormat = CSVFormat.DEFAULT.withDelimiter(parserSettings.getDelimiter()) .withRecordSeparator(parserSettings.getRecordSeparator()) .withTrim(parserSettings.isTrim()) .withQuote(parserSettings.getQuote()) .withCommentMarker(parserSettings.getCommentMarker()) .withIgnoreEmptyLines(parserSettings.isIgnoreEmptyLines()) .withNullString(parserSettings.getNullString()); try { File file = new File(parserSettings.getPath()); return new CSVParser(new FileReader(file), csvFormat); } catch (Exception e) { throw e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e); } } }
private CSVParser createCSVParser(CSVParserSettings parserSettings) { CSVFormat csvFormat = CSVFormat.DEFAULT.withDelimiter(parserSettings.getDelimiter()) .withRecordSeparator(parserSettings.getRecordSeparator()) .withTrim(parserSettings.isTrim()) .withQuote(parserSettings.getQuote()) .withCommentMarker(parserSettings.getCommentMarker()) .withIgnoreEmptyLines(parserSettings.isIgnoreEmptyLines()) .withNullString(parserSettings.getNullString()); try { File file = new File(parserSettings.getPath()); return new CSVParser(new FileReader(file), csvFormat); } catch (Exception e) { throw e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e); } } }