+++ /dev/null
-/*\r
- * @(#) $Id: HtmlPartExtractor.java,v 1.1.2.1 2004/09/29 00:57:59 otsuka Exp $\r
- * $Revision: 1.1.2.1 $\r
- * Copyright (c) 2000 Shin Kinoshita All Rights Reserved.\r
- */\r
-package com.ozacc.mail.fetch.impl.sk_jp;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.mail.MessagingException;\r
-import javax.mail.Part;\r
-import javax.mail.internet.ContentType;\r
-\r
-/**\r
- * text/htmlを結合した文字列を得るPartHandlerです。\r
- * \r
- * @version $Revision: 1.1.2.1 $ $Date: 2004/09/29 00:57:59 $\r
- * @author Shin\r
- */\r
-public class HtmlPartExtractor implements PartHandler {\r
-\r
- private String html = null;\r
-\r
- public boolean processPart(Part part, ContentType context) throws MessagingException,\r
- IOException {\r
- if (!part.isMimeType("text/html")) {\r
- return true;\r
- }\r
- if (html == null) {\r
- // 最初のテキストパートを無条件に抽出\r
- html = (String)MultipartUtility.getContent(part);\r
- } else {\r
- String disposition = part.getDisposition();\r
- if (disposition == null || disposition.equalsIgnoreCase(Part.INLINE)) {\r
- html += "\r\n\r\n-- inline --\r\n\r\n" + (String)MultipartUtility.getContent(part);\r
- }\r
- }\r
- return true;\r
- }\r
-\r
- public String getHtml() {\r
- return html;\r
- }\r
-\r
-}
\ No newline at end of file