Package org.apache.poi

Examples of org.apache.poi.POIDataSamples


   /**
    * Initialize this test, load up the messages.
    */
   public TestFixedSizedProperties() throws Exception {
       POIDataSamples samples = POIDataSamples.getHSMFInstance();
      this.mapiMessageSucceeds = new MAPIMessage(
                samples.openResourceAsStream(messageSucceeds));
      this.mapiMessageFails = new MAPIMessage(
                samples.openResourceAsStream(messageFails));   
      this.fsMessageSucceeds = new POIFSFileSystem(new FileInputStream(samples.getFile(messageSucceeds)));
      this.fsMessageFails = new POIFSFileSystem(new FileInputStream(samples.getFile(messageFails)));
     
      messageDateFormat = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss");
      messageDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
   }
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 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"));
       unicode = new MAPIMessage(samples.openResourceAsStream("example_received_unicode.msg"));
       cyrillic = new MAPIMessage(samples.openResourceAsStream("cyrillic_message.msg"));
       chinese = new MAPIMessage(samples.openResourceAsStream("chinese-traditional.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

    "This is the title on page 2",
    "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"));
    }
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

    String filename2 = "test.doc";
    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

    /**
     * Tests that we can work with both {@link POIFSFileSystem}
     *  and {@link NPOIFSFileSystem}
     */
    public void testDifferentPOIFS() throws Exception {
       POIDataSamples docTests = POIDataSamples.getDocumentInstance();
      
       // Open the two filesystems
       DirectoryNode[] files = new DirectoryNode[2];
       files[0] = (new POIFSFileSystem(docTests.openResourceAsStream("test2.doc"))).getRoot();
       NPOIFSFileSystem npoifsFileSystem = new NPOIFSFileSystem(docTests.getFile("test2.doc"));
       files[1] = npoifsFileSystem.getRoot();
      
       // Open directly
       for(DirectoryNode dir : files) {
          WordExtractor extractor = new WordExtractor(dir);
View Full Code Here

    public void testReadDocumentSummaryInformation()
            throws FileNotFoundException, IOException,
            NoPropertySetStreamException, MarkUnsupportedException,
            UnexpectedPropertySetTypeException
    {
        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File[] docs = dataDir.listFiles(new FileFilter()
        {
            @Override
            public boolean accept(final File file)
            {
View Full Code Here

     */
    public void testWriteWellKnown() throws IOException,
            NoPropertySetStreamException, MarkUnsupportedException,
            UnexpectedPropertySetTypeException, WritingNotSupportedException
    {
        POIDataSamples _samples = POIDataSamples.getHPSFInstance();
        final File dataDir = _samples.getFile("");
        final File doc1 = new File(dataDir, POI_FS);

        /* Read a test document <em>doc1</em> into a POI filesystem. */
        POIFSFileSystem poifs = new POIFSFileSystem(new FileInputStream(doc1));
        DirectoryEntry dir = poifs.getRoot();
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.