Package org.apache.poi.hmef

Examples of org.apache.poi.hmef.HMEFMessage


   @Override
   protected void setUp() throws Exception {
      super.setUp();
     
      stream = _samples.openResourceAsStream("quick-winmail.dat");
      quick = new HMEFMessage(stream);
   }
View Full Code Here


      System.out.println("Extraction completed");
   }
  
   private HMEFMessage message;
   public HMEFContentsExtractor(File filename) throws IOException {
      this(new HMEFMessage(new FileInputStream(filename)));
   }
View Full Code Here

  
   @Override
   protected void setUp() throws Exception {
      super.setUp();
     
      quick = new HMEFMessage(
            _samples.openResourceAsStream("quick-winmail.dat")
      );
   }
View Full Code Here

  
   @Override
   protected void setUp() throws Exception {
      super.setUp();
     
      quick = new HMEFMessage(
            _samples.openResourceAsStream("quick-winmail.dat")
      );
   }
View Full Code Here

       } else {
           embeddedExtractor = ex;
       }
      
       // Ask POI to process the file for us
       HMEFMessage msg = new HMEFMessage(stream);
      
       // Set the message subject if known
       String subject = msg.getSubject();
       if(subject != null && subject.length() > 0) {
          // TODO: Move to title in Tika 2.0
          metadata.set(TikaCoreProperties.TRANSITION_SUBJECT_TO_DC_TITLE, subject);
       }
      
       // Recurse into the message body RTF
       MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);
       if(attr != null && attr instanceof MAPIRtfAttribute) {
          MAPIRtfAttribute rtf = (MAPIRtfAttribute)attr;
          handleEmbedded(
                "message.rtf", "application/rtf",
                rtf.getData(),
                embeddedExtractor, handler
          );
       }
      
       // Recurse into each attachment in turn
       for(Attachment attachment : msg.getAttachments()) {
          String name = attachment.getLongFilename();
          if(name == null || name.length() == 0) {
             name = attachment.getFilename();
          }
          if(name == null || name.length() == 0) {
View Full Code Here

       } else {
           embeddedExtractor = ex;
       }
      
       // Ask POI to process the file for us
       HMEFMessage msg = new HMEFMessage(stream);
      
       // Set the message subject if known
       String subject = msg.getSubject();
       if(subject != null && subject.length() > 0) {
          metadata.set(Metadata.SUBJECT, subject);
       }
      
       // Recurse into the message body RTF
       MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);
       if(attr != null && attr instanceof MAPIRtfAttribute) {
          MAPIRtfAttribute rtf = (MAPIRtfAttribute)attr;
          handleEmbedded(
                "message.rtf", "application/rtf",
                rtf.getData(),
                embeddedExtractor, handler
          );
       }
      
       // Recurse into each attachment in turn
       for(Attachment attachment : msg.getAttachments()) {
          String name = attachment.getLongFilename();
          if(name == null || name.length() == 0) {
             name = attachment.getFilename();
          }
          if(name == null || name.length() == 0) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hmef.HMEFMessage

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.