@Test @Ignore public void testMetadata() throws Exception { TikaInputStream stream = getTestFile(file); Metadata metadata = new Metadata(); ContentHandler handler = new BodyContentHandler(); OldExcelParser parser = new OldExcelParser(); parser.parse(stream, handler, metadata, new ParseContext()); assertEquals("application/vnd.ms-excel.sheet.4", metadata.get(Metadata.CONTENT_TYPE)); assertEquals(null, metadata.get(TikaCoreProperties.TITLE)); assertEquals(null, metadata.get(TikaCoreProperties.SUBJECT)); }
protected static void parse(OldExcelExtractor extractor, XHTMLContentHandler xhtml) throws TikaException, IOException, SAXException { String text = extractor.getText(); String line; BufferedReader reader = new BufferedReader(new StringReader(text)); while ((line = reader.readLine()) != null) { xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); } }
OldExcelParser extends AbstractParser { protected static void parse(OldExcelExtractor extractor, XHTMLContentHandler xhtml) throws TikaException, IOException, SAXException { String text = extractor.getText(); String line; BufferedReader reader = new BufferedReader(new StringReader(text)); while ((line = reader.readLine()) != null) { xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); } } }
OldExcelParser extends AbstractParser { protected static void parse(OldExcelExtractor extractor, XHTMLContentHandler xhtml) throws TikaException, IOException, SAXException { String text = extractor.getText(); String line; BufferedReader reader = new BufferedReader(new StringReader(text)); while ((line = reader.readLine()) != null) { xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); } }  }
OldExcelParser extends AbstractParser { protected static void parse(OldExcelExtractor extractor, XHTMLContentHandler xhtml) throws TikaException, IOException, SAXException { String text = extractor.getText(); String line; BufferedReader reader = new BufferedReader(new StringReader(text)); while ((line = reader.readLine()) != null) { xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); } }  Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context); }
OldExcelParser extends AbstractParser { protected static void parse(OldExcelExtractor extractor, XHTMLContentHandler xhtml) throws TikaException, IOException, SAXException { String text = extractor.getText(); String line; BufferedReader reader = new BufferedReader(new StringReader(text)); while ((line = reader.readLine()) != null) { xhtml.startElement("p"); xhtml.characters(line); xhtml.endElement("p"); } }  Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context);  }