Skip to content

Commit

Permalink
TIKA-4326: replace deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
THausherr committed Jan 14, 2025
1 parent 80f384c commit 8a8f169
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Set;

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.apache.commons.io.input.CloseShieldInputStream;
import org.xml.sax.ContentHandler;
Expand Down Expand Up @@ -179,13 +180,12 @@ public void parse(InputStream stream, ContentHandler handler, Metadata metadata,
return;
}

CSVFormat csvFormat = CSVFormat.EXCEL.builder().setDelimiter(params.getDelimiter()).build();
CSVFormat csvFormat = CSVFormat.EXCEL.builder().setDelimiter(params.getDelimiter()).get();
metadata.set(DELIMITER_PROPERTY, textAndCSVConfig.getDelimiterToNameMap().get(csvFormat.getDelimiterString().charAt(0)));

XHTMLContentHandler xhtmlContentHandler = new XHTMLContentHandler(handler, metadata);
int totalRows = 0;
try (org.apache.commons.csv.CSVParser commonsParser = new org.apache.commons.csv.CSVParser(
reader, csvFormat)) {
try (CSVParser commonsParser = CSVParser.builder().setReader(reader).setFormat(csvFormat).get()) {
xhtmlContentHandler.startDocument();
xhtmlContentHandler.startElement(TABLE);
int firstRowColCount = 0;
Expand Down

0 comments on commit 8a8f169

Please sign in to comment.