@@ -0,0 +1,2237 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.tika.parser.microsoft;%0A%0Aimport org.apache.poi.hslf.extractor.PowerPointExtractor;%0Aimport org.apache.poi.hslf.model.OLEShape;%0Aimport org.apache.poi.poifs.filesystem.POIFSFileSystem;%0Aimport org.apache.tika.exception.TikaException;%0Aimport org.apache.tika.io.TikaInputStream;%0Aimport org.apache.tika.parser.ParseContext;%0Aimport org.apache.tika.sax.XHTMLContentHandler;%0Aimport org.xml.sax.SAXException;%0A%0Aimport java.io.IOException;%0Aimport java.util.List;%0A%0Apublic class HSLFExtractor extends AbstractPOIFSExtractor %7B%0A    public HSLFExtractor(ParseContext context) %7B%0A        super(context);%0A    %7D%0A%0A    protected void parse(%0A            POIFSFileSystem filesystem, XHTMLContentHandler xhtml)%0A            throws IOException, SAXException, TikaException %7B%0A        PowerPointExtractor powerPointExtractor =%0A            new PowerPointExtractor(filesystem);%0A        xhtml.element(%22p%22, powerPointExtractor.getText(true, true));%0A%0A        List%3COLEShape%3E shapeList = powerPointExtractor.getOLEShapes();%0A        for (OLEShape shape : shapeList) %7B%0A            TikaInputStream stream = TikaInputStream.get(shape.getObjectData().getData());%0A%0A            String mediaType = null;%0A%0A            if (%22Excel.Chart.8%22.equals(shape.getProgID())) %7B%0A                mediaType = %22application/vnd.ms-excel%22;%0A            %7D%0A%0A            handleEmbeddedResource(stream, Integer.toString(shape.getObjectID()), mediaType, xhtml, false);%0A        %7D%0A    %7D%0A%7D%0A

support for extracting OLE-shapes from PPT