@Test public void testPowerPointMetadataEarly() throws Exception { String[] extensions = new String[]{ "pptx", "pptm", "ppsm", "ppsx", "potm" }; final String[] mimeTypes = new String[]{ "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.ms-powerpoint.presentation.macroenabled.12", "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "application/vnd.ms-powerpoint.template.macroenabled.12" }; for (int i = 0; i < extensions.length; i++) { String extension = extensions[i]; final String filename = "testPPT." + extension; final Metadata metadata = new Metadata(); final int currentI = i; ContentHandler handler = new BodyContentHandler() { public void startDocument() { assertEquals( "Mime-type checking for " + filename, mimeTypes[currentI], metadata.get(Metadata.CONTENT_TYPE)); assertEquals("Attachment Test", metadata.get(TikaCoreProperties.TITLE)); assertEquals("Rajiv", metadata.get(TikaCoreProperties.CREATOR)); } }; ParseContext context = new ParseContext(); try (InputStream input = getResourceAsStream("/test-documents/"+filename)) { AUTO_DETECT_PARSER.parse(input, handler, metadata, context); } } }
public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { configure(context); OOXMLExtractorFactory.parse(stream, handler, metadata, context); }
OOXMLParser extends AbstractOfficeParser { public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { configure(context); OOXMLExtractorFactory.parse(stream, handler, metadata, context); } }
OOXMLParser extends AbstractOfficeParser { public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { configure(context); OOXMLExtractorFactory.parse(stream, handler, metadata, context); }  }
OOXMLParser extends AbstractOfficeParser { public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { configure(context); OOXMLExtractorFactory.parse(stream, handler, metadata, context); }  Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context); }
OOXMLParser extends AbstractOfficeParser { public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { configure(context); OOXMLExtractorFactory.parse(stream, handler, metadata, context); }  Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context);  }