On Wed, 7 Dec 2011, Andrzej Bialecki wrote:
However, I'd like to have an option to avoid recursing into compound documents, while still being able to process nested archives (like zip, tgz, etc). Is there any easy way to express this preference? I thought about using the type of handler passed to the RecursiveParser.parse(..) to decide when to stop recursing, but I noticed that in both cases (embedded components and entries in archives) an EmbeddedContentHandler is passed to the parse(...) method.

I'd suggest you just put the logic into your nested parser. What I'd suggest is that you look at the mimetype of the source document, and use that to decide if you supply the recursing parser or not on the parse context.

Nick

Reply via email to