Package org.apache.poi

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


    }
  }

  public void testRealFile() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    HSLFSlideShow hss = new HSLFSlideShow(slTests.openResourceAsStream("WithLinks.ppt"));
    SlideShow ss = new SlideShow(hss);

    // Get the document
    Document doc = ss.getDocumentRecord();
    // Get the ExObjList
View Full Code Here


  // POIFS primed on the test data
  private POIFSFileSystem pfs;

  public TestDocument() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    pfs = new POIFSFileSystem(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    ss = new HSLFSlideShow(pfs);
  }

  private Document getDocRecord() {
    Record[] r = ss.getRecords();
View Full Code Here

* @author Nick Burch (nick at torchbox dot com)
*/
public class TestExObjList extends TestCase {
  public void testRealFile() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    HSLFSlideShow hss = new HSLFSlideShow(slTests.openResourceAsStream("WithLinks.ppt"));
    SlideShow ss = new SlideShow(hss);

    // Get the document
    Document doc = ss.getDocumentRecord();
    // Get the ExObjList
View Full Code Here

    hss_empty = HSLFSlideShow.create();
    ss_empty = new SlideShow(hss_empty);

        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();

    hss_one = new HSLFSlideShow(slTests.openResourceAsStream("Single_Coloured_Page.ppt"));
    ss_one = new SlideShow(hss_one);

    hss_two = new HSLFSlideShow(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    ss_two = new SlideShow(hss_two);
  }
View Full Code Here

        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();

    hss_one = new HSLFSlideShow(slTests.openResourceAsStream("Single_Coloured_Page.ppt"));
    ss_one = new SlideShow(hss_one);

    hss_two = new HSLFSlideShow(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    ss_two = new SlideShow(hss_two);
  }

  /**
   * Test adding a slide to an empty slideshow
View Full Code Here

    }


    public void test47261() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
        SlideShow ppt = new SlideShow(slTests.openResourceAsStream("47261.ppt"));
        Slide[] slides = ppt.getSlides();
        Document doc = ppt.getDocumentRecord();
        assertNotNull(doc.getSlideSlideListWithText());
        assertEquals(14, ppt.getSlides().length);
        int notesId = slides[0].getSlideRecord().getSlideAtom().getNotesID();
View Full Code Here

    "This is page two\nIt has several blocks of text\nNone of them have formatting",
  };

    public TestCruddyExtractor() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    te = new QuickButCruddyTextExtractor(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    }

    public void testReadAsVector() {
    // Extract the text from the file as a vector
    Vector foundTextV = te.getTextAsVector();
View Full Code Here

   *            array of reference slide titles
   */
  protected void assertSlideOrdering(String filename, String[] titles) throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();

        SlideShow ppt = new SlideShow(slTests.openResourceAsStream(filename));
    Slide[] slide = ppt.getSlides();

    assertEquals(titles.length, slide.length);
    for (int i = 0; i < slide.length; i++) {
      String title = slide[i].getTitle();
View Full Code Here

  // SlideShow primed on the test data
  private SlideShow ss;

  public TestMostRecentRecords() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    hss = new HSLFSlideShow(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    ss = new SlideShow(hss);
  }

  public void testCount() {
    // Most recent core records
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

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.