Package org.apache.poi

Examples of org.apache.poi.POIDataSamples.openResourceAsStream()


        POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
        for(int i=0; i<files.length; i++) {

      // Open the file up
      POIFSFileSystem fs = new POIFSFileSystem(
          _samples.openResourceAsStream(files[i])
      );
     
      // Write it into a temp output array
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      fs.writeFilesystem(baos);
View Full Code Here


    filename3 = "excel_with_embeded.xls";
    filename4 = "ThreeColHeadFoot.doc";
    filename5 = "HeaderFooterUnicode.doc";
    filename6 = "footnote.doc";
        POIDataSamples docTests = POIDataSamples.getDocumentInstance();
    extractor = new WordExtractor(docTests.openResourceAsStream(filename));
    extractor2 = new WordExtractor(docTests.openResourceAsStream(filename2));

    // Build splat'd out text version
    for(int i=0; i<p_text1.length; i++) {
      p_text1_block += p_text1[i];
View Full Code Here

    filename4 = "ThreeColHeadFoot.doc";
    filename5 = "HeaderFooterUnicode.doc";
    filename6 = "footnote.doc";
        POIDataSamples docTests = POIDataSamples.getDocumentInstance();
    extractor = new WordExtractor(docTests.openResourceAsStream(filename));
    extractor2 = new WordExtractor(docTests.openResourceAsStream(filename2));

    // Build splat'd out text version
    for(int i=0; i<p_text1.length; i++) {
      p_text1_block += p_text1[i];
    }
View Full Code Here

  private XSLFSlideShow xmlA;
  private OPCPackage pkg;

  protected void setUp() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    pkg = OPCPackage.open(slTests.openResourceAsStream("sample.pptx"));
    xmlA = new XSLFSlideShow(pkg);
  }

  /**
   * Get text out of the simple file
View Full Code Here

    );
  }
 
  public void testGetComments() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    xmlA = new XSLFSlideShow(OPCPackage.open(slTests.openResourceAsStream("45545_Comment.pptx")));
    XSLFPowerPointExtractor extractor =
      new XSLFPowerPointExtractor(xmlA);
   
    String text = extractor.getText();
    assertTrue(text.length() > 0);
View Full Code Here

  private XSLFSlideShow xmlA;
  private OPCPackage pkg;

  protected void setUp() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    pkg = OPCPackage.open(slTests.openResourceAsStream("sample.pptx"));
    xmlA = new XSLFSlideShow(pkg);
  }

  /**
   * Get text out of the simple file
View Full Code Here

    );
  }
 
  public void testGetComments() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    xmlA = new XSLFSlideShow(OPCPackage.open(slTests.openResourceAsStream("45545_Comment.pptx")));
    XSLFPowerPointExtractor extractor =
      new XSLFPowerPointExtractor(xmlA);
   
    String text = extractor.getText();
    assertTrue(text.length() > 0);
View Full Code Here

    assertTrue("Unable to find expected word in text\n" + text, text.contains("testdoc"));
  }

    public void testTable() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
        xmlA = new XSLFSlideShow(OPCPackage.open(slTests.openResourceAsStream("present1.pptx")));
        XSLFPowerPointExtractor extractor =
            new XSLFPowerPointExtractor(xmlA);

        String text = extractor.getText();
        assertTrue(text.length() > 0);
View Full Code Here

    *
    * @throws Exception
    */
   public TestFileWithAttachmentsRead() throws IOException {
      POIDataSamples samples = POIDataSamples.getHSMFInstance();
      this.mapiMessage = new MAPIMessage(samples.openResourceAsStream("attachment_test_msg.msg"));
   }

   /**
    * Test to see if we can retrieve attachments.
    *
 
View Full Code Here

   * Initialize this test, load up the blank.msg mapi message.
   * @throws Exception
   */
  public TestBasics() throws IOException {
        POIDataSamples samples = POIDataSamples.getHSMFInstance();
    simple = new MAPIMessage(samples.openResourceAsStream("simple_test_msg.msg"));
      quick  = new MAPIMessage(samples.openResourceAsStream("quick.msg"));
      outlook30  = new MAPIMessage(samples.openResourceAsStream("outlook_30_msg.msg"));
      attachments = new MAPIMessage(samples.openResourceAsStream("attachment_test_msg.msg"));
      noRecipientAddress = new MAPIMessage(samples.openResourceAsStream("no_recipient_address.msg"));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.