Package org.apache.poi.xssf.extractor

Examples of org.apache.poi.xssf.extractor.XSSFExcelExtractor


      throw new IllegalArgumentException("Invalid OOXML Package received - expected 1 core document, found " + core.size());
    }
   
    PackagePart corePart = pkg.getPart(core.getRelationship(0));
    if(corePart.getContentType().equals(XSSFWorkbook.WORKBOOK.getContentType())) {
      return new XSSFExcelExtractor(pkg);
    }
    if(corePart.getContentType().equals(XWPFDocument.MAIN_CONTENT_TYPE)) {
      return new XWPFWordExtractor(pkg);
    }
    if(corePart.getContentType().equals(XSLFSlideShow.MAIN_CONTENT_TYPE)) {
View Full Code Here


       for(XSSFRelation rel : XSSFExcelExtractor.SUPPORTED_TYPES) {
          if(corePart.getContentType().equals(rel.getContentType())) {
             if(getPreferEventExtractor()) {
                return new XSSFEventBasedExcelExtractor(pkg);
             } else {
                return new XSSFExcelExtractor(pkg);
             }
          }
       }

       // Is it XWPF?
View Full Code Here

  public void testGetFromMainExtractor() throws Exception {
    OPCPackage pkg = PackageHelper.open(_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm"));

    XSSFWorkbook wb = new XSSFWorkbook(pkg);

    XSSFExcelExtractor ext = new XSSFExcelExtractor(wb);
    POIXMLPropertiesTextExtractor textExt = ext.getMetadataTextExtractor();

    // Check basics
    assertNotNull(textExt);
    assertTrue(textExt.getText().length() > 0);
View Full Code Here

       for(XSSFRelation rel : XSSFExcelExtractor.SUPPORTED_TYPES) {
          if(corePart.getContentType().equals(rel.getContentType())) {
             if(getPreferEventExtractor()) {
                return new XSSFEventBasedExcelExtractor(pkg);
             } else {
                return new XSSFExcelExtractor(pkg);
             }
          }
       }
       
       // Is it XWPF?
View Full Code Here

       for(XSSFRelation rel : XSSFExcelExtractor.SUPPORTED_TYPES) {
          if(corePart.getContentType().equals(rel.getContentType())) {
             if(getPreferEventExtractor()) {
                return new XSSFEventBasedExcelExtractor(pkg);
             } else {
                return new XSSFExcelExtractor(pkg);
             }
          }
       }
       
       // Is it XWPF?
View Full Code Here

  public void testGetFromMainExtractor() throws Exception {
    OPCPackage pkg = PackageHelper.open(_ssSamples.openResourceAsStream("ExcelWithAttachments.xlsm"));

    XSSFWorkbook wb = new XSSFWorkbook(pkg);

    XSSFExcelExtractor ext = new XSSFExcelExtractor(wb);
    POIXMLPropertiesTextExtractor textExt = ext.getMetadataTextExtractor();

    // Check basics
    assertNotNull(textExt);
    assertTrue(textExt.getText().length() > 0);
View Full Code Here

      throw new IllegalArgumentException("Invalid OOXML Package received - expected 1 core document, found " + core.size());
    }
   
    PackagePart corePart = pkg.getPart(core.getRelationship(0));
    if(corePart.getContentType().equals(XSSFRelation.WORKBOOK.getContentType())) {
      return new XSSFExcelExtractor(pkg);
    }
    if(corePart.getContentType().equals(XWPFDocument.MAIN_CONTENT_TYPE)) {
      return new XWPFWordExtractor(pkg);
    }
    if(corePart.getContentType().equals(XSLFSlideShow.MAIN_CONTENT_TYPE)) {
View Full Code Here

      throw new IllegalArgumentException("Invalid OOXML Package received - expected 1 core document, found " + core.size());
    }
   
    PackagePart corePart = pkg.getPart(core.getRelationship(0));
    if(corePart.getContentType().equals(XSSFRelation.WORKBOOK.getContentType())) {
      return new XSSFExcelExtractor(pkg);
    }
    if(corePart.getContentType().equals(XWPFRelation.DOCUMENT.getContentType())) {
      return new XWPFWordExtractor(pkg);
    }
    if(corePart.getContentType().equals(XSLFSlideShow.MAIN_CONTENT_TYPE)) {
View Full Code Here

TOP

Related Classes of org.apache.poi.xssf.extractor.XSSFExcelExtractor

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.