On Tue, 14 Jun 2011, Antoni Mylka wrote:
You are right. There is still room for improvement. ZipContainerDetector creates a temp file, which I'd rather avoid

We'll need to buffer the whole file for zip either way. The current way will create a temp file if you start with an input stream (not if you have a file already), will scan through the file looking for entries that'll identify the file. The parser needs the whole file, so if we did a streaming parse of the file for detection we'd need to have buffered so we can rewind for the parser

and with POI detector, the entire stream is parsed once in detector, and for the second time in the extractor/parser, which is bad for performance

Pass in a TikaInputStream. That supports attaching the opened (and processed) container to the stream, so the parser can re-use it.

Nick

Reply via email to