RTFParser extends AbstractParser { public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { metadata.set(Metadata.CONTENT_TYPE, "application/rtf"); TaggedInputStream tagged = new TaggedInputStream(stream); try { XHTMLContentHandler xhtmlHandler = new XHTMLContentHandler(handler, metadata); RTFEmbObjHandler embObjHandler = new RTFEmbObjHandler(xhtmlHandler, metadata, context, getMemoryLimitInKb()); final TextExtractor ert = new TextExtractor(xhtmlHandler, metadata, embObjHandler); ert.setIgnoreListMarkup(ignoreListMarkup); ert.extract(stream); } catch (IOException e) { tagged.throwIfCauseOf(e); throw new TikaException("Error parsing an RTF document", e); } }  @Deprecated static int getMaxBytesForEmbeddedObject(); @Deprecated static void setMaxBytesForEmbeddedObject(int max); Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context); @Field void setMemoryLimitInKb(int memoryLimitInKb);  }
@Test public void testEmbeddedLinkedDocument() throws Exception { Set<MediaType> skipTypes = new HashSet<MediaType>(); skipTypes.add(MediaType.parse("image/emf")); skipTypes.add(MediaType.parse("image/wmf")); TrackingHandler tracker = new TrackingHandler(skipTypes); try (TikaInputStream tis = TikaInputStream.get(getResourceAsStream("/test-documents/testRTFEmbeddedLink.rtf"))) { ContainerExtractor ex = new ParserContainerExtractor(); assertEquals(true, ex.isSupported(tis)); ex.extract(tis, ex, tracker); } assertEquals(0, tracker.filenames.size()); tracker = new TrackingHandler(); try (TikaInputStream tis = TikaInputStream.get(getResourceAsStream("/test-documents/testRTFEmbeddedLink.rtf"))) { ContainerExtractor ex = new ParserContainerExtractor(); assertEquals(true, ex.isSupported(tis)); ex.extract(tis, ex, tracker); } assertEquals(2, tracker.filenames.size()); }