Set writelimit of default BodyContentHandler to unlimited in TikaDocumentReader

This commit is contained in:
Mark Pollack
2023-12-20 16:13:00 -05:00
parent dd64a50d2f
commit 0657e1bab5
2 changed files with 5 additions and 3 deletions

View File

@@ -111,12 +111,14 @@ public class TikaDocumentReader implements DocumentReader {
}
/**
* Constructor initializing the reader with a resource and a text formatter.
* Constructor initializing the reader with a resource and a text formatter. This
* constructor will create a BodyContentHandler that allows for reading large PDFs
* (constrained only by memory)
* @param resource Resource pointing to the document
* @param textFormatter Formatter for the extracted text
*/
public TikaDocumentReader(Resource resource, ExtractedTextFormatter textFormatter) {
this(resource, new BodyContentHandler(), textFormatter);
this(resource, new BodyContentHandler(-1), textFormatter);
}
/**