Autopsy  4.12.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
EmailMessage.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2013 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.thunderbirdparser;
20 
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.List;
24 import org.sleuthkit.datamodel.TskData;
25 
32 class EmailMessage {
33 
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 = "";
54 
55  boolean hasAttachment() {
56  return hasAttachment;
57  }
58 
59  String getRecipients() {
60  return recipients;
61  }
62 
63  void setRecipients(String recipients) {
64  if (recipients != null) {
65  this.recipients = recipients;
66  }
67  }
68 
69  String getSender() {
70  return sender;
71  }
72 
73  void setSender(String sender) {
74  if (sender != null) {
75  this.sender = sender;
76  }
77  }
78 
79  String getSubject() {
80  return subject;
81  }
82 
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();
88  replySubject = true;
89  } else {
90  this.simplifiedSubject = subject;
91  }
92  } else {
93  this.simplifiedSubject = "";
94  }
95  }
96 
102  String getSimplifiedSubject() {
103  return simplifiedSubject;
104  }
105 
111  boolean isReplySubject() {
112  return replySubject;
113  }
114 
115  String getHeaders() {
116  return headers;
117  }
118 
119  void setHeaders(String headers) {
120  if (headers != null) {
121  this.headers = headers;
122  }
123  }
124  String getTextBody() {
125  return textBody;
126  }
127 
128  void setTextBody(String textBody) {
129  if (textBody != null) {
130  this.textBody = textBody;
131  }
132  }
133 
134  String getHtmlBody() {
135  return htmlBody;
136  }
137 
138  void setHtmlBody(String htmlBody) {
139  if (htmlBody != null) {
140  this.htmlBody = htmlBody;
141  }
142  }
143 
144  String getRtfBody() {
145  return rtfBody;
146  }
147 
148  void setRtfBody(String rtfBody) {
149  if (rtfBody != null) {
150  this.rtfBody = rtfBody;
151  }
152  }
153 
154  long getSentDate() {
155  return sentDate;
156  }
157 
158  void setSentDate(Date sentDate) {
159  if (sentDate != null) {
160  this.sentDate = sentDate.getTime() / 1000;
161  }
162  }
163 
164  void setSentDate(long sentDate) {
165  this.sentDate = sentDate;
166  }
167 
168  String getBcc() {
169  return bcc;
170  }
171 
172  void setBcc(String bcc) {
173  if (bcc != null) {
174  this.bcc = bcc;
175  }
176  }
177 
178  String getCc() {
179  return cc;
180  }
181 
182  void setCc(String cc) {
183  if (cc != null) {
184  this.cc = cc;
185  }
186  }
187 
188  void addAttachment(Attachment a) {
189  attachments.add(a);
190  hasAttachment = true;
191  }
192 
193  List<Attachment> getAttachments() {
194  return attachments;
195  }
196 
197  long getId() {
198  return id;
199  }
200 
201  void setId(long id) {
202  this.id = id;
203  }
204 
205  String getLocalPath() {
206  return localPath;
207  }
208 
209  void setLocalPath(String localPath) {
210  if (localPath != null) {
211  this.localPath = localPath;
212  }
213  }
214 
221  String getMessageID() {
222  return messageID;
223  }
224 
230  void setMessageID(String messageID) {
231  this.messageID = messageID;
232  }
233 
239  String getInReplyToID() {
240  return inReplyToID;
241  }
242 
248  void setInReplyToID(String inReplyToID) {
249  this.inReplyToID = inReplyToID;
250  }
251 
258  List<String> getReferences() {
259  return references;
260  }
261 
267  void setReferences(List<String> references) {
268  this.references = references;
269  }
270 
276  void setMessageThreadID(String threadID) {
277  this.messageThreadID = threadID;
278  }
279 
285  String getMessageThreadID() {
286  return this.messageThreadID;
287  }
288 
296  static class Attachment {
297 
298  private String name = "";
299 
300  private String localPath = "";
301 
302  private long size = 0L;
303 
304  private long crTime = 0L;
305 
306  private long cTime = 0L;
307 
308  private long aTime = 0L;
309 
310  private long mTime = 0L;
311 
312  private TskData.EncodingType encodingType = TskData.EncodingType.NONE;
313 
314  String getName() {
315  return name;
316  }
317 
318  void setName(String name) {
319  if (name != null) {
320  this.name = name;
321  }
322  }
323 
324  String getLocalPath() {
325  return localPath;
326  }
327 
328  void setLocalPath(String localPath) {
329  if (localPath != null) {
330  this.localPath = localPath;
331  }
332  }
333 
334  long getSize() {
335  return size;
336  }
337 
338  void setSize(long size) {
339  this.size = size;
340  }
341 
342  long getCrTime() {
343  return crTime;
344  }
345 
346  void setCrTime(long crTime) {
347  this.crTime = crTime;
348  }
349 
350  void setCrTime(Date crTime) {
351  if (crTime != null) {
352  this.crTime = crTime.getTime() / 1000;
353  }
354  }
355 
356  long getcTime() {
357  return cTime;
358  }
359 
360  void setcTime(long cTime) {
361  this.cTime = cTime;
362  }
363 
364  void setcTime(Date cTime) {
365  if (cTime != null) {
366  this.cTime = cTime.getTime() / 1000;
367  }
368  }
369 
370  long getaTime() {
371  return aTime;
372  }
373 
374  void setaTime(long aTime) {
375  this.aTime = aTime;
376  }
377 
378  void setaTime(Date aTime) {
379  if (aTime != null) {
380  this.aTime = aTime.getTime() / 1000;
381  }
382  }
383 
384  long getmTime() {
385  return mTime;
386  }
387 
388  void setmTime(long mTime) {
389  this.mTime = mTime;
390  }
391 
392  void setmTime(Date mTime) {
393  if (mTime != null) {
394  this.mTime = mTime.getTime() / 1000;
395  }
396  }
397 
398  void setEncodingType(TskData.EncodingType encodingType){
399  this.encodingType = encodingType;
400  }
401 
402  TskData.EncodingType getEncodingType(){
403  return encodingType;
404  }
405 
406  }
407 }

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.