Package org.apache.poi

Examples of org.apache.poi.POIDataSamples


     * @throws IOException
     * @throws HPSFException
     */
    public void testReadAllFiles() throws IOException, HPSFException
    {
        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File[] fileList = dataDir.listFiles(new FileFilter()
            {
                @Override
                public boolean accept(final File f)
                {
View Full Code Here


  private File vsd;

  protected void setUp() throws Exception {
    super.setUp();
   
        POIDataSamples ssTests = POIDataSamples.getSpreadSheetInstance();
        xls = ssTests.getFile("SampleSS.xls");
    xlsx = ssTests.getFile("SampleSS.xlsx");
        xltx = ssTests.getFile("test.xltx");
        xlsEmb = ssTests.getFile("excel_with_embeded.xls");

        POIDataSamples wpTests = POIDataSamples.getDocumentInstance();
    doc = wpTests.getFile("SampleDoc.doc");
    docx = wpTests.getFile("SampleDoc.docx");
        dotx = wpTests.getFile("test.dotx");
        docEmb = wpTests.getFile("word_with_embeded.doc");

        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    ppt = slTests.getFile("SampleShow.ppt");
    pptx = slTests.getFile("SampleShow.pptx");
        txt = slTests.getFile("SampleShow.txt");

        POIDataSamples dgTests = POIDataSamples.getDiagramInstance();
    vsd = dgTests.getFile("Test_Visio-Some_Random_Text.vsd");
  }
View Full Code Here

   * Initialize this test, load up the attachment_test_msg.msg mapi message.
   *
   * @throws Exception
   */
  public TestFileWithAttachmentsRead() throws IOException {
        POIDataSamples samples = POIDataSamples.getHSMFInstance();
    this.mapiMessage = new MAPIMessage(samples.openResourceAsStream("attachment_test_msg.msg"));
  }
View Full Code Here

  /**
   * Initialize this test, load up the blank.msg mapi message.
   * @throws Exception
   */
  public TestOutlook30FileRead() throws IOException {
        POIDataSamples samples = POIDataSamples.getHSMFInstance();
    this.mapiMessage = new MAPIMessage(samples.openResourceAsStream("outlook_30_msg.msg"));
  }
View Full Code Here

  /**
   * Initialize this test, load up the blank.msg mapi message.
   * @throws Exception
   */
  public TestSimpleFileRead() throws IOException {
        POIDataSamples samples = POIDataSamples.getHSMFInstance();
    this.mapiMessage = new MAPIMessage(samples.openResourceAsStream("simple_test_msg.msg"));
  }
View Full Code Here

  /**
   * Initialize this test, load up the blank.msg mapi message.
   */
  public TestBlankFileRead() throws IOException {
        POIDataSamples samples = POIDataSamples.getHSMFInstance();
    this.mapiMessage = new MAPIMessage(samples.openResourceAsStream("blank.msg"));
  }
View Full Code Here

  /**
   * Excel embeded in excel
   */
  public void testWithEmbededInOwn() throws Exception {
        POIDataSamples ssSamples = POIDataSamples.getSpreadSheetInstance();
    POIFSFileSystem fs = new POIFSFileSystem(
                ssSamples.openResourceAsStream("excel_with_embeded.xls")
        );

    DirectoryNode dirA = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B5");
    DirectoryNode dirB = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B4");

View Full Code Here

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

    public TestReWriteSanity() throws Exception {
        POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
    pfs = new POIFSFileSystem(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
    ss = new HSLFSlideShow(pfs);
    }
View Full Code Here

  public void testShortLastBlock() throws Exception {
    String[] files = new String[] {
      "ShortLastBlock.qwp", "ShortLastBlock.wps" 
    };

        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

     *
     * @exception FileNotFoundException if the file to be read does not exist.
     * @exception IOException if any other I/O exception occurs
     */
    protected void setUp() {
        POIDataSamples samples = POIDataSamples.getHPSFInstance();
        data = samples.getFile(POI_FS);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.POIDataSamples

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.