Coverage report

| %line | %branch
--- | --- | ---
com.ozacc.mail.fetch.ReceivedMail$ReceivedHeader |
0% |
0% |

1 |  |
     package com.ozacc.mail.fetch;
2 |  |
3 |  |
     import java.io.File;
4 |  |
     import java.util.ArrayList;
5 |  |
     import java.util.Date;
6 |  |
     import java.util.Iterator;
7 |  |
     import java.util.List;
8 |  |
9 |  |
     import javax.mail.Flags;
10 |  |
     import javax.mail.MessagingException;
11 |  |
     import javax.mail.internet.MimeMessage;
12 |  |
13 |  |
     import com.ozacc.mail.Mail;
14 |  |
15 |  |
     /**
16 |  |
      * ¼õ¿®¥á¡¼¥?¡£
17 |  |
      * <p>
18 |  |
      * <code>FetchMail</code>¡¢<code>FetchMailPro</code>¤Î¼ÂÁõ¥¯¥é¥¹¤Ç¼õ¿®¤·¤¿¥á¡¼¥?¤¬¡¢
19 |  |
      * ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥á¡¼¥?¤È¤·¤Æ¤Î»ÅÍÍ¤òË?¤¿¤·¤Æ¤¤¤Ê¤¤¥Ø¥Ã¥À(From¤äTo¤Ê¤É)¤ÎÃÍ¤¬¥»¥Ã¥È¤µ¤?¤Æ¤¤¤¿¾?¹ç¡¢
20 |  |
      * ¤½¤Î¥Ø¥Ã¥À¤Ë³ºÅö¤¹¤?<code>ReceivedMail</code>¥¤¥ó¥¹¥¿¥ó¥¹¤Î¥×¥úÁÑ¥Æ¥£¤Ë¤Ï²¿¤â¥»¥Ã¥È¤µ¤?¤Þ¤»¤ó¡£
21 |  |
      *
22 |  |
      * @since 1.2
23 |  |
      * @author Tomohiro Otsuka
24 |  |
      * @version $Id: ReceivedMail.java,v 1.1.2.9 2005/01/23 07:13:13 otsuka Exp $
25 |  |
      */
