当前位置: 首页>>代码示例>>Java>>正文


Java MAPIMessage类代码示例

本文整理汇总了Java中org.apache.poi.hsmf.MAPIMessage的典型用法代码示例。如果您正苦于以下问题:Java MAPIMessage类的具体用法?Java MAPIMessage怎么用?Java MAPIMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MAPIMessage类属于org.apache.poi.hsmf包,在下文中一共展示了MAPIMessage类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractText

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
/**
 * {@inheritDoc} Returns an empty reader if an error occured extracting text from
 * the outlook message.
 */
public String extractText(InputStream stream, String type, String encoding) throws IOException {
	try {
		MAPIMessage message = new MAPIMessage(stream);
		StringBuffer buffer = new StringBuffer();
		buffer.append(message.getDisplayFrom()).append('\n');
		buffer.append(message.getDisplayTo()).append('\n');
		buffer.append(message.getSubject()).append('\n');
		buffer.append(message.getTextBody());
		return buffer.toString();
	} catch (Exception e) {
		logger.warn("Failed to extract Message content", e);
		throw new IOException(e.getMessage(), e);
	} finally {
		stream.close();
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:21,代码来源:MsOutlookTextExtractor.java

示例2: OutlookExtractor

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public OutlookExtractor(DirectoryNode root, ParseContext context) throws TikaException {
    super(context);
    
    try {
        this.msg = new MAPIMessage(root);
    } catch (IOException e) {
        throw new TikaException("Failed to parse Outlook message", e);
    }
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:10,代码来源:OutlookExtractor.java

示例3: main

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String filename = "data/message.msg";
	MAPIMessage msg = new MAPIMessage(filename);
	
	PrintWriter txtOut = new PrintWriter("data/ApacheMessage.txt");
	txtOut.println("Email Body: " + msg.getTextBody());
	txtOut.close();
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:10,代码来源:ApacheEmaiSave.java

示例4: main

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	MAPIMessage msg = new MAPIMessage("data/message.msg");

	AttachmentChunks[] attachments = msg.getAttachmentFiles();
	if (attachments.length > 0)
	{
		File d = new File("data/attachments");
		if (d.exists() || d.mkdir())
		{
			for (AttachmentChunks attachment : attachments)
			{
				String fileName = attachment.attachFileName.toString();
				if (attachment.attachLongFileName != null)
				{
					fileName = attachment.attachLongFileName.toString();
				}

				File f = new File(d, fileName);
				OutputStream fileOut = null;
				try
				{
					fileOut = new FileOutputStream(f);
					fileOut.write(attachment.attachData.getValue());
				}
				finally
				{
					if (fileOut != null)
					{
						fileOut.close();
					}
				}
			}

		}
	}
    System.out.println("Done ...");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:39,代码来源:ApacheAttachments.java

示例5: main

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	MAPIMessage msg = new MAPIMessage("data/message.msg");

	System.out.println("From: " + msg.getDisplayFrom());
	System.out.println("To: " + msg.getDisplayTo());
	System.out.println("CC: " + msg.getDisplayCC());
	System.out.println("BCC: " + msg.getDisplayBCC());
	System.out.println("Subject: " + msg.getSubject());
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:11,代码来源:ApacheMsgHeaders.java

示例6: getEmbeddedMessage

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
/**
 * Returns the embedded MAPI message, if the attachment
 *  is an embedded message, or null otherwise
 */
public MAPIMessage getEmbeddedMessage() throws IOException {
   if (attachmentDirectory != null) {
      return attachmentDirectory.getAsEmbededMessage();
   }
   return null;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:11,代码来源:AttachmentChunks.java

示例7: parseContent

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
@Override
protected void parseContent(StreamLimiter streamLimiter, LanguageEnum lang) throws IOException {
	MAPIMessage msg = new MAPIMessage(streamLimiter.getNewInputStream());
	msg.setReturnNullOnMissingChunk(true);
	ParserResultItem result = getNewParserResultItem();
	try {
		result.addField(ParserFieldEnum.email_display_from, msg.getDisplayFrom());
		result.addField(ParserFieldEnum.email_display_to, msg.getDisplayTo());
		result.addField(ParserFieldEnum.email_display_cc, msg.getDisplayCC());
		result.addField(ParserFieldEnum.email_display_bcc, msg.getDisplayBCC());
		result.addField(ParserFieldEnum.subject, msg.getSubject());
		result.addField(ParserFieldEnum.htmlSource, msg.getHtmlBody());
		result.addField(ParserFieldEnum.content, msg.getTextBody());
		result.addField(ParserFieldEnum.creation_date, msg.getMessageDate());
		result.addField(ParserFieldEnum.email_conversation_topic, msg.getConversationTopic());
		RecipientChunks[] recipientChuncksList = msg.getRecipientDetailsChunks();
		if (recipientChuncksList != null) {
			for (RecipientChunks recipientChunks : recipientChuncksList) {
				result.addField(ParserFieldEnum.email_recipient_name, recipientChunks.getRecipientName());
				result.addField(ParserFieldEnum.email_recipient_address,
						recipientChunks.getRecipientEmailAddress());
			}
		}
		if (StringUtils.isEmpty(msg.getHtmlBody()))
			result.langDetection(10000, ParserFieldEnum.content);
		else
			result.langDetection(10000, ParserFieldEnum.htmlSource);
	} catch (ChunkNotFoundException e) {
		Logging.warn(e);
	}
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:32,代码来源:MapiMsgParser.java

示例8: main

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String filename = "data/message.msg";
	MAPIMessage msg = new MAPIMessage(filename);
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:6,代码来源:ApacheLoadEmailMsg.java

示例9: main

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
    MAPIMessage msg = new MAPIMessage("data/message.msg");
	System.out.println("Text Body:"+ msg.getTextBody());
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:6,代码来源:ApacheMsgBody.java

示例10: OutlookTextExtactor

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
public OutlookTextExtactor(MAPIMessage msg) {
   super(msg);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:4,代码来源:OutlookTextExtactor.java

示例11: getMAPIMessage

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
/**
 * Returns the underlying MAPI message
 */
public MAPIMessage getMAPIMessage() {
   return (MAPIMessage)document;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:7,代码来源:OutlookTextExtactor.java

示例12: getAsEmbededMessage

import org.apache.poi.hsmf.MAPIMessage; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:9,代码来源:DirectoryChunk.java


注:本文中的org.apache.poi.hsmf.MAPIMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。