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 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;
124 String getTextBody() {
128 void setTextBody(String textBody) {
129 if (textBody != null) {
130 this.textBody = textBody;
134 String getHtmlBody() {
138 void setHtmlBody(String htmlBody) {
139 if (htmlBody != null) {
140 this.htmlBody = htmlBody;
144 String getRtfBody() {
148 void setRtfBody(String rtfBody) {
149 if (rtfBody != null) {
150 this.rtfBody = rtfBody;
158 void setSentDate(Date sentDate) {
159 if (sentDate != null) {
160 this.sentDate = sentDate.getTime() / 1000;
164 void setSentDate(
long sentDate) {
165 this.sentDate = sentDate;
172 void setBcc(String bcc) {
182 void setCc(String cc) {
188 void addAttachment(Attachment a) {
190 hasAttachment =
true;
193 List<Attachment> getAttachments() {
201 void setId(
long id) {
205 String getLocalPath() {
209 void setLocalPath(String localPath) {
210 if (localPath != null) {
211 this.localPath = localPath;
221 String getMessageID() {
230 void setMessageID(String messageID) {
231 this.messageID = messageID;
239 String getInReplyToID() {
248 void setInReplyToID(String inReplyToID) {
249 this.inReplyToID = inReplyToID;
258 List<String> getReferences() {
267 void setReferences(List<String> references) {
268 this.references = references;
276 void setMessageThreadID(String threadID) {
277 this.messageThreadID = threadID;
285 String getMessageThreadID() {
286 return this.messageThreadID;
296 static class Attachment {
298 private String name =
"";
300 private String localPath =
"";
302 private long size = 0L;
304 private long crTime = 0L;
306 private long cTime = 0L;
308 private long aTime = 0L;
310 private long mTime = 0L;
312 private TskData.EncodingType encodingType = TskData.EncodingType.NONE;
318 void setName(String name) {
324 String getLocalPath() {
328 void setLocalPath(String localPath) {
329 if (localPath != null) {
330 this.localPath = localPath;
338 void setSize(
long size) {
346 void setCrTime(
long crTime) {
347 this.crTime = crTime;
350 void setCrTime(Date crTime) {
351 if (crTime != null) {
352 this.crTime = crTime.getTime() / 1000;
360 void setcTime(
long cTime) {
364 void setcTime(Date cTime) {
366 this.cTime = cTime.getTime() / 1000;
374 void setaTime(
long aTime) {
378 void setaTime(Date aTime) {
380 this.aTime = aTime.getTime() / 1000;
388 void setmTime(
long mTime) {
392 void setmTime(Date mTime) {
394 this.mTime = mTime.getTime() / 1000;
398 void setEncodingType(TskData.EncodingType encodingType){
399 this.encodingType = encodingType;
402 TskData.EncodingType getEncodingType(){