01: package org.columba.mail.search;
02:
03: import java.net.URI;
04: import java.net.URISyntaxException;
05: import java.util.Date;
06:
07: import org.columba.mail.folder.IMailbox;
08: import org.columba.mail.message.IColumbaHeader;
09: import org.columba.ristretto.message.Address;
10:
11: public class SearchResultBuilder {
12:
13: public static String createSubject(IColumbaHeader h) {
14: return (String) h.get("columba.subject");
15: }
16:
17: public static Date createDate(IColumbaHeader h) {
18: return (Date) h.get("columba.date");
19: }
20:
21: public static String createFrom(IColumbaHeader h) {
22: return ((Address) h.get("columba.from")).toString();
23: }
24:
25: public static URI createURI(String folderId, Object messageId) {
26: URI uri = null;
27: try {
28: uri = new URI("columba://org.columba.mail/" + folderId
29: + "/" + messageId);
30: } catch (URISyntaxException e) {
31: e.printStackTrace();
32: }
33: return uri;
34: }
35:
36: }
|