26 |  |
     public class ReceivedMail extends Mail {
27 |  |
28 |  |
     	private String replySubjectPrefix = "Re: ";
29 |  |
30 |  |
     	private Date date;
31 |  |
32 |  |
     	private String messageId;
33 |  |
34 |  |
     	private int size;
35 |  |
36 |  |
     	private List receivedHeaders;
37 |  |
38 |  |
     	private MimeMessage message;
39 |  |
40 |  |
     	/**
41 |  |
     	 * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£
42 |  |
     	 */
43 |  |
     	public ReceivedMail() {
44 |  |
     		super();
45 |  |
     	}
46 |  |
47 |  |
     	/**
48 |  |
     	 * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£
49 |  |
     	 *
50 |  |
     	 * @param charset
51 |  |
     	 */
52 |  |
     	public ReceivedMail(String charset) {
53 |  |
     		super(charset);
54 |  |
     	}
55 |  |
56 |  |
     	/**
57 |  |
     	 * ¥³¥Ô¡¼¥³¥ó¥¹¥È¥é¥¯¥¿¡£
58 |  |
     	 *
59 |  |
     	 * @param original
60 |  |
     	 */
61 |  |
     	public ReceivedMail(Mail original) {
62 |  |
     		super(original);
63 |  |
     	}
64 |  |
65 |  |
     	/**
66 |  |
     	 * Á÷¿®Æ?»?¤òÊÖ¤·¤Þ¤¹¡£
67 |  |
     	 * <p>
68 |  |
     	 * Ã?: ¥á¡¼¥?¤Î¼õ¿®Æ?»?¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
69 |  |
     	 *
70 |  |
     	 * @return Á÷¿®Æ?»?
71 |  |
     	 */
72 |  |
     	public Date getDate() {
73 |  |
     		return date;
74 |  |
     	}
75 |  |
76 |  |
     	/**
77 |  |
     	 * Á÷¿®Æ?»?¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
78 |  |
     	 *
79 |  |
     	 * @param date Á÷¿®Æ?»?
80 |  |
     	 */
81 |  |
     	public void setDate(Date date) {
82 |  |
     		this.date = date;
83 |  |
     	}
84 |  |
85 |  |
     	/**
86 |  |
     	 * Á°¸å¤Ë&lt;&gt;¤¬ÉÕ¤¤¤¿¥á¥Ã¥»¡¼¥¸ID¤òÊÖ¤·¤Þ¤¹¡£
87 |  |
     	 *
88 |  |
     	 * @return Á°¸å¤Ë&lt;&gt;¤¬ÉÕ¤¤¤¿¥á¥Ã¥»¡¼¥¸ID
89 |  |
     	 */
90 |  |
     	public String getMessageId() {
91 |  |
     		if (messageId.startsWith("<") && messageId.endsWith(">")) {
92 |  |
     			return messageId;
93 |  |
     		}
94 |  |
     		return "<" + messageId + ">";
95 |  |
     	}
96 |  |
97 |  |
     	/**
98 |  |
     	 * ¥á¥Ã¥»¡¼¥¸ID¤òÊÖ¤·¤Þ¤¹¡£Á°¸å¤Ë&lt;&gt;¤ÏÉÕ¤¤Þ¤»¤ó¡£
99 |  |
     	 *
100 |  |
     	 * @return ¥á¥Ã¥»¡¼¥¸ID
101 |  |
     	 */
102 |  |
     	public String getMessageIdWithoutBracket() {
103 |  |
     		if (messageId.startsWith("<") && messageId.endsWith(">")) {
104 |  |
     			return messageId.substring(1, messageId.length() - 1);
105 |  |
     		}
106 |  |
     		return messageId;
107 |  |
     	}
108 |  |
109 |  |
     	/**
110 |  |
     	 * ¥á¥Ã¥»¡¼¥¸ID¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
111 |  |
     	 *
112 |  |
     	 * @param messageId ¥á¥Ã¥»¡¼¥¸ID
113 |  |
     	 */
114 |  |
     	public void setMessageId(String messageId) {
115 |  |
     		this.messageId = messageId;
116 |  |
     	}
117 |  |
118 |  |
     	/**
119 |  |
     	 * In-Reply-To¥Ø¥Ã¥À¤ÎÃÍ¤òÊÖ¤·¤Þ¤¹¡£
120 |  |
     	 * In-Reply-To¥Ø¥Ã¥À¤¬¤Ê¤¤¾?¹ç¤Ïnull¤òÊÖ¤·¤Þ¤¹¡£
121 |  |
     	 *
122 |  |
     	 * @return In-Reply-To¥Ø¥Ã¥À¤ÎÃÍ
123 |  |
     	 */
124 |  |
     	public String getInReplyTo() {
125 |  |
     		return (String)headers.get("In-Reply-To");
126 |  |
     	}
127 |  |
128 |  |
     	/**
129 |  |
     	 * References¥Ø¥Ã¥À¤ÎÃÍ¤òÊÖ¤·¤Þ¤¹¡£
130 |  |
     	 * References¥Ø¥Ã¥À¤¬¤Ê¤¤¾?¹ç¤Ïnull¤òÊÖ¤·¤Þ¤¹¡£
131 |  |
     	 *
132 |  |
     	 * @return References¥Ø¥Ã¥À¤ÎÃÍ
133 |  |
     	 */
134 |  |
     	public String getRefereces() {
135 |  |
     		return (String)headers.get("References");
136 |  |
     	}
137 |  |
138 |  |
     	/**
139 |  |
     	 * @return ÊÖ¿®»?¤Î·?Ì¾¤ËÉÕ¤±¤?ÀÜÆ¬¼
140 |  |
     	 */
141 |  |
     	public String getReplySubjectPrefix() {
142 |  |
     		return replySubjectPrefix;
143 |  |
     	}
144 |  |
145 |  |
     	/**
146 |  |
     	 * ÊÖ¿®»?¤Î·?Ì¾¤ËÉÕ¤±¤?ÀÜÆ¬¼¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
147 |  |
     	 * ¥Ç¥Õ¥©¥?¥È¤Ï¡ÖRe: ¡×¡£
148 |  |
     	 *
149 |  |
     	 * @param replySubjectPrefix ÊÖ¿®»?¤Î·?Ì¾¤ËÉÕ¤±¤?ÀÜÆ¬¼
150 |  |
     	 */
151 |  |
     	public void setReplySubjectPrefix(String replySubjectPrefix) {
152 |  |
     		this.replySubjectPrefix = replySubjectPrefix;
153 |  |
     	}
154 |  |
155 |  |
     	/**
156 |  |
     	 * ¥á¡¼¥?ÆâÍÆ¤ò½ÐÎÏ¤·¤Þ¤¹¡£<br>
157 |  |
     	 * ¥á¡¼¥?¤Î¥½¡¼¥¹¤Ë»÷¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç½ÐÎÏ¤µ¤?¤Þ¤¹¡£
158 |  |
     	 *
159 |  |
     	 * @see java.lang.Object#toString()
160 |  |
     	 */
161 |  |
     	public String toString() {
162 |  |
     		StringBuffer buf = new StringBuffer(1000);
163 |  |
     		buf.append("Mail\n");
164 |  |
     		buf.append("Return-Path: ").append(returnPath).append("\n");
165 |  |
     		buf.append("Message-ID: ").append(messageId).append("\n");
166 |  |
     		buf.append("Date: ").append(date).append("\n");
167 |  |
     		buf.append("From: ").append(from != null ? from.toUnicodeString() : class="keyword">null).append("\n");
168 |  |
     		buf.append("To: ").append(arrayToCommaDelimitedString(to)).append("\n");
169 |  |
     		buf.append("Cc: ").append(arrayToCommaDelimitedString(cc)).append("\n");
170 |  |
     		buf.append("Bcc: ").append(arrayToCommaDelimitedString(bcc)).append("\n");
171 |  |
     		buf.append("Reply-To: ").append(replyTo != null ? replyTo.toUnicodeString() : class="keyword">null).append(
172 |  |
     				"\n");
173 |  |
     		buf.append("Subject: ").append(subject).append("\n");
174 |  |
175 |  |
     		if (headers != null) {
176 |  |
     			for (Iterator itr = headers.keySet().iterator(); itr.hasNext();) {
177 |  |
     				String header = (String)itr.next();
178 |  |
     				String value = (String)headers.get(header);
179 |  |
     				buf.append(header).append(": ").append(value).append("\n");
180 |  |
     			}
181 |  |
     		}
182 |  |
183 |  |
     		buf.append("\n");
184 |  |
     		buf.append(text);
185 |  |
186 |  |
     		if (htmlText != null) {
187 |  |
     			buf.append("\n\n-----\n\n");
188 |  |
     			buf.append(htmlText);
189 |  |
     		}
190 |  |
191 |  |
     		if (isFileAttached()) {
192 |  |
     			buf.append("\n\nAttachments\n");
193 |  |
     			for (int i = 0, num = attachmentFiles.size(); i < num; i++) {
194 |  |
     				AttachmentFile f = (AttachmentFile)attachmentFiles.get(i);
195 |  |
     				buf.append("[").append(i + 1).append("] ").append(f.getName()).append("\n");
196 |  |
     			}
197 |  |
     		}
198 |  |
199 |  |
     		return buf.toString();
200 |  |
     	}
201 |  |
202 |  |
     	/**
203 |  |
     	 * @return Returns the message.
204 |  |
     	 */
205 |  |
     	public MimeMessage getMessage() {
206 |  |
     		return message;
207 |  |
     	}
208 |  |
209 |  |
     	/**
210 |  |
     	 * @param message The message to set.
211 |  |
     	 */
212 |  |
     	public void setMessage(MimeMessage message) {
213 |  |
     		this.message = message;
214 |  |
     	}
215 |  |
216 |  |
     	/**
217 |  |
     	 * ¥á¡¼¥?¥µ¡¼¥Ð¤È¤ÎÀÜÂ³ÀÚÃÇ»?¤Ë¡¢¤³¤Î¥á¡¼¥?¤ò¥á¡¼¥?¥µ¡¼¥Ð¤«¤éº?½?¤·¤Þ¤¹¡£
218 |  |
     	 * º?½?¤Ç¤¤?¤è¤¦¤ËÀßÄê¤¬¤Ç¤¤¿¾?¹ç¤Ë true ¤òÊÖ¤·¤Þ¤¹¡£
219 |  |
     	 * <p>
220 |  |
     	 * ¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢<code>FetchMailPro</code>¤Î¥á¥½¥Ã¥É¤Ë¤è¤Ã¤Æ¼èÆÀ¤µ¤?¤¿
221 |  |
     	 * <code>ReceivedMail</code>¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤Î¤ßÍ¸ú¤Ç¤¹¡£
222 |  |
     	 * ¤Þ¤¿¡¢<code>FetchMailPro</code>¥¤¥ó¥¹¥¿¥ó¥¹¤¬¥á¡¼¥?¥µ¡¼¥Ð¤Ë
223 |  |
     	 * ÀÜÂ³¤µ¤?¤Æ¤¤¤?¾õÂÖ¤Ç¤Î¸Æ¤Ó½Ð¤·¤Î¤ßÍ¸ú¤Ç¤¹¡£<br>
224 |  |
     	 * ¤³¤?¤é¤Î¾ò·?¤¬Ë?¤¿¤µ¤?¤Ê¤¤»?¤Ë¤³¤Î¥á¥½¥Ã¥É¤¬¸Æ¤Ó½Ð¤µ¤?¤¿¾?¹?
225 |  |
     	 * false ¤òÊÖ¤·¤Þ¤¹¡£
226 |  |
     	 *
227 |  |
     	 * TODO: ¤¦¤Þ¤¯Æ°¤¤¤Æ¤Ê¤¤¡£
228 |  |
     	 *
229 |  |
     	 * @see FetchMailPro
230 |  |
     	 * @param delete º?½?¤¹¤?¤è¤¦¤ËÀßÄê¤¹¤?¾?¹? true
231 |  |
     	 * @return º?½?ÀßÄê¤¬Àµ¾?¤Ë¹Ô¤?¤?¤¿¾?¹? true
232 |  |
     	 */
233 |  |
     	public boolean setDelete(class="keyword">boolean delete) {
234 |  |
     		if (message != null) {
235 |  |
     			try {
236 |  |
     				message.setFlag(Flags.Flag.DELETED, delete);
237 |  |
     			} catch (MessagingException e) {
238 |  |
     				return false;
239 |  |
     			}
240 |  |
     			return true;
241 |  |
     		}
242 |  |
     		return false;
243 |  |
     	}
244 |  |
245 |  |
     	/**
246 |  |
     	 * ¥á¡¼¥?¤Î¥µ¥¤¥º(ÍÆÎÌ)¤òÊÖ¤·¤Þ¤¹¡£Ã±°Ì¤Ïbyte¡£
247 |  |
     	 * ¤³¤ÎÃÍ¤Ï¸·Ì©¤Ê¤â¤Î¤Ç¤Ï¤Ê¤¤¤Î¤ÇÃúÌÕ¤·¤Æ¤¯¤À¤µ¤¤¡£
248 |  |
     	 *
249 |  |
     	 * @see MimeMessage#getSize()
250 |  |
     	 * @return ¥á¡¼¥?¤Î¥µ¥¤¥º(Ã±°Ì¤Ïbyte)
251 |  |
     	 */
252 |  |
     	public int getSize() {
253 |  |
     		return size;
254 |  |
     	}
255 |  |
256 |  |
     	/**
257 |  |
     	 * ¥á¡¼¥?¤Î¥µ¥¤¥º(ÍÆÎÌ)¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£Ã±°Ì¤Ïbyte¡£
258 |  |
     	 *
259 |  |
     	 * @param size ¥á¡¼¥?¤Î¥µ¥¤¥º(Ã±°Ì¤Ïbyte)
260 |  |
     	 */
261 |  |
     	public void setSize(int size) {
262 |  |
     		this.size = size;
263 |  |
     	}
264 |  |
265 |  |
     	/**
266 |  |
     	 * ÅºÉÕ¥Õ¥¡¥¤¥?¤ÎFile¥¤¥ó¥¹¥¿¥ó¥¹ÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£
267 |  |
     	 * ÅºÉÕ¥Õ¥¡¥¤¥?¤¬¤Ê¤¤¾?¹ç¤Ï¶õ¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£
268 |  |
     	 *
269 |  |
     	 * @return ÅºÉÕ¥Õ¥¡¥¤¥?¤ÎFile¥¤¥ó¥¹¥¿¥ó¥¹ÇÛÎ?
270 |  |
     	 */
271 |  |
     	public File[] getFiles() {
272 |  |
     		AttachmentFile[] aFiles = getAttachmentFiles();
273 |  |
     		File[] files = new File[aFiles.length];
274 |  |
     		for (int i = 0; i < aFiles.length; i++) {
275 |  |
     			AttachmentFile aFile = aFiles[i];
276 |  |
     			files[i] = aFile.getFile();
277 |  |
     		}
278 |  |
     		return files;
279 |  |
     	}
280 |  |
281 |  |
     	/**
282 |  |
     	 * ¤³¤Î¥á¡¼¥?¤ÎÊÖ¿®¥á¡¼¥?ÍÑMail¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤ÆÊÖ¤·¤Þ¤¹¡£
283 |  |
     	 * <ul>
284 |  |
     	 * <li>°¸À?(To¥¢¥É¥?¥¹)¤Ë¤Ï¡¢¤³¤Î¥á¡¼¥?¤ÎReply-To¡¢¤Þ¤¿¤ÏFrom¤¬¥»¥Ã¥È¤µ¤?¤Þ¤¹¡£</li>
285 |  |
     	 * <li>·?Ì¾¤Ë¤Ï¡¢¤³¤Î¥á¡¼¥?¤Î·?Ì¾¤¬ÂçÊ¸»ú¾®Ê¸»úÌä¤?¤º¡ÖRe:¡×¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤±¤?¤Ð¡¢¡ÖRe: ¡×¤òÆ¬¤ËÉÕ¤±¤¿·?Ì¾¤¬¥»¥Ã¥È¤µ¤?¤Þ¤¹¡£¡ÖRe:¡×¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤?¾?¹ç¤Ë¤Ï¡¢¤½¤Î·?Ì¾¤ò¤½¤Î¤Þ¤Þ¥»¥Ã¥È¤·¤Þ¤¹¡£</li>
286 |  |
     	 * <li>ËÜÊ¸¤Ë¤Ï¡¢²¿¤â¥»¥Ã¥È¤µ¤?¤Þ¤»¤ó¡£</li>
287 |  |
     	 * <li>¤³¤Î¥á¡¼¥?¤ËMessage-ID¤¬¥»¥Ã¥È¤µ¤?¤Æ¤¤¤?¤Ð¡¢In-Reply-To¥Ø¥Ã¥À¤Ë¤½¤ÎÃÍ¤¬¥»¥Ã¥È¤µ¤?¤Þ¤¹¡£</li>
288 |  |
     	 * <li>¤³¤Î¥á¡¼¥?¤ËMessage-ID¤¬¥»¥Ã¥È¤µ¤?¤Æ¤¤¤?¤Ð¡¢References¥Ø¥Ã¥À¤Ë¤½¤ÎÃÍ¤¬²Ã¤¨¤é¤?¤Þ¤¹¡£</li>
289 |  |
     	 * </ul>
290 |  |
     	 *
291 |  |
     	 * @return ÊÖ¿®ÍÑ¤ÎMail¥¤¥ó¥¹¥¿¥ó¥¹
292 |  |
     	 */
293 |  |
     	public Mail reply() {
294 |  |
     		Mail mail = new Mail();
295 |  |
296 |  |
     		// °¸À?
297 |  |
     		if (getReplyTo() != null) {
298 |  |
     			mail.addTo(getReplyTo());
299 |  |
     		} else {
300 |  |
     			mail.addTo(getFrom());
301 |  |
     		}
302 |  |
303 |  |
     		// ·?Ì¾
304 |  |
     		String subject = getSubject();
305 |  |
     		if ((subject.length() >= 3 && !"Re:".equalsIgnoreCase(subject.substring(0, 3)))
306 |  |
     				|| subject.length() < 3) {
307 |  |
     			subject = replySubjectPrefix + subject;
308 |  |
     		}
309 |  |
     		mail.setSubject(subject);
310 |  |
311 |  |
     		// In-Reply-To, References
312 |  |
     		String messageId = getMessageId();
313 |  |
     		if (messageId != null && !"<>".equals(messageId)) {
314 |  |
     			String references = getRefereces();
315 |  |
     			if (references != null) {
316 |  |
     				references = messageId + " " + references;
317 |  |
     			} else if (getInReplyTo() != null) {
318 |  |
     				references = messageId + " " + getInReplyTo();
319 |  |
     			} else {
320 |  |
     				references = messageId;
321 |  |
     			}
322 |  |
     			mail.addHeader("References", references);
323 |  |
     			mail.addHeader("In-Reply-To", messageId);
324 |  |
     		}
325 |  |
326 |  |
     		return mail;
327 |  |
     	}
328 |  |
329 |  |
     	/**
330 |  |
     	 * Received¥Ø¥Ã¥À¥Õ¥£¡¼¥?¥É¤òÄÉ²Ã¤·¤Þ¤¹¡£
331 |  |
     	 *
332 |  |
     	 * @param rh Received¥Ø¥Ã¥À¥Õ¥£¡¼¥?¥É
333 |  |
     	 */
334 |  |
     	public void addReceviedHeader(ReceivedHeader rh) {
335 |  |
     		if (receivedHeaders == null) {
336 |  |
     			receivedHeaders = new ArrayList();
337 |  |
     		}
338 |  |
     		receivedHeaders.add(rh);
339 |  |
     	}
340 |  |
341 |  |
     	/**
342 |  |
     	 * Received¥Ø¥Ã¥À¥Õ¥£¡¼¥?¥É¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£<br>
343 |  |
     	 * ¼«Ê¬¤Î¥µ¡¼¥Ð(¤³¤Î¥á¡¼¥?¤¬ÆÏ¤¤¤¿¥µ¡¼¥Ð)¤«¤éÁ÷¿®¸µ¤Î¥á¡¼¥?¥µ¡¼¥Ð¤òÃ©¤?½ç¤ÇÊÂ¤ó¤Ç¤¤¤Þ¤¹¡£<br>
344 |  |
     	 * ¼õ¿®¥á¡¼¥?¤¬Received¥Ø¥Ã¥À¥Õ¥£¡¼¥?¥É¤ò»?¤¿¤Ê¤¤¡¢¤Þ¤¿¤Ï²òÀÏ¤Ç¤¤Ê¤«¤Ã¤¿¾?¹ç¤Ï¶õ¤ÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£
345 |  |
     	 *
346 |  |
     	 * @return Received¥Ø¥Ã¥À¥Õ¥£¡¼¥?¥É¤ÎÇÛÎ?
347 |  |
     	 */
348 |  |
     	public ReceivedHeader[] getReceivedHeaders() {
349 |  |
     		if (receivedHeaders == null) {
350 |  |
     			return new ReceivedHeader[0];
351 |  |
     		}
352 |  |
     		return (ReceivedHeader[])receivedHeaders
353 |  |
     				.toArray(new ReceivedHeader[receivedHeaders.size()]);
354 |  |
     	}
355 |  |
356 |  |
     	/**
357 |  |
     	 * Recevied¥Ø¥Ã¥À¥Õ¥£¡¼¥?¥É¤òÉ½¤¹¥¯¥é¥¹¡£
358 |  |
     	 */
359 |  |
     	public static class ReceivedHeader {
360 |  |
361 |  |
     		private String from;
362 |  |
363 |  |
     		private String by;
364 |  |
365 |  |
     		/**
366 |  |
     		 * @param from ¥á¡¼¥?¤òÁ÷¿®¤·¤¿¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾
367 |  |
     		 * @param by ¥á¡¼¥?¤ò¼õ¿®¤·¤¿¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾
368 |  |
     		 */
369 | 0 |
     		public ReceivedHeader(String from, String by) {
370 | 0 |
     			this.from = from;
371 | 0 |
     			this.by = by;
372 | 0 |
     		}
373 |  |
374 |  |
     		/**
375 |  |
     		 * @see java.lang.Object#toString()
376 |  |
     		 */
377 |  |
     		public String toString() {
378 | 0 |
     			return "Sent from " + from + " and received by " + by;
379 |  |
     		}
380 |  |
381 |  |
     		/**
382 |  |
     		 * ¥á¡¼¥?¤ò¼õ¿®¤·¤¿¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾¤òÊÖ¤·¤Þ¤¹¡£
383 |  |
     		 *
384 |  |
     		 * @return ¥á¡¼¥?¤ò¼õ¿®¤·¤¿¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾
385 |  |
     		 */
386 |  |
     		public String getBy() {
387 | 0 |
     			return by;
388 |  |
     		}
389 |  |
390 |  |
     		/**
391 |  |
     		 * ¥á¡¼¥?¤òÁ÷¿®¤·¤¿¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾¤òÊÖ¤·¤Þ¤¹¡£
392 |  |
     		 *
393 |  |
     		 * @return ¥á¡¼¥?¤òÁ÷¿®¤·¤¿¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾
394 |  |
     		 */
395 |  |
     		public String getFrom() {
396 | 0 |
     			return from;
397 |  |
     		}
398 |  |
     	}
399 |  |
     }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.