Package org.apache.poi

Examples of org.apache.poi.POIXMLDocument


    BufferedInputStream bis = null;
    StringBuilder buffy = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIXMLTextExtractor extractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(bis);
      POIXMLDocument document = extractor.getDocument();

      if (document instanceof XSSFWorkbook) {
        XSSFWorkbook xDocument = (XSSFWorkbook) document;
        extractContent(buffy, xDocument);
      }
View Full Code Here


    BufferedInputStream bis = null;
    StringBuilder buffy = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIXMLTextExtractor extractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(bis);
      POIXMLDocument document = extractor.getDocument();
     
      if (document instanceof XWPFDocument) {
        XWPFDocument xDocument = (XWPFDocument) document;
        XWPFHeaderFooterPolicy hfPolicy = xDocument.getHeaderFooterPolicy();
        extractHeaders(buffy, hfPolicy);
View Full Code Here

    BufferedInputStream bis = null;
    StringBuilder buffy = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIXMLTextExtractor extractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(bis);
      POIXMLDocument document = extractor.getDocument();

      if (document instanceof XSLFSlideShow) {
        XSLFSlideShow slideShow = (XSLFSlideShow) document;
        XMLSlideShow xmlSlideShow = new XMLSlideShow(slideShow);
        extractContent(buffy, xmlSlideShow);
View Full Code Here

*/
public class OOXMLExtractorFactory {

    public static OOXMLExtractor createExtractor(
            POIXMLTextExtractor extractor, Locale locale) {
        POIXMLDocument document = extractor.getDocument();

        if (document instanceof XSLFSlideShow) {
            return new XSLFPowerPointExtractorDecorator(
                    (XSLFPowerPointExtractor) extractor);
        } else if (document instanceof XSSFWorkbook) {
View Full Code Here

        try {
            OOXMLExtractor extractor;

            POIXMLTextExtractor poiExtractor =
                (POIXMLTextExtractor) ExtractorFactory.createExtractor(stream);
            POIXMLDocument document = poiExtractor.getDocument();
            if (document instanceof XSLFSlideShow) {
                extractor = new XSLFPowerPointExtractorDecorator(
                        (XSLFPowerPointExtractor) poiExtractor);
            } else if (document instanceof XSSFWorkbook) {
                extractor = new XSSFExcelExtractorDecorator(
View Full Code Here

               );
            } else {
               poiExtractor = (POIXMLTextExtractor) ExtractorFactory.createExtractor(stream);
            }
           
            POIXMLDocument document = poiExtractor.getDocument();
            if (document instanceof XSLFSlideShow) {
                extractor = new XSLFPowerPointExtractorDecorator(
                        (XSLFPowerPointExtractor) poiExtractor);
            } else if (document instanceof XSSFWorkbook) {
                extractor = new XSSFExcelExtractorDecorator(
View Full Code Here

                InputStream shield = new CloseShieldInputStream(stream);
                poiExtractor = (POIXMLTextExtractor)
                        ExtractorFactory.createExtractor(shield);
            }

            POIXMLDocument document = poiExtractor.getDocument();
            if (poiExtractor instanceof XSSFEventBasedExcelExtractor) {
               extractor = new XSSFExcelExtractorDecorator(
                   context, (XSSFEventBasedExcelExtractor)poiExtractor, locale);
            } else if (document == null) {
               throw new TikaException(
View Full Code Here

* returns it.
*/
public class OOXMLExtractorFactory {

    public static OOXMLExtractor createExtractor(POIXMLTextExtractor extractor) {
        POIXMLDocument document = extractor.getDocument();

        if (document instanceof XSLFSlideShow) {
            return new XSLFPowerPointExtractorDecorator(
                    (XSLFPowerPointExtractor) extractor);
        } else if (document instanceof XSSFWorkbook) {
View Full Code Here

            metadata.set(Metadata.CONTENT_TYPE, type.toString());

            // Have the appropriate OOXML text extractor picked
            POIXMLTextExtractor poiExtractor = ExtractorFactory.createExtractor(pkg);
           
            POIXMLDocument document = poiExtractor.getDocument();
            if (poiExtractor instanceof XSSFEventBasedExcelExtractor) {
               extractor = new XSSFExcelExtractorDecorator(
                   context, (XSSFEventBasedExcelExtractor)poiExtractor, locale);
            } else if (document == null) {
               throw new TikaException(
View Full Code Here

            metadata.set(Metadata.CONTENT_TYPE, type.toString());

            // Have the appropriate OOXML text extractor picked
            POIXMLTextExtractor poiExtractor = ExtractorFactory.createExtractor(pkg);
           
            POIXMLDocument document = poiExtractor.getDocument();
            if (poiExtractor instanceof XSSFEventBasedExcelExtractor) {
               extractor = new XSSFExcelExtractorDecorator(
                   context, (XSSFEventBasedExcelExtractor)poiExtractor, locale);
            } else if (document == null) {
               throw new TikaException(
View Full Code Here

TOP

Related Classes of org.apache.poi.POIXMLDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.