19 package org.sleuthkit.autopsy.thunderbirdparser;
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.List;
34 private String recipients =
"";
35 private String bcc =
"";
36 private String cc =
"";
37 private String sender =
"";
38 private String subject =
"";
39 private String headers =
"";
40 private String textBody =
"";
41 private String htmlBody =
"";
42 private String rtfBody =
"";
43 private String localPath =
"";
44 private boolean hasAttachment =
false;
45 private long sentDate = 0L;
46 private final List<Attachment> attachments =
new ArrayList<>();
47 private long id = -1L;
48 private String messageID =
"";
49 private String inReplyToID =
"";
50 private List<String> references =
new ArrayList<>();
51 private String simplifiedSubject =
"";
52 private boolean replySubject =
false;
53 private String messageThreadID =
"";
55 boolean hasAttachment() {
59 String getRecipients() {
63 void setRecipients(String recipients) {
64 if (recipients != null) {
65 this.recipients = recipients;
73 void setSender(String sender) {
83 void setSubject(String subject) {
84 if (subject != null) {
85 this.subject = subject;
86 if (subject.matches(
"^[R|r][E|e].*?:.*")) {
87 this.simplifiedSubject = subject.replaceAll(
"[R|r][E|e].*?:",
"").trim();
90 this.simplifiedSubject = subject;
93 this.simplifiedSubject =
"";
102 String getSimplifiedSubject() {
103 return simplifiedSubject;
111 boolean isReplySubject() {
115 String getHeaders() {
119 void setHeaders(String headers) {
120 if (headers != null) {
121 this.headers = headers;
125 String getTextBody() {
129 void setTextBody(String textBody) {
130 if (textBody != null) {
131 this.textBody = textBody;
135 String getHtmlBody() {
139 void setHtmlBody(String htmlBody) {
140 if (htmlBody != null) {
141 this.htmlBody = htmlBody;
145 String getRtfBody() {
149 void setRtfBody(String rtfBody) {
150 if (rtfBody != null) {
151 this.rtfBody = rtfBody;
159 void setSentDate(Date sentDate) {
160 if (sentDate != null) {
161 this.sentDate = sentDate.getTime() / 1000;
165 void setSentDate(
long sentDate) {
166 this.sentDate = sentDate;
173 void setBcc(String bcc) {
183 void setCc(String cc) {
189 void addAttachment(Attachment a) {
191 hasAttachment =
true;
194 List<Attachment> getAttachments() {
202 void setId(
long id) {
206 String getLocalPath() {
210 void setLocalPath(String localPath) {
211 if (localPath != null) {
212 this.localPath = localPath;
222 String getMessageID() {
231 void setMessageID(String messageID) {
232 if (messageID != null) {
233 this.messageID = messageID;
245 String getInReplyToID() {
254 void setInReplyToID(String inReplyToID) {
255 this.inReplyToID = inReplyToID;
264 List<String> getReferences() {
273 void setReferences(List<String> references) {
274 this.references = references;
282 void setMessageThreadID(String threadID) {
283 this.messageThreadID = threadID;
291 String getMessageThreadID() {
292 return this.messageThreadID;
302 static class Attachment {
304 private String name =
"";
306 private String localPath =
"";
308 private long size = 0L;
310 private long crTime = 0L;
312 private long cTime = 0L;
314 private long aTime = 0L;
316 private long mTime = 0L;
318 private TskData.EncodingType encodingType = TskData.EncodingType.NONE;
324 void setName(String name) {
330 String getLocalPath() {
334 void setLocalPath(String localPath) {
335 if (localPath != null) {
336 this.localPath = localPath;
344 void setSize(
long size) {
352 void setCrTime(
long crTime) {
353 this.crTime = crTime;
356 void setCrTime(Date crTime) {
357 if (crTime != null) {
358 this.crTime = crTime.getTime() / 1000;
366 void setcTime(
long cTime) {
370 void setcTime(Date cTime) {
372 this.cTime = cTime.getTime() / 1000;
380 void setaTime(
long aTime) {
384 void setaTime(Date aTime) {
386 this.aTime = aTime.getTime() / 1000;
394 void setmTime(
long mTime) {
398 void setmTime(Date mTime) {
400 this.mTime = mTime.getTime() / 1000;
404 void setEncodingType(TskData.EncodingType encodingType) {
405 this.encodingType = encodingType;
408 TskData.EncodingType getEncodingType() {
414 static class AttachedEmailMessage
extends Attachment {
415 private final EmailMessage emailMessage;
417 AttachedEmailMessage(EmailMessage emailMessage) {
418 this.emailMessage = emailMessage;
421 EmailMessage getEmailMessage() {