Package org.apache.poi.hsmf

Examples of org.apache.poi.hsmf.MAPIMessage


   * Initialize this test, load up the blank.msg mapi message.
   * @throws Exception
   */
  public TestSimpleFileRead() throws IOException {
    String dirname = System.getProperty("HSMF.testdata.path");
    this.mapiMessage = new MAPIMessage(dirname + "/simple_test_msg.msg");
  }
View Full Code Here


   * Initialize this test, load up the blank.msg mapi message.
   * @throws IOException
   */
  public TestBlankFileRead() throws IOException {
    String dirname = System.getProperty("HSMF.testdata.path");
    this.mapiMessage = new MAPIMessage(dirname + "/blank.msg");
  }
View Full Code Here

     * Treats the directory as an embeded MAPIMessage
     *  (it normally is one), and returns a MAPIMessage
     *  object to process it with.
     */
    public MAPIMessage getAsEmbededMessage() throws IOException {
        return new MAPIMessage(dir);
    }
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

 
   public void testQuick() throws Exception {
      POIFSFileSystem simple = new POIFSFileSystem(
            new FileInputStream(samples.getFile("quick.msg"))
      );
      MAPIMessage msg = new MAPIMessage(simple);
     
      OutlookTextExtactor ext = new OutlookTextExtactor(msg);
      String text = ext.getText();
     
      assertContains(text, "From: Kevin Roast\n");
View Full Code Here

      assertContains(text, "Date: " + dateText + "\n");
      assertContains(text, "The quick brown fox jumps over the lazy dog");
   }
  
   public void testSimple() throws Exception {
      MAPIMessage msg = new MAPIMessage(new POIFSFileSystem(
            new FileInputStream(samples.getFile("simple_test_msg.msg"))
      ));
     
      OutlookTextExtactor ext = new OutlookTextExtactor(msg);
      String text = ext.getText();
View Full Code Here

            samples.getFile("simple_test_msg.msg")
      )).getText());
      String poifs = (new OutlookTextExtactor(new POIFSFileSystem(new FileInputStream(
            samples.getFile("simple_test_msg.msg")
      ))).getText());
      String mapi = (new OutlookTextExtactor(new MAPIMessage(new FileInputStream(
            samples.getFile("simple_test_msg.msg")
      ))).getText());
     
      assertEquals(inp, poifs);
      assertEquals(inp, mapi);
View Full Code Here

     
      String[] files = new String[] {
            "example_sent_regular.msg", "example_sent_unicode.msg"
      };
      for(String file : files) {
         MAPIMessage msg = new MAPIMessage(new POIFSFileSystem(
               new FileInputStream(samples.getFile(file))
         ));
        
         OutlookTextExtactor ext = new OutlookTextExtactor(msg);
         String text = ext.getText();
View Full Code Here

TOP

Related Classes of org.apache.poi.hsmf.MAPIMessage

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.