mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
2229: Use getOpenCase() instead of getCurrentCase()
This commit is contained in:
parent
73c97dc2bd
commit
863e3b7a1b
@ -23,12 +23,15 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
import org.sleuthkit.autopsy.actions.AddContentTagAction;
|
import org.sleuthkit.autopsy.actions.AddContentTagAction;
|
||||||
import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction;
|
import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.ContextMenuExtensionPoint;
|
import org.sleuthkit.autopsy.coreutils.ContextMenuExtensionPoint;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
@ -71,8 +74,12 @@ public class ExplorerNodeActionVisitor extends ContentVisitor.Default<List<? ext
|
|||||||
public List<? extends Action> visit(final Image img) {
|
public List<? extends Action> visit(final Image img) {
|
||||||
List<Action> lst = new ArrayList<>();
|
List<Action> lst = new ArrayList<>();
|
||||||
//TODO lst.add(new ExtractAction("Extract Image", img));
|
//TODO lst.add(new ExtractAction("Extract Image", img));
|
||||||
lst.add(new ExtractUnallocAction(
|
try {
|
||||||
|
lst.add(new ExtractUnallocAction(
|
||||||
NbBundle.getMessage(this.getClass(), "ExplorerNodeActionVisitor.action.extUnallocToSingleFiles"), img));
|
NbBundle.getMessage(this.getClass(), "ExplorerNodeActionVisitor.action.extUnallocToSingleFiles"), img));
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
Logger.getLogger(ExplorerNodeActionVisitor.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
}
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,8 +91,12 @@ public class ExplorerNodeActionVisitor extends ContentVisitor.Default<List<? ext
|
|||||||
@Override
|
@Override
|
||||||
public List<? extends Action> visit(final Volume vol) {
|
public List<? extends Action> visit(final Volume vol) {
|
||||||
List<AbstractAction> lst = new ArrayList<>();
|
List<AbstractAction> lst = new ArrayList<>();
|
||||||
lst.add(new ExtractUnallocAction(
|
try {
|
||||||
|
lst.add(new ExtractUnallocAction(
|
||||||
NbBundle.getMessage(this.getClass(), "ExplorerNodeActionVisitor.action.extUnallocToSingleFile"), vol));
|
NbBundle.getMessage(this.getClass(), "ExplorerNodeActionVisitor.action.extUnallocToSingleFile"), vol));
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
Logger.getLogger(ExplorerNodeActionVisitor.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
}
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,14 +69,14 @@ final class ExtractUnallocAction extends AbstractAction {
|
|||||||
private long currentImage = 0L;
|
private long currentImage = 0L;
|
||||||
private final boolean isImage;
|
private final boolean isImage;
|
||||||
|
|
||||||
public ExtractUnallocAction(String title, Volume volume) {
|
public ExtractUnallocAction(String title, Volume volume) throws NoCurrentCaseException {
|
||||||
super(title);
|
super(title);
|
||||||
isImage = false;
|
isImage = false;
|
||||||
OutputFileData outputFileData = new OutputFileData(volume);
|
OutputFileData outputFileData = new OutputFileData(volume);
|
||||||
filesToExtract.add(outputFileData);
|
filesToExtract.add(outputFileData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExtractUnallocAction(String title, Image image) {
|
public ExtractUnallocAction(String title, Image image) throws NoCurrentCaseException {
|
||||||
super(title);
|
super(title);
|
||||||
isImage = true;
|
isImage = true;
|
||||||
currentImage = image.getId();
|
currentImage = image.getId();
|
||||||
@ -596,14 +596,14 @@ final class ExtractUnallocAction extends AbstractAction {
|
|||||||
*
|
*
|
||||||
* @param img Image file to be analyzed
|
* @param img Image file to be analyzed
|
||||||
*/
|
*/
|
||||||
OutputFileData(Image img) {
|
OutputFileData(Image img) throws NoCurrentCaseException {
|
||||||
this.layoutFiles = getUnallocFiles(img);
|
this.layoutFiles = getUnallocFiles(img);
|
||||||
Collections.sort(layoutFiles, new SortObjId());
|
Collections.sort(layoutFiles, new SortObjId());
|
||||||
this.volumeId = 0;
|
this.volumeId = 0;
|
||||||
this.imageId = img.getId();
|
this.imageId = img.getId();
|
||||||
this.imageName = img.getName();
|
this.imageName = img.getName();
|
||||||
this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + 0 + ".dat"; //NON-NLS
|
this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + 0 + ".dat"; //NON-NLS
|
||||||
this.fileInstance = new File(Case.getCurrentCase().getExportDirectory() + File.separator + this.fileName);
|
this.fileInstance = new File(Case.getOpenCase().getExportDirectory() + File.separator + this.fileName);
|
||||||
this.sizeInBytes = calcSizeInBytes();
|
this.sizeInBytes = calcSizeInBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,7 +612,7 @@ final class ExtractUnallocAction extends AbstractAction {
|
|||||||
*
|
*
|
||||||
* @param volume Volume file to be analyzed
|
* @param volume Volume file to be analyzed
|
||||||
*/
|
*/
|
||||||
OutputFileData(Volume volume) {
|
OutputFileData(Volume volume) throws NoCurrentCaseException {
|
||||||
try {
|
try {
|
||||||
this.imageName = volume.getDataSource().getName();
|
this.imageName = volume.getDataSource().getName();
|
||||||
this.imageId = volume.getDataSource().getId();
|
this.imageId = volume.getDataSource().getId();
|
||||||
@ -623,7 +623,7 @@ final class ExtractUnallocAction extends AbstractAction {
|
|||||||
this.imageId = 0;
|
this.imageId = 0;
|
||||||
}
|
}
|
||||||
this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + volumeId + ".dat"; //NON-NLS
|
this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + volumeId + ".dat"; //NON-NLS
|
||||||
this.fileInstance = new File(Case.getCurrentCase().getExportDirectory() + File.separator + this.fileName);
|
this.fileInstance = new File(Case.getOpenCase().getExportDirectory() + File.separator + this.fileName);
|
||||||
this.layoutFiles = getUnallocFiles(volume);
|
this.layoutFiles = getUnallocFiles(volume);
|
||||||
Collections.sort(layoutFiles, new SortObjId());
|
Collections.sort(layoutFiles, new SortObjId());
|
||||||
this.sizeInBytes = calcSizeInBytes();
|
this.sizeInBytes = calcSizeInBytes();
|
||||||
|
@ -41,17 +41,23 @@ import org.sleuthkit.datamodel.*;
|
|||||||
|
|
||||||
abstract class Extract {
|
abstract class Extract {
|
||||||
|
|
||||||
protected Case currentCase = Case.getCurrentCase();
|
protected Case currentCase;
|
||||||
protected SleuthkitCase tskCase = currentCase.getSleuthkitCase();
|
protected SleuthkitCase tskCase;
|
||||||
private final Logger logger = Logger.getLogger(this.getClass().getName());
|
private final Logger logger = Logger.getLogger(this.getClass().getName());
|
||||||
private final ArrayList<String> errorMessages = new ArrayList<>();
|
private final ArrayList<String> errorMessages = new ArrayList<>();
|
||||||
String moduleName = "";
|
String moduleName = "";
|
||||||
boolean dataFound = false;
|
boolean dataFound = false;
|
||||||
|
|
||||||
Extract() {
|
Extract() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void init() throws IngestModuleException {
|
void init() throws IngestModuleException {
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
tskCase = currentCase.getSleuthkitCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
throw new IngestModuleException("Exception while getting open case.", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract void process(Content dataSource, IngestJobContext context);
|
abstract void process(Content dataSource, IngestJobContext context);
|
||||||
|
@ -56,6 +56,7 @@ import org.apache.james.mime4j.stream.MimeConfig;
|
|||||||
import org.apache.tika.parser.txt.CharsetDetector;
|
import org.apache.tika.parser.txt.CharsetDetector;
|
||||||
import org.apache.tika.parser.txt.CharsetMatch;
|
import org.apache.tika.parser.txt.CharsetMatch;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServices;
|
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
import org.sleuthkit.datamodel.EncodedFileOutputStream;
|
import org.sleuthkit.datamodel.EncodedFileOutputStream;
|
||||||
@ -267,8 +268,18 @@ class MboxParser {
|
|||||||
* @param email
|
* @param email
|
||||||
* @param e
|
* @param e
|
||||||
*/
|
*/
|
||||||
|
@NbBundle.Messages ({"MboxParser.handleAttch.noOpenCase.errMsg=Exception while getting open case."})
|
||||||
private void handleAttachment(EmailMessage email, Entity e, long fileID, int index) {
|
private void handleAttachment(EmailMessage email, Entity e, long fileID, int index) {
|
||||||
String outputDirPath = ThunderbirdMboxFileIngestModule.getModuleOutputPath() + File.separator;
|
String outputDirPath;
|
||||||
|
String relModuleOutputPath;
|
||||||
|
try {
|
||||||
|
outputDirPath = ThunderbirdMboxFileIngestModule.getModuleOutputPath() + File.separator;
|
||||||
|
relModuleOutputPath = ThunderbirdMboxFileIngestModule.getRelModuleOutputPath() + File.separator;
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
addErrorMessage(Bundle.MboxParser_handleAttch_noOpenCase_errMsg());
|
||||||
|
logger.log(Level.INFO, Bundle.MboxParser_handleAttch_noOpenCase_errMsg(), ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
String filename = e.getFilename();
|
String filename = e.getFilename();
|
||||||
|
|
||||||
// sanitize name. Had an attachment with a Japanese encoded path that
|
// sanitize name. Had an attachment with a Japanese encoded path that
|
||||||
@ -325,8 +336,7 @@ class MboxParser {
|
|||||||
|
|
||||||
EmailMessage.Attachment attach = new EmailMessage.Attachment();
|
EmailMessage.Attachment attach = new EmailMessage.Attachment();
|
||||||
attach.setName(filename);
|
attach.setName(filename);
|
||||||
attach.setLocalPath(ThunderbirdMboxFileIngestModule.getRelModuleOutputPath()
|
attach.setLocalPath(relModuleOutputPath + uniqueFilename);
|
||||||
+ File.separator + uniqueFilename);
|
|
||||||
attach.setSize(new File(outPath).length());
|
attach.setSize(new File(outPath).length());
|
||||||
attach.setEncodingType(TskData.EncodingType.XOR1);
|
attach.setEncodingType(TskData.EncodingType.XOR1);
|
||||||
email.addAttachment(attach);
|
email.addAttachment(attach);
|
||||||
|
@ -33,6 +33,8 @@ import java.util.List;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestModule;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMonitor;
|
import org.sleuthkit.autopsy.ingest.IngestMonitor;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServices;
|
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||||
import static org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.getRelModuleOutputPath;
|
import static org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.getRelModuleOutputPath;
|
||||||
@ -206,7 +208,15 @@ class PstParser {
|
|||||||
*/
|
*/
|
||||||
private void extractAttachments(EmailMessage email, PSTMessage msg, long fileID) {
|
private void extractAttachments(EmailMessage email, PSTMessage msg, long fileID) {
|
||||||
int numberOfAttachments = msg.getNumberOfAttachments();
|
int numberOfAttachments = msg.getNumberOfAttachments();
|
||||||
String outputDirPath = ThunderbirdMboxFileIngestModule.getModuleOutputPath() + File.separator;
|
String outputDirPath;
|
||||||
|
try {
|
||||||
|
outputDirPath = ThunderbirdMboxFileIngestModule.getModuleOutputPath() + File.separator;
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
addErrorMessage(
|
||||||
|
NbBundle.getMessage(this.getClass(), "PstParser.extractAttch.errMsg.failedToExtractToDisk",
|
||||||
|
filename));
|
||||||
|
logger.log(Level.WARNING, "Failed to extract attachment from pst file.", ex); //NON-NLS
|
||||||
|
}
|
||||||
for (int x = 0; x < numberOfAttachments; x++) {
|
for (int x = 0; x < numberOfAttachments; x++) {
|
||||||
String filename = "";
|
String filename = "";
|
||||||
try {
|
try {
|
||||||
@ -237,7 +247,7 @@ class PstParser {
|
|||||||
attachment.setSize(attach.getFilesize());
|
attachment.setSize(attach.getFilesize());
|
||||||
attachment.setEncodingType(TskData.EncodingType.XOR1);
|
attachment.setEncodingType(TskData.EncodingType.XOR1);
|
||||||
email.addAttachment(attachment);
|
email.addAttachment(attachment);
|
||||||
} catch (PSTException | IOException | NullPointerException ex) {
|
} catch (PSTException | IOException | NullPointerException | NoCurrentCaseException ex) {
|
||||||
/**
|
/**
|
||||||
* Swallowing null pointer as it is caused by a problem with
|
* Swallowing null pointer as it is caused by a problem with
|
||||||
* getting input stream (library problem).
|
* getting input stream (library problem).
|
||||||
|
@ -28,9 +28,11 @@ import java.util.Set;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.FileManager;
|
import org.sleuthkit.autopsy.casemodule.services.FileManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -76,13 +78,22 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
@Override
|
@Override
|
||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
fileManager = Case.getCurrentCase().getServices().getFileManager();
|
try {
|
||||||
|
fileManager = Case.getOpenCase().getServices().getFileManager();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(AbstractFile abstractFile) {
|
public ProcessResult process(AbstractFile abstractFile) {
|
||||||
|
|
||||||
blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
try {
|
||||||
|
blackboard = Case.getOpenCase().getServices().getBlackboard();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
return ProcessResult.ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
// skip known
|
// skip known
|
||||||
if (abstractFile.getKnown().equals(TskData.FileKnown.KNOWN)) {
|
if (abstractFile.getKnown().equals(TskData.FileKnown.KNOWN)) {
|
||||||
@ -133,8 +144,14 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
*/
|
*/
|
||||||
@Messages({"ThunderbirdMboxFileIngestModule.processPst.indexError.message=Failed to index encryption detected artifact for keyword search."})
|
@Messages({"ThunderbirdMboxFileIngestModule.processPst.indexError.message=Failed to index encryption detected artifact for keyword search."})
|
||||||
private ProcessResult processPst(AbstractFile abstractFile) {
|
private ProcessResult processPst(AbstractFile abstractFile) {
|
||||||
String fileName = getTempPath() + File.separator + abstractFile.getName()
|
String fileName;
|
||||||
|
try {
|
||||||
|
fileName = getTempPath() + File.separator + abstractFile.getName()
|
||||||
+ "-" + String.valueOf(abstractFile.getId());
|
+ "-" + String.valueOf(abstractFile.getId());
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return ProcessResult.ERROR;
|
||||||
|
}
|
||||||
File file = new File(fileName);
|
File file = new File(fileName);
|
||||||
|
|
||||||
long freeSpace = services.getFreeDiskSpace();
|
long freeSpace = services.getFreeDiskSpace();
|
||||||
@ -225,8 +242,14 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
emailFolder = emailFolder + mboxFileName;
|
emailFolder = emailFolder + mboxFileName;
|
||||||
emailFolder = emailFolder.replaceAll(".sbd", ""); //NON-NLS
|
emailFolder = emailFolder.replaceAll(".sbd", ""); //NON-NLS
|
||||||
|
|
||||||
String fileName = getTempPath() + File.separator + abstractFile.getName()
|
String fileName;
|
||||||
|
try {
|
||||||
|
fileName = getTempPath() + File.separator + abstractFile.getName()
|
||||||
+ "-" + String.valueOf(abstractFile.getId());
|
+ "-" + String.valueOf(abstractFile.getId());
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return ProcessResult.ERROR;
|
||||||
|
}
|
||||||
File file = new File(fileName);
|
File file = new File(fileName);
|
||||||
|
|
||||||
long freeSpace = services.getFreeDiskSpace();
|
long freeSpace = services.getFreeDiskSpace();
|
||||||
@ -270,8 +293,8 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getTempPath() {
|
public static String getTempPath() throws NoCurrentCaseException {
|
||||||
String tmpDir = Case.getCurrentCase().getTempDirectory() + File.separator
|
String tmpDir = Case.getOpenCase().getTempDirectory() + File.separator
|
||||||
+ "EmailParser"; //NON-NLS
|
+ "EmailParser"; //NON-NLS
|
||||||
File dir = new File(tmpDir);
|
File dir = new File(tmpDir);
|
||||||
if (dir.exists() == false) {
|
if (dir.exists() == false) {
|
||||||
@ -280,8 +303,8 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
return tmpDir;
|
return tmpDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getModuleOutputPath() {
|
public static String getModuleOutputPath() throws NoCurrentCaseException {
|
||||||
String outDir = Case.getCurrentCase().getModuleDirectory() + File.separator
|
String outDir = Case.getOpenCase().getModuleDirectory() + File.separator
|
||||||
+ EmailParserModuleFactory.getModuleName();
|
+ EmailParserModuleFactory.getModuleName();
|
||||||
File dir = new File(outDir);
|
File dir = new File(outDir);
|
||||||
if (dir.exists() == false) {
|
if (dir.exists() == false) {
|
||||||
@ -290,8 +313,8 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
return outDir;
|
return outDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getRelModuleOutputPath() {
|
public static String getRelModuleOutputPath() throws NoCurrentCaseException {
|
||||||
return Case.getCurrentCase().getModuleOutputDirectoryRelativePath() + File.separator
|
return Case.getOpenCase().getModuleOutputDirectoryRelativePath() + File.separator
|
||||||
+ EmailParserModuleFactory.getModuleName();
|
+ EmailParserModuleFactory.getModuleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,11 +431,19 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
String senderAddress;
|
String senderAddress;
|
||||||
senderAddressList.addAll(findEmailAddresess(from));
|
senderAddressList.addAll(findEmailAddresess(from));
|
||||||
|
|
||||||
AccountFileInstance senderAccountInstance = null;
|
AccountFileInstance senderAccountInstance = null;
|
||||||
|
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (senderAddressList.size() == 1) {
|
if (senderAddressList.size() == 1) {
|
||||||
senderAddress = senderAddressList.get(0);
|
senderAddress = senderAddressList.get(0);
|
||||||
try {
|
try {
|
||||||
senderAccountInstance = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL, senderAddress, EmailParserModuleFactory.getModuleName(), abstractFile);
|
senderAccountInstance = openCase.getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL, senderAddress, EmailParserModuleFactory.getModuleName(), abstractFile);
|
||||||
}
|
}
|
||||||
catch(TskCoreException ex) {
|
catch(TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Failed to create account for email address " + senderAddress, ex); //NON-NLS
|
logger.log(Level.WARNING, "Failed to create account for email address " + senderAddress, ex); //NON-NLS
|
||||||
@ -431,7 +462,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
recipientAddresses.forEach((addr) -> {
|
recipientAddresses.forEach((addr) -> {
|
||||||
try {
|
try {
|
||||||
AccountFileInstance recipientAccountInstance =
|
AccountFileInstance recipientAccountInstance =
|
||||||
Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL, addr,
|
openCase.getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL, addr,
|
||||||
EmailParserModuleFactory.getModuleName(), abstractFile);
|
EmailParserModuleFactory.getModuleName(), abstractFile);
|
||||||
recipientAccountInstances.add(recipientAccountInstance);
|
recipientAccountInstances.add(recipientAccountInstance);
|
||||||
}
|
}
|
||||||
@ -467,7 +498,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
bbart.addAttributes(bbattributes);
|
bbart.addAttributes(bbattributes);
|
||||||
|
|
||||||
// Add account relationships
|
// Add account relationships
|
||||||
Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager().addRelationships(senderAccountInstance, recipientAccountInstances, bbart,Relationship.Type.MESSAGE, dateL);
|
openCase.getSleuthkitCase().getCommunicationsManager().addRelationships(senderAccountInstance, recipientAccountInstances, bbart,Relationship.Type.MESSAGE, dateL);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// index the artifact for keyword search
|
// index the artifact for keyword search
|
||||||
|
Loading…
x
Reference in New Issue
Block a user