Examples of openResourceAsStream()


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

public class TestBugs extends TestCase {
    public void test52400ReadSimpleTNEF() throws Exception {
        POIDataSamples samples = POIDataSamples.getHMEFInstance();
        String testFile = "bug52400-winmail-simple.dat";
        HMEFMessage tnefDat    = new HMEFMessage(samples.openResourceAsStream(testFile));
        MAPIAttribute bodyHtml = tnefDat.getMessageMAPIAttribute(MAPIProperty.BODY_HTML);
        String bodyStr = new String(bodyHtml.getData(), getEncoding(tnefDat));
        assertTrue(bodyStr.contains("This is the message body."));
    }
   
View Full Code Here

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

    }
   
    public void test52400ReadAttachedTNEF() throws Exception {
        POIDataSamples samples = POIDataSamples.getHMEFInstance();
        String testFile = "bug52400-winmail-with-attachments.dat";
        HMEFMessage tnefDat    = new HMEFMessage(samples.openResourceAsStream(testFile));
        MAPIAttribute bodyHtml = tnefDat.getMessageMAPIAttribute(MAPIProperty.BODY_HTML);
        String bodyStr = new String(bodyHtml.getData(), getEncoding(tnefDat));
        assertTrue(bodyStr.contains("There are also two attachments."));
        assertEquals(2, tnefDat.getAttachments().size());
    }
View Full Code Here

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

    * 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)));
     
View Full Code Here

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

   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

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

     * 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"));
    }

    /**
     * Test to see if we can read the CC Chunk.
     * @throws ChunkNotFoundException
View Full Code Here

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

    * 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"));
View Full Code Here

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

    * @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"));
View Full Code Here

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

    */
   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

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

   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

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

       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
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.