mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge remote-tracking branch 'upstream/develop' into 3575_PhotoRecCorruptedFilesSetting
This commit is contained in:
commit
33ea11b79e
@ -107,9 +107,15 @@ class AddImageTask implements Runnable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Case currentCase;
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
progressMonitor.setIndeterminate(true);
|
progressMonitor.setIndeterminate(true);
|
||||||
progressMonitor.setProgress(0);
|
progressMonitor.setProgress(0);
|
||||||
Case currentCase = Case.getCurrentCase();
|
|
||||||
String imageWriterPath = "";
|
String imageWriterPath = "";
|
||||||
if (imageWriterSettings != null) {
|
if (imageWriterSettings != null) {
|
||||||
imageWriterPath = imageWriterSettings.getPath();
|
imageWriterPath = imageWriterSettings.getPath();
|
||||||
|
@ -583,6 +583,8 @@ public class Case {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Deprecated. Use getOpenCase() instead.
|
||||||
|
*
|
||||||
* Gets the current case, if there is one, at the time of the call.
|
* Gets the current case, if there is one, at the time of the call.
|
||||||
*
|
*
|
||||||
* @return The current case.
|
* @return The current case.
|
||||||
|
@ -66,7 +66,7 @@ final class CaseDeleteAction extends CallableSystemAction {
|
|||||||
"# {0} - exception message", "Case.deleteCaseFailureMessageBox.message=Error deleting case: {0}",})
|
"# {0} - exception message", "Case.deleteCaseFailureMessageBox.message=Error deleting case: {0}",})
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getOpenCase();
|
||||||
String caseName = currentCase.getName();
|
String caseName = currentCase.getName();
|
||||||
String caseDirectory = currentCase.getCaseDirectory();
|
String caseDirectory = currentCase.getCaseDirectory();
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ final class CaseDeleteAction extends CallableSystemAction {
|
|||||||
}
|
}
|
||||||
}.execute();
|
}.execute();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Case delete action called with no current case", ex);
|
logger.log(Level.SEVERE, "Case delete action called with no current case", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import javax.swing.event.DocumentEvent;
|
|||||||
import javax.swing.event.DocumentListener;
|
import javax.swing.event.DocumentListener;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import static org.sleuthkit.autopsy.casemodule.Bundle.*;
|
import static org.sleuthkit.autopsy.casemodule.Bundle.*;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
|
||||||
@ -306,7 +307,9 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
|
|||||||
*
|
*
|
||||||
* @return true if a proper image has been selected, false otherwise
|
* @return true if a proper image has been selected, false otherwise
|
||||||
*/
|
*/
|
||||||
@NbBundle.Messages("ImageFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive")
|
@NbBundle.Messages({"ImageFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive",
|
||||||
|
"ImageFilePanel.pathValidation.getOpenCase.Error=Warning: Exception while getting open case."
|
||||||
|
})
|
||||||
public boolean validatePanel() {
|
public boolean validatePanel() {
|
||||||
pathErrorLabel.setVisible(false);
|
pathErrorLabel.setVisible(false);
|
||||||
String path = getContentPaths();
|
String path = getContentPaths();
|
||||||
@ -315,9 +318,14 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display warning if there is one (but don't disable "next" button)
|
// Display warning if there is one (but don't disable "next" button)
|
||||||
if (false == PathValidator.isValid(path, Case.getCurrentCase().getCaseType())) {
|
try {
|
||||||
|
if (false == PathValidator.isValid(path, Case.getOpenCase().getCaseType())) {
|
||||||
|
pathErrorLabel.setVisible(true);
|
||||||
|
pathErrorLabel.setText(Bundle.ImageFilePanel_pathValidation_dataSourceOnCDriveError());
|
||||||
|
}
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
pathErrorLabel.setVisible(true);
|
pathErrorLabel.setVisible(true);
|
||||||
pathErrorLabel.setText(Bundle.ImageFilePanel_pathValidation_dataSourceOnCDriveError());
|
pathErrorLabel.setText(Bundle.ImageFilePanel_pathValidation_getOpenCase_Error());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new File(path).isFile()
|
return new File(path).isFile()
|
||||||
|
@ -31,6 +31,7 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.openide.modules.InstalledFileLocator;
|
import org.openide.modules.InstalledFileLocator;
|
||||||
|
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.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
|
@ -275,17 +275,23 @@ final class LocalFilesPanel extends javax.swing.JPanel {
|
|||||||
*
|
*
|
||||||
* @param paths Absolute paths to the selected data source
|
* @param paths Absolute paths to the selected data source
|
||||||
*/
|
*/
|
||||||
|
@NbBundle.Messages("LocalFilesPanel.pathValidation.error=WARNING: Exception while gettting opon case.")
|
||||||
private void warnIfPathIsInvalid(final List<String> pathsList) {
|
private void warnIfPathIsInvalid(final List<String> pathsList) {
|
||||||
errorLabel.setVisible(false);
|
errorLabel.setVisible(false);
|
||||||
|
|
||||||
final Case.CaseType currentCaseType = Case.getCurrentCase().getCaseType();
|
try {
|
||||||
|
final Case.CaseType currentCaseType = Case.getOpenCase().getCaseType();
|
||||||
|
|
||||||
for (String currentPath : pathsList) {
|
for (String currentPath : pathsList) {
|
||||||
if (!PathValidator.isValid(currentPath, currentCaseType)) {
|
if (!PathValidator.isValid(currentPath, currentCaseType)) {
|
||||||
errorLabel.setVisible(true);
|
errorLabel.setVisible(true);
|
||||||
errorLabel.setText(NbBundle.getMessage(this.getClass(), "DataSourceOnCDriveError.text"));
|
errorLabel.setText(NbBundle.getMessage(this.getClass(), "DataSourceOnCDriveError.text"));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
errorLabel.setVisible(true);
|
||||||
|
errorLabel.setText(Bundle.LocalFilesPanel_pathValidation_error());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ import javax.swing.event.DocumentEvent;
|
|||||||
import javax.swing.event.DocumentListener;
|
import javax.swing.event.DocumentListener;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.PathValidator;
|
import org.sleuthkit.autopsy.coreutils.PathValidator;
|
||||||
@ -178,7 +179,8 @@ final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements Docum
|
|||||||
*/
|
*/
|
||||||
@Messages({
|
@Messages({
|
||||||
"LogicalEvidenceFilePanel.validatePanel.nonL01Error.text=Only files with the .l01 file extension are supported here.",
|
"LogicalEvidenceFilePanel.validatePanel.nonL01Error.text=Only files with the .l01 file extension are supported here.",
|
||||||
"LogicalEvidenceFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive"
|
"LogicalEvidenceFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive",
|
||||||
|
"LogicalEvidenceFilePanel.pathValidation.getOpenCase.Error=Warning: Exception while getting open case."
|
||||||
})
|
})
|
||||||
boolean validatePanel() {
|
boolean validatePanel() {
|
||||||
errorLabel.setVisible(false);
|
errorLabel.setVisible(false);
|
||||||
@ -188,9 +190,15 @@ final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements Docum
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// display warning if there is one (but don't disable "next" button)
|
// display warning if there is one (but don't disable "next" button)
|
||||||
if (!PathValidator.isValid(path, Case.getCurrentCase().getCaseType())) {
|
try {
|
||||||
|
if (!PathValidator.isValid(path, Case.getOpenCase().getCaseType())) {
|
||||||
|
errorLabel.setVisible(true);
|
||||||
|
errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_dataSourceOnCDriveError());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
errorLabel.setVisible(true);
|
errorLabel.setVisible(true);
|
||||||
errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_dataSourceOnCDriveError());
|
errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_getOpenCase_Error());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//check the extension incase the path was manually entered
|
//check the extension incase the path was manually entered
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -62,12 +62,19 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel {
|
|||||||
OptionalCasePropertiesPanel(boolean editCurrentCase) {
|
OptionalCasePropertiesPanel(boolean editCurrentCase) {
|
||||||
initComponents();
|
initComponents();
|
||||||
if (editCurrentCase) {
|
if (editCurrentCase) {
|
||||||
caseDisplayNameTextField.setText(Case.getCurrentCase().getDisplayName());
|
Case openCase;
|
||||||
caseNumberTextField.setText(Case.getCurrentCase().getNumber());
|
try {
|
||||||
examinerTextField.setText(Case.getCurrentCase().getExaminer());
|
openCase = Case.getOpenCase();
|
||||||
tfExaminerEmailText.setText(Case.getCurrentCase().getExaminerEmail());
|
} catch (NoCurrentCaseException ex) {
|
||||||
tfExaminerPhoneText.setText(Case.getCurrentCase().getExaminerPhone());
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
taNotesText.setText(Case.getCurrentCase().getCaseNotes());
|
return;
|
||||||
|
}
|
||||||
|
caseDisplayNameTextField.setText(openCase.getDisplayName());
|
||||||
|
caseNumberTextField.setText(openCase.getNumber());
|
||||||
|
examinerTextField.setText(openCase.getExaminer());
|
||||||
|
tfExaminerEmailText.setText(openCase.getExaminerEmail());
|
||||||
|
tfExaminerPhoneText.setText(openCase.getExaminerPhone());
|
||||||
|
taNotesText.setText(openCase.getCaseNotes());
|
||||||
setUpCaseDetailsFields();
|
setUpCaseDetailsFields();
|
||||||
setUpOrganizationData();
|
setUpOrganizationData();
|
||||||
} else {
|
} else {
|
||||||
@ -86,15 +93,18 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private void setUpOrganizationData() {
|
private void setUpOrganizationData() {
|
||||||
if (EamDb.isEnabled()) {
|
if (EamDb.isEnabled()) {
|
||||||
Case currentCase = Case.getCurrentCase();
|
try {
|
||||||
if (currentCase != null) {
|
Case currentCase = Case.getOpenCase();
|
||||||
try {
|
if (currentCase != null) {
|
||||||
EamDb dbManager = EamDb.getInstance();
|
EamDb dbManager = EamDb.getInstance();
|
||||||
selectedOrg = dbManager.getCase(currentCase).getOrg();
|
selectedOrg = dbManager.getCase(currentCase).getOrg();
|
||||||
} catch (EamDbException ex) {
|
|
||||||
LOGGER.log(Level.SEVERE, "Unable to get Organization associated with the case from Central Repo", ex);
|
|
||||||
}
|
}
|
||||||
|
} catch (EamDbException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Unable to get Organization associated with the case from Central Repo", ex);
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedOrg != null) {
|
if (selectedOrg != null) {
|
||||||
setCurrentlySelectedOrganization(selectedOrg.getName());
|
setCurrentlySelectedOrganization(selectedOrg.getName());
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2015 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.casemodule.events;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.datamodel.ContentTag;
|
import org.sleuthkit.datamodel.ContentTag;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
@ -41,10 +42,10 @@ public class ContentTagAddedEvent extends TagAddedEvent<ContentTag> implements S
|
|||||||
*
|
*
|
||||||
* @return ContentTag that was added
|
* @return ContentTag that was added
|
||||||
*
|
*
|
||||||
* @throws IllegalStateException
|
* @throws NoCurrentCaseException
|
||||||
* @throws TskCoreException
|
* @throws TskCoreException
|
||||||
*/
|
*/
|
||||||
ContentTag getTagByID() throws IllegalStateException, TskCoreException {
|
ContentTag getTagByID() throws NoCurrentCaseException, TskCoreException {
|
||||||
return Case.getCurrentCase().getServices().getTagsManager().getContentTagByTagID(getTagID());
|
return Case.getOpenCase().getServices().getTagsManager().getContentTagByTagID(getTagID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2015 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -22,6 +22,7 @@ import java.io.Serializable;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
@ -78,9 +79,9 @@ public final class DataSourceAddedEvent extends AutopsyEvent implements Serializ
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
long id = (Long) super.getNewValue();
|
long id = (Long) super.getNewValue();
|
||||||
dataSource = Case.getCurrentCase().getSleuthkitCase().getContentById(id);
|
dataSource = Case.getOpenCase().getSleuthkitCase().getContentById(id);
|
||||||
return dataSource;
|
return dataSource;
|
||||||
} catch (IllegalStateException | TskCoreException ex) {
|
} catch (NoCurrentCaseException | TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2015 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.casemodule.events;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.datamodel.Tag;
|
import org.sleuthkit.datamodel.Tag;
|
||||||
@ -84,7 +85,7 @@ abstract class TagAddedEvent<T extends Tag> extends AutopsyEvent implements Seri
|
|||||||
try {
|
try {
|
||||||
tag = getTagByID();
|
tag = getTagByID();
|
||||||
return tag;
|
return tag;
|
||||||
} catch (IllegalStateException | TskCoreException ex) {
|
} catch (NoCurrentCaseException | TskCoreException ex) {
|
||||||
Logger.getLogger(TagAddedEvent.class.getName()).log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
|
Logger.getLogger(TagAddedEvent.class.getName()).log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -98,8 +99,8 @@ abstract class TagAddedEvent<T extends Tag> extends AutopsyEvent implements Seri
|
|||||||
*
|
*
|
||||||
* @return the Tag based on the saved tag id
|
* @return the Tag based on the saved tag id
|
||||||
*
|
*
|
||||||
* @throws IllegalStateException
|
* @throws NoCurrentCaseException
|
||||||
* @throws TskCoreException
|
* @throws TskCoreException
|
||||||
*/
|
*/
|
||||||
abstract T getTagByID() throws IllegalStateException, TskCoreException;
|
abstract T getTagByID() throws NoCurrentCaseException, TskCoreException;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -29,6 +29,7 @@ import java.util.Set;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifactTag;
|
import org.sleuthkit.datamodel.BlackboardArtifactTag;
|
||||||
@ -98,11 +99,11 @@ public class TagsManager implements Closeable {
|
|||||||
tagDisplayNames.add(tagType.getDisplayName());
|
tagDisplayNames.add(tagType.getDisplayName());
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager();
|
||||||
for (TagName tagName : tagsManager.getAllTagNames()) {
|
for (TagName tagName : tagsManager.getAllTagNames()) {
|
||||||
tagDisplayNames.add(tagName.getDisplayName());
|
tagDisplayNames.add(tagName.getDisplayName());
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException ignored) {
|
} catch (NoCurrentCaseException ignored) {
|
||||||
/*
|
/*
|
||||||
* No current case, nothing more to add to the set.
|
* No current case, nothing more to add to the set.
|
||||||
*/
|
*/
|
||||||
@ -339,8 +340,8 @@ public class TagsManager implements Closeable {
|
|||||||
ContentTag tag;
|
ContentTag tag;
|
||||||
tag = caseDb.addContentTag(content, tagName, comment, beginByteOffset, endByteOffset);
|
tag = caseDb.addContentTag(content, tagName, comment, beginByteOffset, endByteOffset);
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase().notifyContentTagAdded(tag);
|
Case.getOpenCase().notifyContentTagAdded(tag);
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
throw new TskCoreException("Added a tag to a closed case", ex);
|
throw new TskCoreException("Added a tag to a closed case", ex);
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
@ -357,8 +358,8 @@ public class TagsManager implements Closeable {
|
|||||||
public void deleteContentTag(ContentTag tag) throws TskCoreException {
|
public void deleteContentTag(ContentTag tag) throws TskCoreException {
|
||||||
caseDb.deleteContentTag(tag);
|
caseDb.deleteContentTag(tag);
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase().notifyContentTagDeleted(tag);
|
Case.getOpenCase().notifyContentTagDeleted(tag);
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
throw new TskCoreException("Deleted a tag from a closed case", ex);
|
throw new TskCoreException("Deleted a tag from a closed case", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -469,8 +470,8 @@ public class TagsManager implements Closeable {
|
|||||||
public BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException {
|
public BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException {
|
||||||
BlackboardArtifactTag tag = caseDb.addBlackboardArtifactTag(artifact, tagName, comment);
|
BlackboardArtifactTag tag = caseDb.addBlackboardArtifactTag(artifact, tagName, comment);
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase().notifyBlackBoardArtifactTagAdded(tag);
|
Case.getOpenCase().notifyBlackBoardArtifactTagAdded(tag);
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
throw new TskCoreException("Added a tag to a closed case", ex);
|
throw new TskCoreException("Added a tag to a closed case", ex);
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
@ -487,8 +488,8 @@ public class TagsManager implements Closeable {
|
|||||||
public void deleteBlackboardArtifactTag(BlackboardArtifactTag tag) throws TskCoreException {
|
public void deleteBlackboardArtifactTag(BlackboardArtifactTag tag) throws TskCoreException {
|
||||||
caseDb.deleteBlackboardArtifactTag(tag);
|
caseDb.deleteBlackboardArtifactTag(tag);
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase().notifyBlackBoardArtifactTagDeleted(tag);
|
Case.getOpenCase().notifyBlackBoardArtifactTagDeleted(tag);
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
throw new TskCoreException("Deleted a tag from a closed case", ex);
|
throw new TskCoreException("Deleted a tag from a closed case", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Central Repository
|
* Central Repository
|
||||||
*
|
*
|
||||||
* Copyright 2015-2017 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.centralrepository.datamodel;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
import org.sleuthkit.datamodel.TskDataException;
|
import org.sleuthkit.datamodel.TskDataException;
|
||||||
@ -73,8 +74,8 @@ public class CorrelationDataSource implements Serializable {
|
|||||||
public static CorrelationDataSource fromTSKDataSource(CorrelationCase correlationCase, Content dataSource) throws EamDbException {
|
public static CorrelationDataSource fromTSKDataSource(CorrelationCase correlationCase, Content dataSource) throws EamDbException {
|
||||||
Case curCase;
|
Case curCase;
|
||||||
try {
|
try {
|
||||||
curCase = Case.getCurrentCase();
|
curCase = Case.getOpenCase();
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
throw new EamDbException("Autopsy case is closed");
|
throw new EamDbException("Autopsy case is closed");
|
||||||
}
|
}
|
||||||
String deviceId;
|
String deviceId;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Central Repository
|
* Central Repository
|
||||||
*
|
*
|
||||||
* Copyright 2015-2017 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -23,6 +23,7 @@ import java.util.List;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
@ -89,7 +90,7 @@ public class EamArtifactUtil {
|
|||||||
// if they asked for it, add the instance details associated with this occurance.
|
// if they asked for it, add the instance details associated with this occurance.
|
||||||
if (!eamArtifacts.isEmpty() && addInstanceDetails) {
|
if (!eamArtifacts.isEmpty() && addInstanceDetails) {
|
||||||
try {
|
try {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getOpenCase();
|
||||||
AbstractFile bbSourceFile = currentCase.getSleuthkitCase().getAbstractFileById(bbArtifact.getObjectID());
|
AbstractFile bbSourceFile = currentCase.getSleuthkitCase().getAbstractFileById(bbArtifact.getObjectID());
|
||||||
if (null == bbSourceFile) {
|
if (null == bbSourceFile) {
|
||||||
//@@@ Log this
|
//@@@ Log this
|
||||||
@ -97,9 +98,9 @@ public class EamArtifactUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make an instance for the BB source file
|
// make an instance for the BB source file
|
||||||
CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentCase());
|
CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getOpenCase());
|
||||||
if (null == correlationCase) {
|
if (null == correlationCase) {
|
||||||
correlationCase = EamDb.getInstance().newCase(Case.getCurrentCase());
|
correlationCase = EamDb.getInstance().newCase(Case.getOpenCase());
|
||||||
}
|
}
|
||||||
CorrelationAttributeInstance eamInstance = new CorrelationAttributeInstance(
|
CorrelationAttributeInstance eamInstance = new CorrelationAttributeInstance(
|
||||||
correlationCase,
|
correlationCase,
|
||||||
@ -116,7 +117,7 @@ public class EamArtifactUtil {
|
|||||||
} catch (TskCoreException | EamDbException ex) {
|
} catch (TskCoreException | EamDbException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error creating artifact instance.", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "Error creating artifact instance.", ex); // NON-NLS
|
||||||
return eamArtifacts;
|
return eamArtifacts;
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Case is closed.", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "Case is closed.", ex); // NON-NLS
|
||||||
return eamArtifacts;
|
return eamArtifacts;
|
||||||
}
|
}
|
||||||
@ -145,7 +146,7 @@ public class EamArtifactUtil {
|
|||||||
// Get the associated artifact
|
// Get the associated artifact
|
||||||
BlackboardAttribute attribute = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
|
BlackboardAttribute attribute = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
|
||||||
if (attribute != null) {
|
if (attribute != null) {
|
||||||
BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
||||||
return EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(correlationType, associatedArtifact);
|
return EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(correlationType, associatedArtifact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,6 +204,9 @@ public class EamArtifactUtil {
|
|||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error getting attribute while getting type from BlackboardArtifact.", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "Error getting attribute while getting type from BlackboardArtifact.", ex); // NON-NLS
|
||||||
return null;
|
return null;
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); // NON-NLS
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null != value) {
|
if (null != value) {
|
||||||
@ -250,9 +254,9 @@ public class EamArtifactUtil {
|
|||||||
try {
|
try {
|
||||||
CorrelationAttribute.Type filesType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID);
|
CorrelationAttribute.Type filesType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID);
|
||||||
eamArtifact = new CorrelationAttribute(filesType, af.getMd5Hash());
|
eamArtifact = new CorrelationAttribute(filesType, af.getMd5Hash());
|
||||||
CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentCase());
|
CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getOpenCase());
|
||||||
if (null == correlationCase) {
|
if (null == correlationCase) {
|
||||||
correlationCase = EamDb.getInstance().newCase(Case.getCurrentCase());
|
correlationCase = EamDb.getInstance().newCase(Case.getOpenCase());
|
||||||
}
|
}
|
||||||
CorrelationAttributeInstance cei = new CorrelationAttributeInstance(
|
CorrelationAttributeInstance cei = new CorrelationAttributeInstance(
|
||||||
correlationCase,
|
correlationCase,
|
||||||
@ -263,7 +267,7 @@ public class EamArtifactUtil {
|
|||||||
);
|
);
|
||||||
eamArtifact.addInstance(cei);
|
eamArtifact.addInstance(cei);
|
||||||
return eamArtifact;
|
return eamArtifact;
|
||||||
} catch (TskCoreException | EamDbException ex) {
|
} catch (TskCoreException | EamDbException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error making correlation attribute.", ex);
|
LOGGER.log(Level.SEVERE, "Error making correlation attribute.", ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Central Repository
|
* Central Repository
|
||||||
*
|
*
|
||||||
* Copyright 2015-2017 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -28,6 +28,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
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.events.BlackBoardArtifactTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||||
@ -162,8 +163,8 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the remaining tags on the content object
|
// Get the remaining tags on the content object
|
||||||
Content content = Case.getCurrentCase().getSleuthkitCase().getContentById(contentID);
|
Content content = Case.getOpenCase().getSleuthkitCase().getContentById(contentID);
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager();
|
||||||
List<ContentTag> tags = tagsManager.getContentTagsByContent(content);
|
List<ContentTag> tags = tagsManager.getContentTagsByContent(content);
|
||||||
|
|
||||||
if (tags.stream()
|
if (tags.stream()
|
||||||
@ -185,7 +186,7 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
// There's still at least one bad tag, so leave the known status as is
|
// There's still at least one bad tag, so leave the known status as is
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Failed to find content", ex);
|
LOGGER.log(Level.SEVERE, "Failed to find content", ex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -241,6 +242,13 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else { //BLACKBOARD_ARTIFACT_TAG_DELETED
|
} else { //BLACKBOARD_ARTIFACT_TAG_DELETED
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// For deleted tags, we want to set the file status to UNKNOWN if:
|
// For deleted tags, we want to set the file status to UNKNOWN if:
|
||||||
// - The tag that was just removed is notable in central repo
|
// - The tag that was just removed is notable in central repo
|
||||||
// - There are no remaining tags that are notable
|
// - There are no remaining tags that are notable
|
||||||
@ -256,9 +264,9 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the remaining tags on the artifact
|
// Get the remaining tags on the artifact
|
||||||
content = Case.getCurrentCase().getSleuthkitCase().getContentById(contentID);
|
content = openCase.getSleuthkitCase().getContentById(contentID);
|
||||||
bbArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(artifactID);
|
bbArtifact = openCase.getSleuthkitCase().getBlackboardArtifact(artifactID);
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tagsManager = openCase.getServices().getTagsManager();
|
||||||
List<BlackboardArtifactTag> tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact);
|
List<BlackboardArtifactTag> tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact);
|
||||||
|
|
||||||
if (tags.stream()
|
if (tags.stream()
|
||||||
@ -319,10 +327,10 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
* that are tagged with the given tag name.
|
* that are tagged with the given tag name.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
TagName tagName = Case.getCurrentCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(modifiedTagName);
|
TagName tagName = Case.getOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(modifiedTagName);
|
||||||
//First update the artifacts
|
//First update the artifacts
|
||||||
//Get all BlackboardArtifactTags with this tag name
|
//Get all BlackboardArtifactTags with this tag name
|
||||||
List<BlackboardArtifactTag> artifactTags = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifactTagsByTagName(tagName);
|
List<BlackboardArtifactTag> artifactTags = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifactTagsByTagName(tagName);
|
||||||
for (BlackboardArtifactTag bbTag : artifactTags) {
|
for (BlackboardArtifactTag bbTag : artifactTags) {
|
||||||
//start with assumption that none of the other tags applied to this Correlation Attribute will prevent it's status from being changed
|
//start with assumption that none of the other tags applied to this Correlation Attribute will prevent it's status from being changed
|
||||||
boolean hasTagWithConflictingKnownStatus = false;
|
boolean hasTagWithConflictingKnownStatus = false;
|
||||||
@ -338,7 +346,7 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
}
|
}
|
||||||
//Get the BlackboardArtifact which this BlackboardArtifactTag has been applied to.
|
//Get the BlackboardArtifact which this BlackboardArtifactTag has been applied to.
|
||||||
BlackboardArtifact bbArtifact = bbTag.getArtifact();
|
BlackboardArtifact bbArtifact = bbTag.getArtifact();
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager();
|
||||||
List<BlackboardArtifactTag> tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact);
|
List<BlackboardArtifactTag> tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact);
|
||||||
//get all tags which are on this blackboard artifact
|
//get all tags which are on this blackboard artifact
|
||||||
for (BlackboardArtifactTag t : tags) {
|
for (BlackboardArtifactTag t : tags) {
|
||||||
@ -366,7 +374,7 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
}
|
}
|
||||||
// Next update the files
|
// Next update the files
|
||||||
|
|
||||||
List<ContentTag> fileTags = Case.getCurrentCase().getSleuthkitCase().getContentTagsByTagName(tagName);
|
List<ContentTag> fileTags = Case.getOpenCase().getSleuthkitCase().getContentTagsByTagName(tagName);
|
||||||
//Get all ContentTags with this tag name
|
//Get all ContentTags with this tag name
|
||||||
for (ContentTag contentTag : fileTags) {
|
for (ContentTag contentTag : fileTags) {
|
||||||
//start with assumption that none of the other tags applied to this ContentTag will prevent it's status from being changed
|
//start with assumption that none of the other tags applied to this ContentTag will prevent it's status from being changed
|
||||||
@ -376,7 +384,7 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
// the status of the file in the central repository
|
// the status of the file in the central repository
|
||||||
if (tagName.getKnownStatus() == TskData.FileKnown.UNKNOWN) {
|
if (tagName.getKnownStatus() == TskData.FileKnown.UNKNOWN) {
|
||||||
Content content = contentTag.getContent();
|
Content content = contentTag.getContent();
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager();
|
||||||
List<ContentTag> tags = tagsManager.getContentTagsByContent(content);
|
List<ContentTag> tags = tagsManager.getContentTagsByContent(content);
|
||||||
//get all tags which are on this file
|
//get all tags which are on this file
|
||||||
for (ContentTag t : tags) {
|
for (ContentTag t : tags) {
|
||||||
@ -405,6 +413,8 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
LOGGER.log(Level.SEVERE, "Cannot update known status in central repository for tag: " + modifiedTagName, ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Cannot update known status in central repository for tag: " + modifiedTagName, ex); //NON-NLS
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Cannot get central repository for tag: " + modifiedTagName, ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Cannot get central repository for tag: " + modifiedTagName, ex); //NON-NLS
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
} //TAG_STATUS_CHANGED
|
} //TAG_STATUS_CHANGED
|
||||||
}
|
}
|
||||||
@ -424,15 +434,22 @@ final class CaseEventListener implements PropertyChangeListener {
|
|||||||
if (!EamDb.isEnabled()) {
|
if (!EamDb.isEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final DataSourceAddedEvent dataSourceAddedEvent = (DataSourceAddedEvent) event;
|
final DataSourceAddedEvent dataSourceAddedEvent = (DataSourceAddedEvent) event;
|
||||||
Content newDataSource = dataSourceAddedEvent.getDataSource();
|
Content newDataSource = dataSourceAddedEvent.getDataSource();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String deviceId = Case.getCurrentCase().getSleuthkitCase().getDataSource(newDataSource.getId()).getDeviceId();
|
String deviceId = openCase.getSleuthkitCase().getDataSource(newDataSource.getId()).getDeviceId();
|
||||||
CorrelationCase correlationCase = dbManager.getCase(Case.getCurrentCase());
|
CorrelationCase correlationCase = dbManager.getCase(openCase);
|
||||||
if (null == correlationCase) {
|
if (null == correlationCase) {
|
||||||
correlationCase = dbManager.newCase(Case.getCurrentCase());
|
correlationCase = dbManager.newCase(openCase);
|
||||||
}
|
}
|
||||||
if (null == dbManager.getDataSource(correlationCase, deviceId)) {
|
if (null == dbManager.getDataSource(correlationCase, deviceId)) {
|
||||||
dbManager.newDataSource(CorrelationDataSource.fromTSKDataSource(correlationCase, newDataSource));
|
dbManager.newDataSource(CorrelationDataSource.fromTSKDataSource(correlationCase, newDataSource));
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Central Repository
|
* Central Repository
|
||||||
*
|
*
|
||||||
* Copyright 2015-2017 Basis Technology Corp.
|
* Copyright 2015-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -32,6 +32,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
@ -144,9 +145,9 @@ public class IngestEventsListener {
|
|||||||
tifArtifact.addAttributes(attributes);
|
tifArtifact.addAttributes(attributes);
|
||||||
try {
|
try {
|
||||||
// index the artifact for keyword search
|
// index the artifact for keyword search
|
||||||
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard();
|
||||||
blackboard.indexArtifact(tifArtifact);
|
blackboard.indexArtifact(tifArtifact);
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Central Repository
|
* Central Repository
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -26,6 +26,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
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.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -79,7 +80,12 @@ class IngestModule implements FileIngestModule {
|
|||||||
return ProcessResult.OK;
|
return ProcessResult.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (!EamArtifactUtil.isValidCentralRepoFile(af)) {
|
if (!EamArtifactUtil.isValidCentralRepoFile(af)) {
|
||||||
return ProcessResult.OK;
|
return ProcessResult.OK;
|
||||||
@ -190,8 +196,16 @@ class IngestModule implements FileIngestModule {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Case autopsyCase;
|
||||||
|
try {
|
||||||
|
autopsyCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
throw new IngestModuleException("Exception while getting open case.", ex);
|
||||||
|
}
|
||||||
|
|
||||||
// Don't allow sqlite central repo databases to be used for multi user cases
|
// Don't allow sqlite central repo databases to be used for multi user cases
|
||||||
if ((Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE)
|
if ((autopsyCase.getCaseType() == Case.CaseType.MULTI_USER_CASE)
|
||||||
&& (EamDbPlatformEnum.getSelectedPlatform() == EamDbPlatformEnum.SQLITE)) {
|
&& (EamDbPlatformEnum.getSelectedPlatform() == EamDbPlatformEnum.SQLITE)) {
|
||||||
LOGGER.log(Level.SEVERE, "Cannot run correlation engine on a multi-user case with a SQLite central repository.");
|
LOGGER.log(Level.SEVERE, "Cannot run correlation engine on a multi-user case with a SQLite central repository.");
|
||||||
throw new IngestModuleException("Cannot run on a multi-user case with a SQLite central repository."); // NON-NLS
|
throw new IngestModuleException("Cannot run on a multi-user case with a SQLite central repository."); // NON-NLS
|
||||||
@ -212,7 +226,7 @@ class IngestModule implements FileIngestModule {
|
|||||||
LOGGER.log(Level.SEVERE, "Error getting correlation type FILES in ingest module start up.", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "Error getting correlation type FILES in ingest module start up.", ex); // NON-NLS
|
||||||
throw new IngestModuleException("Error getting correlation type FILES in ingest module start up.", ex); // NON-NLS
|
throw new IngestModuleException("Error getting correlation type FILES in ingest module start up.", ex); // NON-NLS
|
||||||
}
|
}
|
||||||
Case autopsyCase = Case.getCurrentCase();
|
|
||||||
try {
|
try {
|
||||||
eamCase = centralRepoDb.getCase(autopsyCase);
|
eamCase = centralRepoDb.getCase(autopsyCase);
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException ex) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2017 Basis Technology Corp.
|
* Copyright 2017-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -30,6 +30,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.datamodel.NodeProperty;
|
import org.sleuthkit.autopsy.datamodel.NodeProperty;
|
||||||
import org.sleuthkit.datamodel.Account;
|
import org.sleuthkit.datamodel.Account;
|
||||||
import org.sleuthkit.datamodel.AccountDeviceInstance;
|
import org.sleuthkit.datamodel.AccountDeviceInstance;
|
||||||
@ -76,13 +77,13 @@ class AccountsRootChildren extends ChildFactory<AccountDeviceInstanceKey> {
|
|||||||
|
|
||||||
private String getDataSourceName(AccountDeviceInstance accountDeviceInstance) {
|
private String getDataSourceName(AccountDeviceInstance accountDeviceInstance) {
|
||||||
try {
|
try {
|
||||||
final SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
|
final SleuthkitCase sleuthkitCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
|
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
|
||||||
if (dataSource.getDeviceId().equals(accountDeviceInstance.getDeviceId())) {
|
if (dataSource.getDeviceId().equals(accountDeviceInstance.getDeviceId())) {
|
||||||
return sleuthkitCase.getContentById(dataSource.getId()).getName();
|
return sleuthkitCase.getContentById(dataSource.getId()).getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting datasource name, falling back on device ID.", ex);
|
logger.log(Level.SEVERE, "Error getting datasource name, falling back on device ID.", ex);
|
||||||
}
|
}
|
||||||
return accountDeviceInstance.getDeviceId();
|
return accountDeviceInstance.getDeviceId();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2017 Basis Technology Corp.
|
* Copyright 2017-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -36,6 +36,7 @@ import org.openide.nodes.Children;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import static org.sleuthkit.autopsy.casemodule.Case.Events.CURRENT_CASE;
|
import static org.sleuthkit.autopsy.casemodule.Case.Events.CURRENT_CASE;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||||
@ -198,7 +199,7 @@ final public class FiltersPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
//TODO: something like this commented code could be used to show only
|
//TODO: something like this commented code could be used to show only
|
||||||
//the account types that are found:
|
//the account types that are found:
|
||||||
//final CommunicationsManager communicationsManager = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager();
|
//final CommunicationsManager communicationsManager = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager();
|
||||||
//List<Account.Type> accountTypesInUse = communicationsManager.getAccountTypesInUse();
|
//List<Account.Type> accountTypesInUse = communicationsManager.getAccountTypesInUse();
|
||||||
//accountTypesInUSe.forEach(...)
|
//accountTypesInUSe.forEach(...)
|
||||||
Account.Type.PREDEFINED_ACCOUNT_TYPES.forEach(type -> {
|
Account.Type.PREDEFINED_ACCOUNT_TYPES.forEach(type -> {
|
||||||
@ -229,7 +230,7 @@ final public class FiltersPanel extends javax.swing.JPanel {
|
|||||||
*/
|
*/
|
||||||
private void updateDeviceFilter() {
|
private void updateDeviceFilter() {
|
||||||
try {
|
try {
|
||||||
final SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
|
final SleuthkitCase sleuthkitCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
|
|
||||||
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
|
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
|
||||||
String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName();
|
String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName();
|
||||||
@ -242,7 +243,7 @@ final public class FiltersPanel extends javax.swing.JPanel {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.WARNING, "Communications Visualization Tool opened with no open case.", ex);
|
logger.log(Level.WARNING, "Communications Visualization Tool opened with no open case.", ex);
|
||||||
} catch (TskCoreException tskCoreException) {
|
} catch (TskCoreException tskCoreException) {
|
||||||
logger.log(Level.SEVERE, "There was a error loading the datasources for the case.", tskCoreException);
|
logger.log(Level.SEVERE, "There was a error loading the datasources for the case.", tskCoreException);
|
||||||
@ -500,10 +501,12 @@ final public class FiltersPanel extends javax.swing.JPanel {
|
|||||||
ImmutableSet.of(CALL_LOG, MESSAGE)));
|
ImmutableSet.of(CALL_LOG, MESSAGE)));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final CommunicationsManager commsManager = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager();
|
final CommunicationsManager commsManager = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager();
|
||||||
em.setRootContext(new AbstractNode(Children.create(new AccountsRootChildren(commsManager, commsFilter), true)));
|
em.setRootContext(new AbstractNode(Children.create(new AccountsRootChildren(commsManager, commsFilter), true)));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "There was an error getting the CommunicationsManager for the current case.", ex);
|
logger.log(Level.SEVERE, "There was an error getting the CommunicationsManager for the current case.", ex);
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
needsRefresh = false;
|
needsRefresh = false;
|
||||||
|
@ -51,6 +51,7 @@ import org.openide.nodes.AbstractNode;
|
|||||||
import org.openide.nodes.Children;
|
import org.openide.nodes.Children;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
@ -186,8 +187,21 @@ public class PListViewer extends javax.swing.JPanel implements FileTypeViewer, E
|
|||||||
*/
|
*/
|
||||||
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed
|
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed
|
||||||
|
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
JOptionPane.showMessageDialog(this,
|
||||||
|
"Failed to export plist file.",
|
||||||
|
Bundle.PListViewer_ExportFailed_message(),
|
||||||
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final JFileChooser fileChooser = new JFileChooser();
|
final JFileChooser fileChooser = new JFileChooser();
|
||||||
fileChooser.setCurrentDirectory(new File(Case.getCurrentCase().getExportDirectory()));
|
fileChooser.setCurrentDirectory(new File(openCase.getExportDirectory()));
|
||||||
fileChooser.setFileFilter(new FileNameExtensionFilter("XML file", "xml"));
|
fileChooser.setFileFilter(new FileNameExtensionFilter("XML file", "xml"));
|
||||||
|
|
||||||
final int returnVal = fileChooser.showSaveDialog(this);
|
final int returnVal = fileChooser.showSaveDialog(this);
|
||||||
|
@ -42,6 +42,7 @@ import javax.swing.JComboBox;
|
|||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.FileManager;
|
import org.sleuthkit.autopsy.casemodule.services.FileManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.Services;
|
import org.sleuthkit.autopsy.casemodule.services.Services;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -324,7 +325,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Copy the file to temp folder
|
// Copy the file to temp folder
|
||||||
tmpDBPathName = Case.getCurrentCase().getTempDirectory() + File.separator + sqliteFile.getName();
|
tmpDBPathName = Case.getOpenCase().getTempDirectory() + File.separator + sqliteFile.getName();
|
||||||
tmpDBFile = new File(tmpDBPathName);
|
tmpDBFile = new File(tmpDBPathName);
|
||||||
ContentUtils.writeToFile(sqliteFile, tmpDBFile);
|
ContentUtils.writeToFile(sqliteFile, tmpDBFile);
|
||||||
|
|
||||||
@ -338,6 +339,8 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer {
|
|||||||
|
|
||||||
// Read all table names and schema
|
// Read all table names and schema
|
||||||
return getTables();
|
return getTables();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Failed to copy DB file.", ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Failed to copy DB file.", ex); //NON-NLS
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
@ -380,8 +383,14 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer {
|
|||||||
* @return true if the meta file is found and copied successfully, false otherwise
|
* @return true if the meta file is found and copied successfully, false otherwise
|
||||||
*/
|
*/
|
||||||
private boolean findAndCopySQLiteMetaFile(AbstractFile sqliteFile, String metaFileName ) {
|
private boolean findAndCopySQLiteMetaFile(AbstractFile sqliteFile, String metaFileName ) {
|
||||||
|
Case openCase;
|
||||||
SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SleuthkitCase sleuthkitCase = openCase.getSleuthkitCase();
|
||||||
Services services = new Services(sleuthkitCase);
|
Services services = new Services(sleuthkitCase);
|
||||||
FileManager fileManager = services.getFileManager();
|
FileManager fileManager = services.getFileManager();
|
||||||
|
|
||||||
@ -395,7 +404,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer {
|
|||||||
|
|
||||||
if (metaFiles != null) {
|
if (metaFiles != null) {
|
||||||
for (AbstractFile metaFile: metaFiles) {
|
for (AbstractFile metaFile: metaFiles) {
|
||||||
String tmpMetafilePathName = Case.getCurrentCase().getTempDirectory() + File.separator + metaFile.getName();
|
String tmpMetafilePathName = openCase.getTempDirectory() + File.separator + metaFile.getName();
|
||||||
|
|
||||||
File tmpMetafile = new File(tmpMetafilePathName);
|
File tmpMetafile = new File(tmpMetafilePathName);
|
||||||
try {
|
try {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -33,6 +33,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.WeakListeners;
|
import org.openide.util.WeakListeners;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -263,8 +264,8 @@ public abstract class AbstractAbstractFileNode<T extends AbstractFile> extends A
|
|||||||
protected void addTagProperty(Sheet.Set ss) {
|
protected void addTagProperty(Sheet.Set ss) {
|
||||||
List<ContentTag> tags = new ArrayList<>();
|
List<ContentTag> tags = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
tags.addAll(Case.getCurrentCase().getServices().getTagsManager().getContentTagsByContent(content));
|
tags.addAll(Case.getOpenCase().getServices().getTagsManager().getContentTagsByContent(content));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to get tags for content " + content.getName(), ex);
|
logger.log(Level.SEVERE, "Failed to get tags for content " + content.getName(), ex);
|
||||||
}
|
}
|
||||||
ss.put(new NodeProperty<>("Tags", AbstractAbstractFileNode_tagsProperty_displayName(),
|
ss.put(new NodeProperty<>("Tags", AbstractAbstractFileNode_tagsProperty_displayName(),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -26,6 +26,7 @@ import java.util.logging.Level;
|
|||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.openide.util.Lookup;
|
import org.openide.util.Lookup;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
@ -119,12 +120,12 @@ public abstract class AbstractContentNode<T extends Content> extends ContentNode
|
|||||||
+ " AND type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + ") AS OBJECT_IDS"; //NON-NLS;
|
+ " AND type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + ") AS OBJECT_IDS"; //NON-NLS;
|
||||||
|
|
||||||
|
|
||||||
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCase().getSleuthkitCase().executeQuery(query)) {
|
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getOpenCase().getSleuthkitCase().executeQuery(query)) {
|
||||||
ResultSet resultSet = dbQuery.getResultSet();
|
ResultSet resultSet = dbQuery.getResultSet();
|
||||||
if(resultSet.next()){
|
if(resultSet.next()){
|
||||||
return (0 < resultSet.getInt("count"));
|
return (0 < resultSet.getInt("count"));
|
||||||
}
|
}
|
||||||
} catch (TskCoreException | SQLException ex) {
|
} catch (TskCoreException | SQLException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Error checking if the node has children, for content: " + c, ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error checking if the node has children, for content: " + c, ex); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -42,6 +42,7 @@ import org.openide.util.NbBundle;
|
|||||||
import org.openide.util.WeakListeners;
|
import org.openide.util.WeakListeners;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||||
@ -260,7 +261,7 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
try {
|
try {
|
||||||
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
||||||
if (attribute.getAttributeType().getTypeID() == ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
|
if (attribute.getAttributeType().getTypeID() == ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
|
||||||
BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
||||||
if (associatedArtifact != null) {
|
if (associatedArtifact != null) {
|
||||||
if (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) {
|
if (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) {
|
||||||
artifact.getDisplayName();
|
artifact.getDisplayName();
|
||||||
@ -270,7 +271,7 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
// Do nothing since the display name will be set to the file name.
|
// Do nothing since the display name will be set to the file name.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -327,7 +328,7 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
try {
|
try {
|
||||||
BlackboardAttribute attribute = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
|
BlackboardAttribute attribute = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
|
||||||
if (attribute != null) {
|
if (attribute != null) {
|
||||||
BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
||||||
ss.put(new NodeProperty<>(NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.name"),
|
ss.put(new NodeProperty<>(NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.name"),
|
||||||
NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.displayName"),
|
NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.displayName"),
|
||||||
NO_DESCR,
|
NO_DESCR,
|
||||||
@ -337,7 +338,7 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
NO_DESCR,
|
NO_DESCR,
|
||||||
associatedArtifact.getShortDescription()));
|
associatedArtifact.getShortDescription()));
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
// Do nothing since the display name will be set to the file name.
|
// Do nothing since the display name will be set to the file name.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -449,9 +450,9 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
// add properties for tags
|
// add properties for tags
|
||||||
List<Tag> tags = new ArrayList<>();
|
List<Tag> tags = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
tags.addAll(Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact));
|
tags.addAll(Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact));
|
||||||
tags.addAll(Case.getCurrentCase().getServices().getTagsManager().getContentTagsByContent(associated));
|
tags.addAll(Case.getOpenCase().getServices().getTagsManager().getContentTagsByContent(associated));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Failed to get tags for artifact " + artifact.getDisplayName(), ex);
|
LOGGER.log(Level.SEVERE, "Failed to get tags for artifact " + artifact.getDisplayName(), ex);
|
||||||
}
|
}
|
||||||
ss.put(new NodeProperty<>("Tags", NbBundle.getMessage(AbstractAbstractFileNode.class, "BlackboardArtifactNode.createSheet.tags.displayName"),
|
ss.put(new NodeProperty<>("Tags", NbBundle.getMessage(AbstractAbstractFileNode.class, "BlackboardArtifactNode.createSheet.tags.displayName"),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -39,6 +39,7 @@ import org.openide.util.NbBundle;
|
|||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import static org.sleuthkit.autopsy.datamodel.Bundle.*;
|
import static org.sleuthkit.autopsy.datamodel.Bundle.*;
|
||||||
@ -206,11 +207,11 @@ public class DeletedContent implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
// new file was added
|
// new file was added
|
||||||
// @@@ COULD CHECK If the new file is deleted before notifying...
|
// @@@ COULD CHECK If the new file is deleted before notifying...
|
||||||
update();
|
update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -225,9 +226,9 @@ public class DeletedContent implements AutopsyVisitableItem {
|
|||||||
* received for a case that is already closed.
|
* received for a case that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
update();
|
update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2012-2017 Basis Technology Corp.
|
* Copyright 2012-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -39,6 +39,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
@ -240,7 +241,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -251,7 +252,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
|
|||||||
if (null != eventData && eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
|
if (null != eventData && eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
|
||||||
emailResults.update();
|
emailResults.update();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -265,9 +266,9 @@ public class EmailExtracted implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
emailResults.update();
|
emailResults.update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -34,6 +34,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
@ -210,7 +211,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
* may be received for a case that is already closed.
|
* may be received for a case that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Due to some unresolved issues with how cases are closed,
|
* Due to some unresolved issues with how cases are closed,
|
||||||
* it is possible for the event to have a null oldValue if
|
* it is possible for the event to have a null oldValue if
|
||||||
@ -220,7 +221,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
if (null != event && !(this.doNotShow.contains(event.getBlackboardArtifactType()))) {
|
if (null != event && !(this.doNotShow.contains(event.getBlackboardArtifactType()))) {
|
||||||
refresh(true);
|
refresh(true);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -233,9 +234,9 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
* may be received for a case that is already closed.
|
* may be received for a case that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -401,7 +402,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -412,7 +413,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
if (null != event && event.getBlackboardArtifactType().equals(type)) {
|
if (null != event && event.getBlackboardArtifactType().equals(type)) {
|
||||||
refresh(true);
|
refresh(true);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -426,9 +427,9 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2013-2017 Basis Technology Corp.
|
* Copyright 2013-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -36,6 +36,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
@ -201,9 +202,9 @@ public class FileSize implements AutopsyVisitableItem {
|
|||||||
try {
|
try {
|
||||||
// new file was added
|
// new file was added
|
||||||
// @@@ could check the size here and only fire off updates if we know the file meets the min size criteria
|
// @@@ could check the size here and only fire off updates if we know the file meets the min size criteria
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
update();
|
update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -218,9 +219,9 @@ public class FileSize implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
update();
|
update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -37,6 +37,7 @@ import org.openide.util.NbBundle;
|
|||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.datamodel.FileTypes.FileTypesKey;
|
import org.sleuthkit.autopsy.datamodel.FileTypes.FileTypesKey;
|
||||||
@ -93,10 +94,10 @@ public final class FileTypesByExtension implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
typesRoot.updateShowCounts();
|
typesRoot.updateShowCounts();
|
||||||
update();
|
update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -41,6 +41,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import static org.sleuthkit.autopsy.core.UserPreferences.hideKnownFilesInViewsTree;
|
import static org.sleuthkit.autopsy.core.UserPreferences.hideKnownFilesInViewsTree;
|
||||||
import static org.sleuthkit.autopsy.core.UserPreferences.hideSlackFilesInViewsTree;
|
import static org.sleuthkit.autopsy.core.UserPreferences.hideSlackFilesInViewsTree;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -163,10 +164,10 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi
|
|||||||
* already closed.
|
* already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
typesRoot.updateShowCounts();
|
typesRoot.updateShowCounts();
|
||||||
populateHashMap();
|
populateHashMap();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -33,6 +33,7 @@ import org.openide.nodes.Sheet;
|
|||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.directorytree.ExplorerNodeActionVisitor;
|
import org.sleuthkit.autopsy.directorytree.ExplorerNodeActionVisitor;
|
||||||
import org.sleuthkit.autopsy.directorytree.FileSearchAction;
|
import org.sleuthkit.autopsy.directorytree.FileSearchAction;
|
||||||
@ -170,7 +171,7 @@ public class ImageNode extends AbstractContentNode<Image> {
|
|||||||
Bundle.ImageNode_createSheet_timezone_desc(),
|
Bundle.ImageNode_createSheet_timezone_desc(),
|
||||||
this.content.getTimeZone()));
|
this.content.getTimeZone()));
|
||||||
|
|
||||||
try (CaseDbQuery query = Case.getCurrentCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) {
|
try (CaseDbQuery query = Case.getOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) {
|
||||||
ResultSet deviceIdSet = query.getResultSet();
|
ResultSet deviceIdSet = query.getResultSet();
|
||||||
if (deviceIdSet.next()) {
|
if (deviceIdSet.next()) {
|
||||||
ss.put(new NodeProperty<>(Bundle.ImageNode_createSheet_deviceId_name(),
|
ss.put(new NodeProperty<>(Bundle.ImageNode_createSheet_deviceId_name(),
|
||||||
@ -178,7 +179,7 @@ public class ImageNode extends AbstractContentNode<Image> {
|
|||||||
Bundle.ImageNode_createSheet_deviceId_desc(),
|
Bundle.ImageNode_createSheet_deviceId_desc(),
|
||||||
deviceIdSet.getString("device_id")));
|
deviceIdSet.getString("device_id")));
|
||||||
}
|
}
|
||||||
} catch (SQLException | TskCoreException ex) {
|
} catch (SQLException | TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to get device id for the following image: " + this.content.getId(), ex);
|
logger.log(Level.SEVERE, "Failed to get device id for the following image: " + this.content.getId(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -43,6 +43,7 @@ import org.openide.util.Lookup;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import static org.sleuthkit.autopsy.datamodel.Bundle.*;
|
import static org.sleuthkit.autopsy.datamodel.Bundle.*;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
@ -411,7 +412,7 @@ public class KeywordHits implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -422,7 +423,7 @@ public class KeywordHits implements AutopsyVisitableItem {
|
|||||||
if (null != eventData && eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
|
if (null != eventData && eventData.getBlackboardArtifactType().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
|
||||||
keywordResults.update();
|
keywordResults.update();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
||||||
@ -434,9 +435,9 @@ public class KeywordHits implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
keywordResults.update();
|
keywordResults.update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())
|
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())
|
||||||
|
@ -40,6 +40,7 @@ import org.openide.util.NbBundle;
|
|||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
||||||
@ -114,9 +115,9 @@ public final class Reports implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
ReportNodeFactory.this.refresh(true);
|
ReportNodeFactory.this.refresh(true);
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -128,8 +129,8 @@ public final class Reports implements AutopsyVisitableItem {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean createKeys(List<Report> keys) {
|
protected boolean createKeys(List<Report> keys) {
|
||||||
try {
|
try {
|
||||||
keys.addAll(Case.getCurrentCase().getAllReports());
|
keys.addAll(Case.getOpenCase().getAllReports());
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(Reports.ReportNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get reports", ex); //NON-NLS
|
Logger.getLogger(Reports.ReportNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get reports", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -265,8 +266,8 @@ public final class Reports implements AutopsyVisitableItem {
|
|||||||
NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.title"),
|
NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.title"),
|
||||||
JOptionPane.YES_NO_OPTION)) {
|
JOptionPane.YES_NO_OPTION)) {
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase().deleteReports(selectedReportsCollection);
|
Case.getOpenCase().deleteReports(selectedReportsCollection);
|
||||||
} catch (TskCoreException | IllegalStateException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(DeleteReportAction.class.getName()).log(Level.SEVERE, "Error deleting reports", ex); // NON-NLS
|
Logger.getLogger(DeleteReportAction.class.getName()).log(Level.SEVERE, "Error deleting reports", ex); // NON-NLS
|
||||||
MessageNotifyUtil.Message.error(Bundle.DeleteReportAction_showConfirmDialog_errorMsg());
|
MessageNotifyUtil.Message.error(Bundle.DeleteReportAction_showConfirmDialog_errorMsg());
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -34,6 +34,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
@ -141,10 +142,10 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
tagResults.update();
|
tagResults.update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -158,10 +159,10 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
tagResults.update();
|
tagResults.update();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
/**
|
/**
|
||||||
* Case is closed, do nothing.
|
* Case is closed, do nothing.
|
||||||
*/
|
*/
|
||||||
@ -195,10 +196,10 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean createKeys(List<TagName> keys) {
|
protected boolean createKeys(List<TagName> keys) {
|
||||||
try {
|
try {
|
||||||
List<TagName> tagNamesInUse = Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse();
|
List<TagName> tagNamesInUse = Case.getOpenCase().getServices().getTagsManager().getTagNamesInUse();
|
||||||
Collections.sort(tagNamesInUse);
|
Collections.sort(tagNamesInUse);
|
||||||
keys.addAll(tagNamesInUse);
|
keys.addAll(tagNamesInUse);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(TagNameNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
Logger.getLogger(TagNameNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -242,10 +243,10 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
private void updateDisplayName() {
|
private void updateDisplayName() {
|
||||||
long tagsCount = 0;
|
long tagsCount = 0;
|
||||||
try {
|
try {
|
||||||
TagsManager tm = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tm = Case.getOpenCase().getServices().getTagsManager();
|
||||||
tagsCount = tm.getContentTagsCountByTagName(tagName);
|
tagsCount = tm.getContentTagsCountByTagName(tagName);
|
||||||
tagsCount += tm.getBlackboardArtifactTagsCountByTagName(tagName);
|
tagsCount += tm.getBlackboardArtifactTagsCountByTagName(tagName);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(TagNameNode.class.getName()).log(Level.SEVERE, "Failed to get tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS
|
Logger.getLogger(TagNameNode.class.getName()).log(Level.SEVERE, "Failed to get tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
setDisplayName(tagName.getDisplayName() + " \u200E(\u200E" + tagsCount + ")\u200E");
|
setDisplayName(tagName.getDisplayName() + " \u200E(\u200E" + tagsCount + ")\u200E");
|
||||||
@ -347,8 +348,8 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
private void updateDisplayName() {
|
private void updateDisplayName() {
|
||||||
long tagsCount = 0;
|
long tagsCount = 0;
|
||||||
try {
|
try {
|
||||||
tagsCount = Case.getCurrentCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName);
|
tagsCount = Case.getOpenCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(ContentTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get content tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS
|
Logger.getLogger(ContentTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get content tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
super.setDisplayName(CONTENT_DISPLAY_NAME + " (" + tagsCount + ")");
|
super.setDisplayName(CONTENT_DISPLAY_NAME + " (" + tagsCount + ")");
|
||||||
@ -402,8 +403,8 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
protected boolean createKeys(List<ContentTag> keys) {
|
protected boolean createKeys(List<ContentTag> keys) {
|
||||||
// Use the content tags bearing the specified tag name as the keys.
|
// Use the content tags bearing the specified tag name as the keys.
|
||||||
try {
|
try {
|
||||||
keys.addAll(Case.getCurrentCase().getServices().getTagsManager().getContentTagsByTagName(tagName));
|
keys.addAll(Case.getOpenCase().getServices().getTagsManager().getContentTagsByTagName(tagName));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(ContentTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
Logger.getLogger(ContentTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -446,8 +447,8 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
private void updateDisplayName() {
|
private void updateDisplayName() {
|
||||||
long tagsCount = 0;
|
long tagsCount = 0;
|
||||||
try {
|
try {
|
||||||
tagsCount = Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName);
|
tagsCount = Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(BlackboardArtifactTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get blackboard artifact tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS
|
Logger.getLogger(BlackboardArtifactTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get blackboard artifact tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
super.setDisplayName(ARTIFACT_DISPLAY_NAME + " (" + tagsCount + ")");
|
super.setDisplayName(ARTIFACT_DISPLAY_NAME + " (" + tagsCount + ")");
|
||||||
@ -501,8 +502,8 @@ public class Tags implements AutopsyVisitableItem {
|
|||||||
protected boolean createKeys(List<BlackboardArtifactTag> keys) {
|
protected boolean createKeys(List<BlackboardArtifactTag> keys) {
|
||||||
try {
|
try {
|
||||||
// Use the blackboard artifact tags bearing the specified tag name as the keys.
|
// Use the blackboard artifact tags bearing the specified tag name as the keys.
|
||||||
keys.addAll(Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName));
|
keys.addAll(Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
Logger.getLogger(BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -26,6 +26,7 @@ import java.util.logging.Level;
|
|||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -105,7 +106,7 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode {
|
|||||||
Bundle.VirtualDirectoryNode_createSheet_size_displayName(),
|
Bundle.VirtualDirectoryNode_createSheet_size_displayName(),
|
||||||
Bundle.VirtualDirectoryNode_createSheet_size_desc(),
|
Bundle.VirtualDirectoryNode_createSheet_size_desc(),
|
||||||
this.content.getSize()));
|
this.content.getSize()));
|
||||||
try (SleuthkitCase.CaseDbQuery query = Case.getCurrentCase().getSleuthkitCase().executeQuery("SELECT time_zone FROM data_source_info WHERE obj_id = " + this.content.getId())) {
|
try (SleuthkitCase.CaseDbQuery query = Case.getOpenCase().getSleuthkitCase().executeQuery("SELECT time_zone FROM data_source_info WHERE obj_id = " + this.content.getId())) {
|
||||||
ResultSet timeZoneSet = query.getResultSet();
|
ResultSet timeZoneSet = query.getResultSet();
|
||||||
if (timeZoneSet.next()) {
|
if (timeZoneSet.next()) {
|
||||||
ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_timezone_name(),
|
ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_timezone_name(),
|
||||||
@ -113,10 +114,10 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode {
|
|||||||
Bundle.VirtualDirectoryNode_createSheet_timezone_desc(),
|
Bundle.VirtualDirectoryNode_createSheet_timezone_desc(),
|
||||||
timeZoneSet.getString("time_zone")));
|
timeZoneSet.getString("time_zone")));
|
||||||
}
|
}
|
||||||
} catch (SQLException | TskCoreException ex) {
|
} catch (SQLException | TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to get time zone for the following image: " + this.content.getId(), ex);
|
logger.log(Level.SEVERE, "Failed to get time zone for the following image: " + this.content.getId(), ex);
|
||||||
}
|
}
|
||||||
try (SleuthkitCase.CaseDbQuery query = Case.getCurrentCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) {
|
try (SleuthkitCase.CaseDbQuery query = Case.getOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) {
|
||||||
ResultSet deviceIdSet = query.getResultSet();
|
ResultSet deviceIdSet = query.getResultSet();
|
||||||
if (deviceIdSet.next()) {
|
if (deviceIdSet.next()) {
|
||||||
ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_deviceId_name(),
|
ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_deviceId_name(),
|
||||||
@ -124,7 +125,7 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode {
|
|||||||
Bundle.VirtualDirectoryNode_createSheet_deviceId_desc(),
|
Bundle.VirtualDirectoryNode_createSheet_deviceId_desc(),
|
||||||
deviceIdSet.getString("device_id")));
|
deviceIdSet.getString("device_id")));
|
||||||
}
|
}
|
||||||
} catch (SQLException | TskCoreException ex) {
|
} catch (SQLException | TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to get device id for the following image: " + this.content.getId(), ex);
|
logger.log(Level.SEVERE, "Failed to get device id for the following image: " + this.content.getId(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -59,6 +59,7 @@ import org.openide.util.NbBundle;
|
|||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
|
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
|
||||||
import org.sleuthkit.autopsy.datamodel.AutopsyItemVisitor;
|
import org.sleuthkit.autopsy.datamodel.AutopsyItemVisitor;
|
||||||
import org.sleuthkit.autopsy.datamodel.AutopsyVisitableItem;
|
import org.sleuthkit.autopsy.datamodel.AutopsyVisitableItem;
|
||||||
@ -240,7 +241,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -252,7 +253,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
||||||
reviewStatusBus.post(eventData);
|
reviewStatusBus.post(eventData);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
||||||
@ -264,9 +265,9 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
@ -368,7 +369,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -380,7 +381,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
||||||
reviewStatusBus.post(eventData);
|
reviewStatusBus.post(eventData);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
||||||
@ -392,10 +393,10 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
|
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
@ -517,7 +518,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -529,7 +530,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
||||||
reviewStatusBus.post(eventData);
|
reviewStatusBus.post(eventData);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
||||||
@ -541,10 +542,10 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
|
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
@ -651,7 +652,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -663,7 +664,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
||||||
reviewStatusBus.post(eventData);
|
reviewStatusBus.post(eventData);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
||||||
@ -675,10 +676,10 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
refresh(true);
|
refresh(true);
|
||||||
|
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
@ -862,7 +863,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
/**
|
/**
|
||||||
* Even with the check above, it is still possible that
|
* Even with the check above, it is still possible that
|
||||||
* the case will be closed in a different thread before
|
* the case will be closed in a different thread before
|
||||||
@ -874,7 +875,7 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
&& eventData.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
|
||||||
reviewStatusBus.post(eventData);
|
reviewStatusBus.post(eventData);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|
||||||
@ -886,10 +887,10 @@ final public class Accounts implements AutopsyVisitableItem {
|
|||||||
* that is already closed.
|
* that is already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
|
|
||||||
refresh(true);
|
refresh(true);
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
}
|
}
|
||||||
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
} else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2014 Basis Technology Corp.
|
* Copyright 2014-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -299,7 +299,7 @@ public class PerformancePanel extends javax.swing.JDialog {
|
|||||||
|
|
||||||
Case curCase;
|
Case curCase;
|
||||||
try {
|
try {
|
||||||
curCase = Case.getCurrentCase();
|
curCase = Case.getOpenCase();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
setImgLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text"));
|
setImgLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text"));
|
||||||
setStatusMsg("");
|
setStatusMsg("");
|
||||||
@ -380,7 +380,7 @@ public class PerformancePanel extends javax.swing.JDialog {
|
|||||||
|
|
||||||
Case curCase;
|
Case curCase;
|
||||||
try {
|
try {
|
||||||
curCase = Case.getCurrentCase();
|
curCase = Case.getOpenCase();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
setFileReadLabel(
|
setFileReadLabel(
|
||||||
NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text"));
|
NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text"));
|
||||||
@ -472,7 +472,7 @@ public class PerformancePanel extends javax.swing.JDialog {
|
|||||||
|
|
||||||
Case curCase;
|
Case curCase;
|
||||||
try {
|
try {
|
||||||
curCase = Case.getCurrentCase();
|
curCase = Case.getOpenCase();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
setDbLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text"));
|
setDbLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text"));
|
||||||
return;
|
return;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -23,6 +23,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -48,7 +49,7 @@ class ViewSourceArtifactAction extends AbstractAction {
|
|||||||
try {
|
try {
|
||||||
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
for (BlackboardAttribute attribute : artifact.getAttributes()) {
|
||||||
if (attribute.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
|
if (attribute.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
|
||||||
BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong());
|
||||||
if (associatedArtifact != null) {
|
if (associatedArtifact != null) {
|
||||||
dirTree.viewArtifact(associatedArtifact);
|
dirTree.viewArtifact(associatedArtifact);
|
||||||
break;
|
break;
|
||||||
@ -56,7 +57,7 @@ class ViewSourceArtifactAction extends AbstractAction {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.WARNING, "Unable to perform view artifact on an associated artifact of " + artifact.getDisplayName(), ex); //NON-NLS
|
logger.log(Level.WARNING, "Unable to perform view artifact on an associated artifact of " + artifact.getDisplayName(), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -32,6 +32,7 @@ import java.util.logging.Level;
|
|||||||
import org.netbeans.api.progress.ProgressHandle;
|
import org.netbeans.api.progress.ProgressHandle;
|
||||||
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.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
@ -78,12 +79,12 @@ class ImageWriter implements PropertyChangeListener{
|
|||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
doUI = RuntimeProperties.runningWithGUI();
|
doUI = RuntimeProperties.runningWithGUI();
|
||||||
|
|
||||||
// We save the reference to the sleuthkit case here in case getCurrentCase() is set to
|
// We save the reference to the sleuthkit case here in case getOpenCase() is set to
|
||||||
// null before Image Writer finishes. The user can still elect to wait for image writer
|
// null before Image Writer finishes. The user can still elect to wait for image writer
|
||||||
// (in ImageWriterService.closeCaseResources) even though the case is closing.
|
// (in ImageWriterService.closeCaseResources) even though the case is closing.
|
||||||
try{
|
try{
|
||||||
caseDb = Case.getCurrentCase().getSleuthkitCase();
|
caseDb = Case.getOpenCase().getSleuthkitCase();
|
||||||
} catch (IllegalStateException ex){
|
} catch (NoCurrentCaseException ex){
|
||||||
logger.log(Level.SEVERE, "Unable to load case. Image writer will be cancelled.");
|
logger.log(Level.SEVERE, "Unable to load case. Image writer will be cancelled.");
|
||||||
this.isCancelled = true;
|
this.isCancelled = true;
|
||||||
}
|
}
|
||||||
@ -151,10 +152,10 @@ class ImageWriter implements PropertyChangeListener{
|
|||||||
|
|
||||||
Image image;
|
Image image;
|
||||||
try{
|
try{
|
||||||
image = Case.getCurrentCase().getSleuthkitCase().getImageById(dataSourceId);
|
image = Case.getOpenCase().getSleuthkitCase().getImageById(dataSourceId);
|
||||||
imageHandle = image.getImageHandle();
|
imageHandle = image.getImageHandle();
|
||||||
} catch (IllegalStateException ex){
|
} catch (NoCurrentCaseException ex){
|
||||||
// This exception means that getCurrentCase() failed because no case was open.
|
// This exception means that getOpenCase() failed because no case was open.
|
||||||
// This can happen when the user closes the case while ingest is ongoing - canceling
|
// This can happen when the user closes the case while ingest is ongoing - canceling
|
||||||
// ingest fires off the DataSourceAnalysisCompletedEvent while the case is in the
|
// ingest fires off the DataSourceAnalysisCompletedEvent while the case is in the
|
||||||
// process of closing.
|
// process of closing.
|
||||||
|
@ -43,6 +43,7 @@ import javax.swing.table.TableColumn;
|
|||||||
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.IngestJobInfoPanel;
|
import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
|
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel;
|
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel;
|
||||||
@ -97,9 +98,9 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
|
|||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.dataSources.addAll(dataSources);
|
this.dataSources.addAll(dataSources);
|
||||||
try {
|
try {
|
||||||
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
ingestJobs.addAll(skCase.getIngestJobs());
|
ingestJobs.addAll(skCase.getIngestJobs());
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "No open case", ex);
|
logger.log(Level.SEVERE, "No open case", ex);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to load ingest job information", ex);
|
logger.log(Level.SEVERE, "Failed to load ingest job information", ex);
|
||||||
|
@ -50,6 +50,7 @@ import org.openide.util.Cancellable;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
import org.sleuthkit.autopsy.core.ServicesMonitor;
|
import org.sleuthkit.autopsy.core.ServicesMonitor;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
@ -190,10 +191,10 @@ public class IngestManager {
|
|||||||
* only necessary for multi-user cases.
|
* only necessary for multi-user cases.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
if (Case.getCurrentCase().getCaseType() != Case.CaseType.MULTI_USER_CASE) {
|
if (Case.getOpenCase().getCaseType() != Case.CaseType.MULTI_USER_CASE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException noCaseOpenException) {
|
} catch (NoCurrentCaseException noCaseOpenException) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,13 +252,13 @@ public class IngestManager {
|
|||||||
caseIsOpen = true;
|
caseIsOpen = true;
|
||||||
clearIngestMessageBox();
|
clearIngestMessageBox();
|
||||||
try {
|
try {
|
||||||
Case openedCase = Case.getCurrentCase();
|
Case openedCase = Case.getOpenCase();
|
||||||
String channelPrefix = openedCase.getName();
|
String channelPrefix = openedCase.getName();
|
||||||
if (Case.CaseType.MULTI_USER_CASE == openedCase.getCaseType()) {
|
if (Case.CaseType.MULTI_USER_CASE == openedCase.getCaseType()) {
|
||||||
jobEventPublisher.openRemoteEventChannel(String.format(INGEST_JOB_EVENT_CHANNEL_NAME, channelPrefix));
|
jobEventPublisher.openRemoteEventChannel(String.format(INGEST_JOB_EVENT_CHANNEL_NAME, channelPrefix));
|
||||||
moduleEventPublisher.openRemoteEventChannel(String.format(INGEST_MODULE_EVENT_CHANNEL_NAME, channelPrefix));
|
moduleEventPublisher.openRemoteEventChannel(String.format(INGEST_MODULE_EVENT_CHANNEL_NAME, channelPrefix));
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException | AutopsyEventException ex) {
|
} catch (NoCurrentCaseException | AutopsyEventException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to open remote events channel", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to open remote events channel", ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.Fail.Title"),
|
MessageNotifyUtil.Notify.error(NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.Fail.Title"),
|
||||||
NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.Fail.ErrMsg"));
|
NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.Fail.ErrMsg"));
|
||||||
@ -347,61 +348,65 @@ public class IngestManager {
|
|||||||
})
|
})
|
||||||
private IngestJobStartResult startIngestJob(IngestJob job) {
|
private IngestJobStartResult startIngestJob(IngestJob job) {
|
||||||
List<IngestModuleError> errors = null;
|
List<IngestModuleError> errors = null;
|
||||||
if (caseIsOpen) {
|
Case openCase;
|
||||||
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
try {
|
||||||
try {
|
openCase = Case.getOpenCase();
|
||||||
if (!servicesMonitor.getServiceStatus(ServicesMonitor.Service.REMOTE_CASE_DATABASE.toString()).equals(ServicesMonitor.ServiceStatus.UP.toString())) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
if (RuntimeProperties.runningWithGUI()) {
|
return new IngestJobStartResult(null, new IngestManagerException("Exception while getting open case.", ex), Collections.<IngestModuleError>emptyList()); //NON-NLS
|
||||||
EventQueue.invokeLater(new Runnable() {
|
}
|
||||||
@Override
|
if (openCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
||||||
public void run() {
|
try {
|
||||||
String serviceDisplayName = ServicesMonitor.Service.REMOTE_CASE_DATABASE.getDisplayName();
|
if (!servicesMonitor.getServiceStatus(ServicesMonitor.Service.REMOTE_CASE_DATABASE.toString()).equals(ServicesMonitor.ServiceStatus.UP.toString())) {
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
if (RuntimeProperties.runningWithGUI()) {
|
||||||
NbBundle.getMessage(this.getClass(), "IngestManager.cancellingIngest.msgDlg.text"),
|
EventQueue.invokeLater(new Runnable() {
|
||||||
NbBundle.getMessage(this.getClass(), "IngestManager.serviceIsDown.msgDlg.text", serviceDisplayName),
|
@Override
|
||||||
JOptionPane.ERROR_MESSAGE);
|
public void run() {
|
||||||
}
|
String serviceDisplayName = ServicesMonitor.Service.REMOTE_CASE_DATABASE.getDisplayName();
|
||||||
});
|
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
||||||
}
|
NbBundle.getMessage(this.getClass(), "IngestManager.cancellingIngest.msgDlg.text"),
|
||||||
return new IngestJobStartResult(null, new IngestManagerException("Ingest aborted. Remote database is down"), Collections.<IngestModuleError>emptyList()); //NON-NLS
|
NbBundle.getMessage(this.getClass(), "IngestManager.serviceIsDown.msgDlg.text", serviceDisplayName),
|
||||||
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (ServicesMonitor.ServicesMonitorException ex) {
|
return new IngestJobStartResult(null, new IngestManagerException("Ingest aborted. Remote database is down"), Collections.<IngestModuleError>emptyList()); //NON-NLS
|
||||||
return new IngestJobStartResult(null, new IngestManagerException("Database server is down", ex), Collections.<IngestModuleError>emptyList()); //NON-NLS
|
|
||||||
}
|
}
|
||||||
|
} catch (ServicesMonitor.ServicesMonitorException ex) {
|
||||||
|
return new IngestJobStartResult(null, new IngestManagerException("Database server is down", ex), Collections.<IngestModuleError>emptyList()); //NON-NLS
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!ingestMonitor.isRunning()) {
|
if (!ingestMonitor.isRunning()) {
|
||||||
ingestMonitor.start();
|
ingestMonitor.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
ingestJobsById.put(job.getId(), job);
|
||||||
|
errors = job.start();
|
||||||
|
if (errors.isEmpty()) {
|
||||||
|
this.fireIngestJobStarted(job.getId());
|
||||||
|
IngestManager.logger.log(Level.INFO, "Ingest job {0} started", job.getId()); //NON-NLS
|
||||||
|
} else {
|
||||||
|
this.ingestJobsById.remove(job.getId());
|
||||||
|
for (IngestModuleError error : errors) {
|
||||||
|
logger.log(Level.SEVERE, String.format("Error starting %s ingest module for job %d", error.getModuleDisplayName(), job.getId()), error.getThrowable()); //NON-NLS
|
||||||
}
|
}
|
||||||
|
IngestManager.logger.log(Level.SEVERE, "Ingest job {0} could not be started", job.getId()); //NON-NLS
|
||||||
ingestJobsById.put(job.getId(), job);
|
if (RuntimeProperties.runningWithGUI()) {
|
||||||
errors = job.start();
|
final StringBuilder message = new StringBuilder(1024);
|
||||||
if (errors.isEmpty()) {
|
message.append(Bundle.IngestManager_startupErr_dlgMsg()).append("\n"); //NON-NLS
|
||||||
this.fireIngestJobStarted(job.getId());
|
message.append(Bundle.IngestManager_startupErr_dlgSolution()).append("\n\n"); //NON-NLS
|
||||||
IngestManager.logger.log(Level.INFO, "Ingest job {0} started", job.getId()); //NON-NLS
|
message.append(Bundle.IngestManager_startupErr_dlgErrorList()).append("\n"); //NON-NLS
|
||||||
} else {
|
|
||||||
this.ingestJobsById.remove(job.getId());
|
|
||||||
for (IngestModuleError error : errors) {
|
for (IngestModuleError error : errors) {
|
||||||
logger.log(Level.SEVERE, String.format("Error starting %s ingest module for job %d", error.getModuleDisplayName(), job.getId()), error.getThrowable()); //NON-NLS
|
String moduleName = error.getModuleDisplayName();
|
||||||
|
String errorMessage = error.getThrowable().getLocalizedMessage();
|
||||||
|
message.append(moduleName).append(": ").append(errorMessage).append("\n"); //NON-NLS
|
||||||
}
|
}
|
||||||
IngestManager.logger.log(Level.SEVERE, "Ingest job {0} could not be started", job.getId()); //NON-NLS
|
message.append("\n\n");
|
||||||
if (RuntimeProperties.runningWithGUI()) {
|
EventQueue.invokeLater(() -> {
|
||||||
final StringBuilder message = new StringBuilder(1024);
|
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), message, Bundle.IngestManager_startupErr_dlgTitle(), JOptionPane.ERROR_MESSAGE);
|
||||||
message.append(Bundle.IngestManager_startupErr_dlgMsg()).append("\n"); //NON-NLS
|
});
|
||||||
message.append(Bundle.IngestManager_startupErr_dlgSolution()).append("\n\n"); //NON-NLS
|
|
||||||
message.append(Bundle.IngestManager_startupErr_dlgErrorList()).append("\n"); //NON-NLS
|
|
||||||
for (IngestModuleError error : errors) {
|
|
||||||
String moduleName = error.getModuleDisplayName();
|
|
||||||
String errorMessage = error.getThrowable().getLocalizedMessage();
|
|
||||||
message.append(moduleName).append(": ").append(errorMessage).append("\n"); //NON-NLS
|
|
||||||
}
|
|
||||||
message.append("\n\n");
|
|
||||||
EventQueue.invokeLater(() -> {
|
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), message, Bundle.IngestManager_startupErr_dlgTitle(), JOptionPane.ERROR_MESSAGE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return new IngestJobStartResult(null, new IngestManagerException("Errors occurred while starting ingest"), errors); //NON-NLS
|
|
||||||
}
|
}
|
||||||
|
return new IngestJobStartResult(null, new IngestManagerException("Errors occurred while starting ingest"), errors); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
return new IngestJobStartResult(job, null, errors);
|
return new IngestJobStartResult(job, null, errors);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -26,6 +26,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
@ -93,11 +94,11 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa
|
|||||||
SerializableEventData data = (SerializableEventData) super.getOldValue();
|
SerializableEventData data = (SerializableEventData) super.getOldValue();
|
||||||
Collection<BlackboardArtifact> artifacts = new ArrayList<>();
|
Collection<BlackboardArtifact> artifacts = new ArrayList<>();
|
||||||
for (Long id : data.artifactIds) {
|
for (Long id : data.artifactIds) {
|
||||||
artifacts.add(Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(id));
|
artifacts.add(Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(id));
|
||||||
}
|
}
|
||||||
eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null);
|
eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null);
|
||||||
return eventData;
|
return eventData;
|
||||||
} catch (IllegalStateException | TskCoreException ex) {
|
} catch (NoCurrentCaseException | TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -27,6 +27,7 @@ import org.openide.util.Lookup;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.TopComponent;
|
import org.openide.windows.TopComponent;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataContentTopComponent;
|
import org.sleuthkit.autopsy.corecomponents.DataContentTopComponent;
|
||||||
|
|
||||||
@ -51,9 +52,9 @@ class DataContentDynamicMenu extends JMenuItem implements DynamicMenuContent {
|
|||||||
defaultItem.addActionListener(new OpenTopComponentAction(contentWin));
|
defaultItem.addActionListener(new OpenTopComponentAction(contentWin));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getOpenCase();
|
||||||
defaultItem.setEnabled(currentCase.hasData());
|
defaultItem.setEnabled(currentCase.hasData());
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
defaultItem.setEnabled(false); // disable the menu when no case is opened
|
defaultItem.setEnabled(false); // disable the menu when no case is opened
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -25,6 +25,7 @@ import org.openide.awt.DynamicMenuContent;
|
|||||||
import org.openide.util.Lookup;
|
import org.openide.util.Lookup;
|
||||||
import org.openide.windows.TopComponent;
|
import org.openide.windows.TopComponent;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,9 +55,9 @@ class DataExplorerDynamicMenu extends JMenuItem implements DynamicMenuContent {
|
|||||||
item.addActionListener(new OpenTopComponentAction(explorerWin));
|
item.addActionListener(new OpenTopComponentAction(explorerWin));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getOpenCase();
|
||||||
item.setEnabled(currentCase.hasData());
|
item.setEnabled(currentCase.hasData());
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
item.setEnabled(false); // disable the menu when no case is opened
|
item.setEnabled(false); // disable the menu when no case is opened
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import org.openide.util.HelpCtx;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.actions.CallableSystemAction;
|
import org.openide.util.actions.CallableSystemAction;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||||
import org.sleuthkit.autopsy.directorytree.HashSearchProvider;
|
import org.sleuthkit.autopsy.directorytree.HashSearchProvider;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
@ -118,8 +119,12 @@ public class HashDbSearchAction extends CallableSystemAction implements HashSear
|
|||||||
* performAction.
|
* performAction.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@NbBundle.Messages ({
|
||||||
|
"HashDbSearchAction.noOpenCase.errMsg=No open case available."
|
||||||
|
})
|
||||||
public void performAction() {
|
public void performAction() {
|
||||||
// Make sure at least 1 file has an md5 hash
|
// Make sure at least 1 file has an md5 hash
|
||||||
|
try {
|
||||||
if (file != null && HashDbSearcher.countFilesMd5Hashed() > 0) {
|
if (file != null && HashDbSearcher.countFilesMd5Hashed() > 0) {
|
||||||
doSearch();
|
doSearch();
|
||||||
} else {
|
} else {
|
||||||
@ -129,6 +134,12 @@ public class HashDbSearchAction extends CallableSystemAction implements HashSear
|
|||||||
NbBundle.getMessage(this.getClass(), "HashDbSearchAction.dlgMsg.title"),
|
NbBundle.getMessage(this.getClass(), "HashDbSearchAction.dlgMsg.title"),
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
||||||
|
Bundle.HashDbSearchAction_noOpenCase_errMsg(),
|
||||||
|
NbBundle.getMessage(this.getClass(), "HashDbSearchAction.dlgMsg.title"),
|
||||||
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doSearch() {
|
private void doSearch() {
|
||||||
|
@ -32,6 +32,7 @@ import javax.swing.table.DefaultTableModel;
|
|||||||
import javax.swing.text.AttributeSet;
|
import javax.swing.text.AttributeSet;
|
||||||
import javax.swing.text.BadLocationException;
|
import javax.swing.text.BadLocationException;
|
||||||
import javax.swing.text.PlainDocument;
|
import javax.swing.text.PlainDocument;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -292,16 +293,27 @@ class HashDbSearchPanel extends javax.swing.JPanel implements ActionListener {
|
|||||||
* Search through all tsk_files to find ones with the same hashes as the
|
* Search through all tsk_files to find ones with the same hashes as the
|
||||||
* hashes given.
|
* hashes given.
|
||||||
*/
|
*/
|
||||||
|
@NbBundle.Messages ({
|
||||||
|
"HashDbSearchPanel.noOpenCase.errMsg=No open case available."
|
||||||
|
})
|
||||||
boolean search() {
|
boolean search() {
|
||||||
// Check if any hashed have been entered
|
// Check if any hashed have been entered
|
||||||
if (hashTable.getRowCount() != 0) {
|
if (hashTable.getRowCount() != 0) {
|
||||||
// Make sure at least 1 file has an md5 hash
|
// Make sure at least 1 file has an md5 hash
|
||||||
if (HashDbSearcher.countFilesMd5Hashed() > 0) {
|
try {
|
||||||
return doSearch();
|
if (HashDbSearcher.countFilesMd5Hashed() > 0) {
|
||||||
} else {
|
return doSearch();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this,
|
||||||
|
NbBundle.getMessage(this.getClass(),
|
||||||
|
"HashDbSearchPanel.noFilesHaveMD5HashMsg"),
|
||||||
|
NbBundle.getMessage(this.getClass(), "HashDbSearchPanel.dlgMsg.title"),
|
||||||
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
JOptionPane.showMessageDialog(this,
|
JOptionPane.showMessageDialog(this,
|
||||||
NbBundle.getMessage(this.getClass(),
|
Bundle.HashDbSearchPanel_noOpenCase_errMsg(),
|
||||||
"HashDbSearchPanel.noFilesHaveMD5HashMsg"),
|
|
||||||
NbBundle.getMessage(this.getClass(), "HashDbSearchPanel.dlgMsg.title"),
|
NbBundle.getMessage(this.getClass(), "HashDbSearchPanel.dlgMsg.title"),
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -22,9 +22,12 @@ import java.util.Collections;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.logging.Level;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
import org.netbeans.api.progress.ProgressHandle;
|
import org.netbeans.api.progress.ProgressHandle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.FsContent;
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
@ -34,7 +37,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
|||||||
* the same content.
|
* the same content.
|
||||||
*/
|
*/
|
||||||
class HashDbSearcher {
|
class HashDbSearcher {
|
||||||
|
private static final Logger logger = Logger.getLogger(HashDbSearcher.class.getName());
|
||||||
/**
|
/**
|
||||||
* Given a string hash value, find all files with that hash.
|
* Given a string hash value, find all files with that hash.
|
||||||
*
|
*
|
||||||
@ -42,8 +45,8 @@ class HashDbSearcher {
|
|||||||
*
|
*
|
||||||
* @return a List of all FsContent with the given hash
|
* @return a List of all FsContent with the given hash
|
||||||
*/
|
*/
|
||||||
static List<AbstractFile> findFilesByMd5(String md5Hash) {
|
static List<AbstractFile> findFilesByMd5(String md5Hash) throws NoCurrentCaseException {
|
||||||
final Case currentCase = Case.getCurrentCase();
|
final Case currentCase = Case.getOpenCase();
|
||||||
final SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
final SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
||||||
return skCase.findFilesByMd5(md5Hash);
|
return skCase.findFilesByMd5(md5Hash);
|
||||||
}
|
}
|
||||||
@ -56,7 +59,7 @@ class HashDbSearcher {
|
|||||||
*
|
*
|
||||||
* @return a Map of md5 hashes mapped to the list of files hit
|
* @return a Map of md5 hashes mapped to the list of files hit
|
||||||
*/
|
*/
|
||||||
static Map<String, List<AbstractFile>> findFilesBymd5(List<String> md5Hash) {
|
static Map<String, List<AbstractFile>> findFilesBymd5(List<String> md5Hash) throws NoCurrentCaseException {
|
||||||
Map<String, List<AbstractFile>> map = new LinkedHashMap<String, List<AbstractFile>>();
|
Map<String, List<AbstractFile>> map = new LinkedHashMap<String, List<AbstractFile>>();
|
||||||
for (String md5 : md5Hash) {
|
for (String md5 : md5Hash) {
|
||||||
List<AbstractFile> files = findFilesByMd5(md5);
|
List<AbstractFile> files = findFilesByMd5(md5);
|
||||||
@ -69,7 +72,7 @@ class HashDbSearcher {
|
|||||||
|
|
||||||
// Same as above, but with a given ProgressHandle to accumulate and StringWorker to check if cancelled
|
// Same as above, but with a given ProgressHandle to accumulate and StringWorker to check if cancelled
|
||||||
|
|
||||||
static Map<String, List<AbstractFile>> findFilesBymd5(List<String> md5Hash, ProgressHandle progress, SwingWorker<Object, Void> worker) {
|
static Map<String, List<AbstractFile>> findFilesBymd5(List<String> md5Hash, ProgressHandle progress, SwingWorker<Object, Void> worker) throws NoCurrentCaseException {
|
||||||
Map<String, List<AbstractFile>> map = new LinkedHashMap<String, List<AbstractFile>>();
|
Map<String, List<AbstractFile>> map = new LinkedHashMap<String, List<AbstractFile>>();
|
||||||
if (!worker.isCancelled()) {
|
if (!worker.isCancelled()) {
|
||||||
progress.switchToDeterminate(md5Hash.size());
|
progress.switchToDeterminate(md5Hash.size());
|
||||||
@ -101,9 +104,14 @@ class HashDbSearcher {
|
|||||||
*/
|
*/
|
||||||
static List<AbstractFile> findFiles(FsContent file) {
|
static List<AbstractFile> findFiles(FsContent file) {
|
||||||
String md5;
|
String md5;
|
||||||
if ((md5 = file.getMd5Hash()) != null) {
|
try {
|
||||||
return findFilesByMd5(md5);
|
if ((md5 = file.getMd5Hash()) != null) {
|
||||||
} else {
|
return findFilesByMd5(md5);
|
||||||
|
} else {
|
||||||
|
return Collections.<AbstractFile>emptyList();
|
||||||
|
}
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
return Collections.<AbstractFile>emptyList();
|
return Collections.<AbstractFile>emptyList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,8 +122,8 @@ class HashDbSearcher {
|
|||||||
*
|
*
|
||||||
* @return true if the search feature is ready.
|
* @return true if the search feature is ready.
|
||||||
*/
|
*/
|
||||||
static boolean allFilesMd5Hashed() {
|
static boolean allFilesMd5Hashed() throws NoCurrentCaseException {
|
||||||
final Case currentCase = Case.getCurrentCase();
|
final Case currentCase = Case.getOpenCase();
|
||||||
final SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
final SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
||||||
return skCase.allFilesMd5Hashed();
|
return skCase.allFilesMd5Hashed();
|
||||||
}
|
}
|
||||||
@ -125,8 +133,8 @@ class HashDbSearcher {
|
|||||||
*
|
*
|
||||||
* @return the number of files with an MD5
|
* @return the number of files with an MD5
|
||||||
*/
|
*/
|
||||||
static int countFilesMd5Hashed() {
|
static int countFilesMd5Hashed() throws NoCurrentCaseException {
|
||||||
final Case currentCase = Case.getCurrentCase();
|
final Case currentCase = Case.getOpenCase();
|
||||||
final SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
final SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
||||||
return skCase.countFilesMd5Hashed();
|
return skCase.countFilesMd5Hashed();
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import java.util.List;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -62,10 +63,17 @@ final class CallLogAnalyzer {
|
|||||||
* @param context The ingest job context.
|
* @param context The ingest job context.
|
||||||
*/
|
*/
|
||||||
public void findCallLogs(IngestJobContext context) {
|
public void findCallLogs(IngestJobContext context) {
|
||||||
blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
blackboard = openCase.getServices().getBlackboard();
|
||||||
List<AbstractFile> absFiles;
|
List<AbstractFile> absFiles;
|
||||||
try {
|
try {
|
||||||
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase skCase = openCase.getSleuthkitCase();
|
||||||
absFiles = skCase.findAllFilesWhere("name ='contacts2.db' OR name ='contacts.db'"); //NON-NLS //get exact file names
|
absFiles = skCase.findAllFilesWhere("name ='contacts2.db' OR name ='contacts.db'"); //NON-NLS //get exact file names
|
||||||
if (absFiles.isEmpty()) {
|
if (absFiles.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@ -107,7 +115,13 @@ final class CallLogAnalyzer {
|
|||||||
logger.log(Level.SEVERE, "Error opening database", e); //NON-NLS
|
logger.log(Level.SEVERE, "Error opening database", e); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase;
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
||||||
try {
|
try {
|
||||||
AbstractFile file = skCase.getAbstractFileById(fileId);
|
AbstractFile file = skCase.getAbstractFileById(fileId);
|
||||||
|
@ -30,6 +30,7 @@ import java.util.logging.Level;
|
|||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -65,9 +66,16 @@ class TextMessageAnalyzer {
|
|||||||
* @param context The ingest job context.
|
* @param context The ingest job context.
|
||||||
*/
|
*/
|
||||||
void findTexts(IngestJobContext context) {
|
void findTexts(IngestJobContext context) {
|
||||||
blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
Case openCase;
|
||||||
try {
|
try {
|
||||||
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
blackboard = openCase.getServices().getBlackboard();
|
||||||
|
try {
|
||||||
|
SleuthkitCase skCase = openCase.getSleuthkitCase();
|
||||||
absFiles = skCase.findAllFilesWhere("name ='mmssms.db'"); //NON-NLS //get exact file name
|
absFiles = skCase.findAllFilesWhere("name ='mmssms.db'"); //NON-NLS //get exact file name
|
||||||
if (absFiles.isEmpty()) {
|
if (absFiles.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2013 Basis Technology Corp.
|
* Copyright 2013-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -30,6 +30,7 @@ import java.util.ArrayList;
|
|||||||
import org.mitre.cybox.objects.AccountObjectType;
|
import org.mitre.cybox.objects.AccountObjectType;
|
||||||
import org.mitre.cybox.objects.UserAccountObjectType;
|
import org.mitre.cybox.objects.UserAccountObjectType;
|
||||||
import org.mitre.cybox.objects.WindowsUserAccount;
|
import org.mitre.cybox.objects.WindowsUserAccount;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -104,7 +105,7 @@ class EvalAccountObj extends EvaluatableObject {
|
|||||||
try {
|
try {
|
||||||
List<BlackboardArtifact> finalHits = new ArrayList<BlackboardArtifact>();
|
List<BlackboardArtifact> finalHits = new ArrayList<BlackboardArtifact>();
|
||||||
|
|
||||||
Case case1 = Case.getCurrentCase();
|
Case case1 = Case.getOpenCase();
|
||||||
SleuthkitCase sleuthkitCase = case1.getSleuthkitCase();
|
SleuthkitCase sleuthkitCase = case1.getSleuthkitCase();
|
||||||
List<BlackboardArtifact> artList
|
List<BlackboardArtifact> artList
|
||||||
= sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_ACCOUNT);
|
= sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_ACCOUNT);
|
||||||
@ -150,7 +151,7 @@ class EvalAccountObj extends EvaluatableObject {
|
|||||||
// Didn't find any matches
|
// Didn't find any matches
|
||||||
return new ObservableResult(id, "AccountObject: No matches found for " + searchString, //NON-NLS
|
return new ObservableResult(id, "AccountObject: No matches found for " + searchString, //NON-NLS
|
||||||
spacing, ObservableResult.ObservableState.FALSE, null);
|
spacing, ObservableResult.ObservableState.FALSE, null);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
return new ObservableResult(id, "AccountObject: Exception during evaluation: " + ex.getLocalizedMessage(), //NON-NLS
|
return new ObservableResult(id, "AccountObject: Exception during evaluation: " + ex.getLocalizedMessage(), //NON-NLS
|
||||||
spacing, ObservableResult.ObservableState.INDETERMINATE, null);
|
spacing, ObservableResult.ObservableState.INDETERMINATE, null);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2013 Basis Technology Corp.
|
* Copyright 2013-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -23,6 +23,7 @@ import java.util.Collection;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -49,20 +50,28 @@ class StixArtifactData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public StixArtifactData(long a_objId, String a_observableId, String a_objType) {
|
public StixArtifactData(long a_objId, String a_observableId, String a_objType) {
|
||||||
Case case1 = Case.getCurrentCase();
|
|
||||||
SleuthkitCase sleuthkitCase = case1.getSleuthkitCase();
|
|
||||||
try {
|
try {
|
||||||
|
Case case1 = Case.getOpenCase();
|
||||||
|
SleuthkitCase sleuthkitCase = case1.getSleuthkitCase();
|
||||||
file = sleuthkitCase.getAbstractFileById(a_objId);
|
file = sleuthkitCase.getAbstractFileById(a_objId);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
file = null;
|
file = null;
|
||||||
}
|
}
|
||||||
observableId = a_observableId;
|
observableId = a_observableId;
|
||||||
objType = a_objType;
|
objType = a_objType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Messages({"StixArtifactData.indexError.message=Failed to index STIX interesting file hit artifact for keyword search."})
|
@Messages({"StixArtifactData.indexError.message=Failed to index STIX interesting file hit artifact for keyword search.",
|
||||||
|
"StixArtifactData.noOpenCase.errMsg=No open case available."})
|
||||||
public void createArtifact(String a_title) throws TskCoreException {
|
public void createArtifact(String a_title) throws TskCoreException {
|
||||||
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
Blackboard blackboard;
|
||||||
|
try {
|
||||||
|
blackboard = Case.getOpenCase().getServices().getBlackboard();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_noOpenCase_errMsg(), ex.getLocalizedMessage());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String setName;
|
String setName;
|
||||||
if (a_title != null) {
|
if (a_title != null) {
|
||||||
|
@ -35,6 +35,7 @@ import org.openide.util.NbBundle.Messages;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.GeneralFilter;
|
import org.sleuthkit.autopsy.casemodule.GeneralFilter;
|
||||||
import org.sleuthkit.autopsy.casemodule.ImageDSProcessor;
|
import org.sleuthkit.autopsy.casemodule.ImageDSProcessor;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -73,13 +74,14 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
private final HashMap<String, String> imageFolderToOutputFolder = new HashMap<>();
|
private final HashMap<String, String> imageFolderToOutputFolder = new HashMap<>();
|
||||||
private int folderId = 0;
|
private int folderId = 0;
|
||||||
|
|
||||||
@Messages({"# {0} - data source name", "deviceIdQueryErrMsg=Data source {0} missing Device ID"})
|
@Messages({"# {0} - data source name", "deviceIdQueryErrMsg=Data source {0} missing Device ID",
|
||||||
|
"VMExtractorIngestModule.noOpenCase.errMsg=No open case available."})
|
||||||
@Override
|
@Override
|
||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
long dataSourceObjId = context.getDataSource().getId();
|
long dataSourceObjId = context.getDataSource().getId();
|
||||||
try {
|
try {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getOpenCase();
|
||||||
SleuthkitCase caseDb = currentCase.getSleuthkitCase();
|
SleuthkitCase caseDb = currentCase.getSleuthkitCase();
|
||||||
DataSource dataSource = caseDb.getDataSource(dataSourceObjId);
|
DataSource dataSource = caseDb.getDataSource(dataSourceObjId);
|
||||||
parentDeviceId = dataSource.getDeviceId();
|
parentDeviceId = dataSource.getDeviceId();
|
||||||
@ -88,13 +90,15 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
String timeStamp = dateFormat.format(Calendar.getInstance().getTime());
|
String timeStamp = dateFormat.format(Calendar.getInstance().getTime());
|
||||||
String ingestJobOutputDirName = context.getDataSource().getName() + "_" + context.getDataSource().getId() + "_" + timeStamp;
|
String ingestJobOutputDirName = context.getDataSource().getName() + "_" + context.getDataSource().getId() + "_" + timeStamp;
|
||||||
ingestJobOutputDirName = ingestJobOutputDirName.replace(':', '_');
|
ingestJobOutputDirName = ingestJobOutputDirName.replace(':', '_');
|
||||||
ingestJobOutputDir = Paths.get(Case.getCurrentCase().getModuleDirectory(), VMExtractorIngestModuleFactory.getModuleName(), ingestJobOutputDirName);
|
ingestJobOutputDir = Paths.get(currentCase.getModuleDirectory(), VMExtractorIngestModuleFactory.getModuleName(), ingestJobOutputDirName);
|
||||||
// create module output folder to write extracted virtual machine files to
|
// create module output folder to write extracted virtual machine files to
|
||||||
Files.createDirectories(ingestJobOutputDir);
|
Files.createDirectories(ingestJobOutputDir);
|
||||||
} catch (IOException | SecurityException | UnsupportedOperationException ex) {
|
} catch (IOException | SecurityException | UnsupportedOperationException ex) {
|
||||||
throw new IngestModule.IngestModuleException(Bundle.VMExtractorIngestModule_cannotCreateOutputDir_message(ex.getLocalizedMessage()), ex);
|
throw new IngestModule.IngestModuleException(Bundle.VMExtractorIngestModule_cannotCreateOutputDir_message(ex.getLocalizedMessage()), ex);
|
||||||
} catch (TskDataException | TskCoreException ex) {
|
} catch (TskDataException | TskCoreException ex) {
|
||||||
throw new IngestModule.IngestModuleException(Bundle.deviceIdQueryErrMsg(context.getDataSource().getName()), ex);
|
throw new IngestModule.IngestModuleException(Bundle.deviceIdQueryErrMsg(context.getDataSource().getName()), ex);
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
throw new IngestModule.IngestModuleException(Bundle.VMExtractorIngestModule_noOpenCase_errMsg(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,6 +121,9 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error querying case database", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error querying case database", ex); //NON-NLS
|
||||||
return ProcessResult.ERROR;
|
return ProcessResult.ERROR;
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return ProcessResult.ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vmFiles.isEmpty()) {
|
if (vmFiles.isEmpty()) {
|
||||||
@ -198,6 +205,10 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
logger.log(Level.SEVERE, "Failed to ingest virtual machine file " + file + " in folder " + folder, ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to ingest virtual machine file " + file + " in folder " + folder, ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.title.txt"),
|
MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.title.txt"),
|
||||||
NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.msg.txt", file));
|
NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.msg.txt", file));
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.msgNotify.failedIngestVM.title.txt"),
|
||||||
|
Bundle.VMExtractorIngestModule_noOpenCase_errMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Update progress bar
|
// Update progress bar
|
||||||
@ -219,11 +230,11 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
* @throws TskCoreException if there is a problem querying the case
|
* @throws TskCoreException if there is a problem querying the case
|
||||||
* database.
|
* database.
|
||||||
*/
|
*/
|
||||||
private static List<AbstractFile> findVirtualMachineFiles(Content dataSource) throws TskCoreException {
|
private static List<AbstractFile> findVirtualMachineFiles(Content dataSource) throws TskCoreException, NoCurrentCaseException {
|
||||||
List<AbstractFile> vmFiles = new ArrayList<>();
|
List<AbstractFile> vmFiles = new ArrayList<>();
|
||||||
for (String vmExtension : GeneralFilter.VIRTUAL_MACHINE_EXTS) {
|
for (String vmExtension : GeneralFilter.VIRTUAL_MACHINE_EXTS) {
|
||||||
String searchString = "%" + vmExtension; // want a search string that looks like this "%.vmdk"
|
String searchString = "%" + vmExtension; // want a search string that looks like this "%.vmdk"
|
||||||
vmFiles.addAll(Case.getCurrentCase().getServices().getFileManager().findFiles(dataSource, searchString));
|
vmFiles.addAll(Case.getOpenCase().getServices().getFileManager().findFiles(dataSource, searchString));
|
||||||
}
|
}
|
||||||
return vmFiles;
|
return vmFiles;
|
||||||
}
|
}
|
||||||
@ -258,13 +269,13 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
*
|
*
|
||||||
* @param vmFile A virtual machine file.
|
* @param vmFile A virtual machine file.
|
||||||
*/
|
*/
|
||||||
private void ingestVirtualMachineImage(Path vmFile) throws InterruptedException, IOException {
|
private void ingestVirtualMachineImage(Path vmFile) throws InterruptedException, IOException, NoCurrentCaseException {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to add the virtual machine file to the case as a data source.
|
* Try to add the virtual machine file to the case as a data source.
|
||||||
*/
|
*/
|
||||||
UUID taskId = UUID.randomUUID();
|
UUID taskId = UUID.randomUUID();
|
||||||
Case.getCurrentCase().notifyAddingDataSource(taskId);
|
Case.getOpenCase().notifyAddingDataSource(taskId);
|
||||||
ImageDSProcessor dataSourceProcessor = new ImageDSProcessor();
|
ImageDSProcessor dataSourceProcessor = new ImageDSProcessor();
|
||||||
AddDataSourceCallback dspCallback = new AddDataSourceCallback(vmFile);
|
AddDataSourceCallback dspCallback = new AddDataSourceCallback(vmFile);
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
@ -280,7 +291,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
* ingest context.
|
* ingest context.
|
||||||
*/
|
*/
|
||||||
if (!dspCallback.vmDataSources.isEmpty()) {
|
if (!dspCallback.vmDataSources.isEmpty()) {
|
||||||
Case.getCurrentCase().notifyDataSourceAdded(dspCallback.vmDataSources.get(0), taskId);
|
Case.getOpenCase().notifyDataSourceAdded(dspCallback.vmDataSources.get(0), taskId);
|
||||||
List<Content> dataSourceContent = new ArrayList<>(dspCallback.vmDataSources);
|
List<Content> dataSourceContent = new ArrayList<>(dspCallback.vmDataSources);
|
||||||
IngestJobSettings ingestJobSettings = new IngestJobSettings(context.getExecutionContext());
|
IngestJobSettings ingestJobSettings = new IngestJobSettings(context.getExecutionContext());
|
||||||
for (String warning : ingestJobSettings.getWarnings()) {
|
for (String warning : ingestJobSettings.getWarnings()) {
|
||||||
@ -291,7 +302,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
|||||||
NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.addedVirtualMachineImage.message", vmFile.toString())));
|
NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.addedVirtualMachineImage.message", vmFile.toString())));
|
||||||
IngestManager.getInstance().queueIngestJob(dataSourceContent, ingestJobSettings);
|
IngestManager.getInstance().queueIngestJob(dataSourceContent, ingestJobSettings);
|
||||||
} else {
|
} else {
|
||||||
Case.getCurrentCase().notifyFailedAddingDataSource(taskId);
|
Case.getOpenCase().notifyFailedAddingDataSource(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ import javax.swing.ListModel;
|
|||||||
import javax.swing.event.ListDataListener;
|
import javax.swing.event.ListDataListener;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -74,7 +75,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog {
|
|||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getLabel(),
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getLabel(),
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getDisplayName())); // output is too unstructured for table review
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getDisplayName())); // output is too unstructured for table review
|
||||||
|
|
||||||
artifactTypes = Case.getCurrentCase().getSleuthkitCase().getArtifactTypesInUse();
|
artifactTypes = Case.getOpenCase().getSleuthkitCase().getArtifactTypesInUse();
|
||||||
artifactTypes.removeAll(doNotReport);
|
artifactTypes.removeAll(doNotReport);
|
||||||
Collections.sort(artifactTypes, new Comparator<BlackboardArtifact.Type>() {
|
Collections.sort(artifactTypes, new Comparator<BlackboardArtifact.Type>() {
|
||||||
@Override
|
@Override
|
||||||
@ -89,6 +90,8 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog {
|
|||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: {0}", ex.getLocalizedMessage()); //NON-NLS
|
Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: {0}", ex.getLocalizedMessage()); //NON-NLS
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex.getLocalizedMessage()); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
|||||||
|
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
@ -71,13 +72,15 @@ class FileReportText implements FileReportModule {
|
|||||||
if (out != null) {
|
if (out != null) {
|
||||||
try {
|
try {
|
||||||
out.close();
|
out.close();
|
||||||
Case.getCurrentCase().addReport(reportPath, NbBundle.getMessage(this.getClass(),
|
Case.getOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(),
|
||||||
"FileReportText.getName.text"), "");
|
"FileReportText.getName.text"), "");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); //NON-NLS
|
logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); //NON-NLS
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
String errorMessage = String.format("Error adding %s to case as a report", reportPath); //NON-NLS
|
String errorMessage = String.format("Error adding %s to case as a report", reportPath); //NON-NLS
|
||||||
logger.log(Level.SEVERE, errorMessage, ex);
|
logger.log(Level.SEVERE, errorMessage, ex);
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import javax.swing.JPanel;
|
|||||||
|
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
|
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
|
||||||
@ -73,11 +74,17 @@ class ReportBodyFile implements GeneralReportModule {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) {
|
public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) {
|
||||||
// Start the progress bar and setup the report
|
// Start the progress bar and setup the report
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
progressPanel.setIndeterminate(false);
|
progressPanel.setIndeterminate(false);
|
||||||
progressPanel.start();
|
progressPanel.start();
|
||||||
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.querying"));
|
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.querying"));
|
||||||
reportPath = baseReportDir + getRelativeFilePath(); //NON-NLS
|
reportPath = baseReportDir + getRelativeFilePath(); //NON-NLS
|
||||||
currentCase = Case.getCurrentCase();
|
|
||||||
skCase = currentCase.getSleuthkitCase();
|
skCase = currentCase.getSleuthkitCase();
|
||||||
|
|
||||||
// Run query to get all files
|
// Run query to get all files
|
||||||
@ -154,14 +161,14 @@ class ReportBodyFile implements GeneralReportModule {
|
|||||||
if (out != null) {
|
if (out != null) {
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
Case.getCurrentCase().addReport(reportPath,
|
Case.getOpenCase().addReport(reportPath,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"ReportBodyFile.generateReport.srcModuleName.text"), "");
|
"ReportBodyFile.generateReport.srcModuleName.text"), "");
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.WARNING, "Could not flush and close the BufferedWriter.", ex); //NON-NLS
|
logger.log(Level.WARNING, "Could not flush and close the BufferedWriter.", ex); //NON-NLS
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
String errorMessage = String.format("Error adding %s to case as a report", reportPath); //NON-NLS
|
String errorMessage = String.format("Error adding %s to case as a report", reportPath); //NON-NLS
|
||||||
logger.log(Level.SEVERE, errorMessage, ex);
|
logger.log(Level.SEVERE, errorMessage, ex);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import org.apache.poi.ss.usermodel.*;
|
|||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
@ -112,13 +113,15 @@ class ReportExcel implements TableReportModule {
|
|||||||
try {
|
try {
|
||||||
out = new FileOutputStream(reportPath);
|
out = new FileOutputStream(reportPath);
|
||||||
wb.write(out);
|
wb.write(out);
|
||||||
Case.getCurrentCase().addReport(reportPath, NbBundle.getMessage(this.getClass(),
|
Case.getOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(),
|
||||||
"ReportExcel.endReport.srcModuleName.text"), "");
|
"ReportExcel.endReport.srcModuleName.text"), "");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to write Excel report.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to write Excel report.", ex); //NON-NLS
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
String errorMessage = String.format("Error adding %s to case as a report", reportPath); //NON-NLS
|
String errorMessage = String.format("Error adding %s to case as a report", reportPath); //NON-NLS
|
||||||
logger.log(Level.SEVERE, errorMessage, ex);
|
logger.log(Level.SEVERE, errorMessage, ex);
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
} finally {
|
} finally {
|
||||||
if (out != null) {
|
if (out != null) {
|
||||||
try {
|
try {
|
||||||
@ -300,6 +303,13 @@ class ReportExcel implements TableReportModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void writeSummaryWorksheet() {
|
private void writeSummaryWorksheet() {
|
||||||
|
Case currentCase;
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
sheet = wb.createSheet(NbBundle.getMessage(this.getClass(), "ReportExcel.sheetName.text"));
|
sheet = wb.createSheet(NbBundle.getMessage(this.getClass(), "ReportExcel.sheetName.text"));
|
||||||
rowIndex = 0;
|
rowIndex = 0;
|
||||||
|
|
||||||
@ -311,8 +321,6 @@ class ReportExcel implements TableReportModule {
|
|||||||
sheet.createRow(rowIndex);
|
sheet.createRow(rowIndex);
|
||||||
++rowIndex;
|
++rowIndex;
|
||||||
|
|
||||||
Case currentCase = Case.getCurrentCase();
|
|
||||||
|
|
||||||
row = sheet.createRow(rowIndex);
|
row = sheet.createRow(rowIndex);
|
||||||
row.setRowStyle(setStyle);
|
row.setRowStyle(setStyle);
|
||||||
row.createCell(0).setCellValue(NbBundle.getMessage(this.getClass(), "ReportExcel.cellVal.caseName"));
|
row.createCell(0).setCellValue(NbBundle.getMessage(this.getClass(), "ReportExcel.cellVal.caseName"));
|
||||||
|
@ -41,6 +41,7 @@ import org.openide.filesystems.FileUtil;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
|
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
|
||||||
@ -54,8 +55,6 @@ class ReportGenerator {
|
|||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ReportGenerator.class.getName());
|
private static final Logger logger = Logger.getLogger(ReportGenerator.class.getName());
|
||||||
|
|
||||||
private Case currentCase = Case.getCurrentCase();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Progress reportGenerationPanel that can be used to check for cancellation.
|
* Progress reportGenerationPanel that can be used to check for cancellation.
|
||||||
*/
|
*/
|
||||||
@ -229,10 +228,10 @@ class ReportGenerator {
|
|||||||
private List<AbstractFile> getFiles() {
|
private List<AbstractFile> getFiles() {
|
||||||
List<AbstractFile> absFiles;
|
List<AbstractFile> absFiles;
|
||||||
try {
|
try {
|
||||||
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
absFiles = skCase.findAllFilesWhere("meta_type != " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()); //NON-NLS
|
absFiles = skCase.findAllFilesWhere("meta_type != " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()); //NON-NLS
|
||||||
return absFiles;
|
return absFiles;
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
MessageNotifyUtil.Notify.show(
|
MessageNotifyUtil.Notify.show(
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"),
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(),
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(),
|
||||||
@ -252,7 +251,12 @@ class ReportGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String createReportDirectory(ReportModule module) throws IOException {
|
private static String createReportDirectory(ReportModule module) throws IOException {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase;
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
throw new IOException("Exception while getting open case.", ex);
|
||||||
|
}
|
||||||
// Create the root reports directory path of the form: <CASE DIRECTORY>/Reports/<Case fileName> <Timestamp>/
|
// Create the root reports directory path of the form: <CASE DIRECTORY>/Reports/<Case fileName> <Timestamp>/
|
||||||
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
|
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
@ -49,6 +49,7 @@ import javax.imageio.ImageIO;
|
|||||||
import org.openide.filesystems.FileUtil;
|
import org.openide.filesystems.FileUtil;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.Services;
|
import org.sleuthkit.autopsy.casemodule.services.Services;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
@ -102,8 +103,8 @@ class ReportHTML implements TableReportModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Refesh the member variables
|
// Refesh the member variables
|
||||||
private void refresh() {
|
private void refresh() throws NoCurrentCaseException {
|
||||||
currentCase = Case.getCurrentCase();
|
currentCase = Case.getOpenCase();
|
||||||
skCase = currentCase.getSleuthkitCase();
|
skCase = currentCase.getSleuthkitCase();
|
||||||
|
|
||||||
dataTypes = new TreeMap<>();
|
dataTypes = new TreeMap<>();
|
||||||
@ -327,7 +328,12 @@ class ReportHTML implements TableReportModule {
|
|||||||
@Override
|
@Override
|
||||||
public void startReport(String baseReportDir) {
|
public void startReport(String baseReportDir) {
|
||||||
// Refresh the HTML report
|
// Refresh the HTML report
|
||||||
refresh();
|
try {
|
||||||
|
refresh();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case."); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Setup the path for the HTML report
|
// Setup the path for the HTML report
|
||||||
this.path = baseReportDir; //NON-NLS
|
this.path = baseReportDir; //NON-NLS
|
||||||
this.subPath = this.path + HTML_SUBDIR + File.separator;
|
this.subPath = this.path + HTML_SUBDIR + File.separator;
|
||||||
@ -882,6 +888,13 @@ class ReportHTML implements TableReportModule {
|
|||||||
private void writeIndex() {
|
private void writeIndex() {
|
||||||
Writer indexOut = null;
|
Writer indexOut = null;
|
||||||
String indexFilePath = path + "report.html"; //NON-NLS
|
String indexFilePath = path + "report.html"; //NON-NLS
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(indexFilePath), "UTF-8")); //NON-NLS
|
indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(indexFilePath), "UTF-8")); //NON-NLS
|
||||||
StringBuilder index = new StringBuilder();
|
StringBuilder index = new StringBuilder();
|
||||||
@ -909,7 +922,7 @@ class ReportHTML implements TableReportModule {
|
|||||||
index.append("</frameset>\n"); //NON-NLS
|
index.append("</frameset>\n"); //NON-NLS
|
||||||
index.append("</html>"); //NON-NLS
|
index.append("</html>"); //NON-NLS
|
||||||
indexOut.write(index.toString());
|
indexOut.write(index.toString());
|
||||||
Case.getCurrentCase().addReport(indexFilePath, NbBundle.getMessage(this.getClass(),
|
openCase.addReport(indexFilePath, NbBundle.getMessage(this.getClass(),
|
||||||
"ReportHTML.writeIndex.srcModuleName.text"), "");
|
"ReportHTML.writeIndex.srcModuleName.text"), "");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.SEVERE, "Error creating Writer for report.html: {0}", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error creating Writer for report.html: {0}", ex); //NON-NLS
|
||||||
|
@ -43,6 +43,7 @@ import org.jdom2.output.Format;
|
|||||||
import org.jdom2.output.XMLOutputter;
|
import org.jdom2.output.XMLOutputter;
|
||||||
import org.jdom2.CDATA;
|
import org.jdom2.CDATA;
|
||||||
import org.openide.filesystems.FileUtil;
|
import org.openide.filesystems.FileUtil;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.datamodel.ReadContentInputStream.ReadContentInputStreamException;
|
import org.sleuthkit.datamodel.ReadContentInputStream.ReadContentInputStreamException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,14 +100,18 @@ class ReportKML implements GeneralReportModule {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) {
|
public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) {
|
||||||
|
try {
|
||||||
|
currentCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Start the progress bar and setup the report
|
// Start the progress bar and setup the report
|
||||||
progressPanel.setIndeterminate(true);
|
progressPanel.setIndeterminate(true);
|
||||||
progressPanel.start();
|
progressPanel.start();
|
||||||
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportKML.progress.querying"));
|
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportKML.progress.querying"));
|
||||||
String kmlFileFullPath = baseReportDir + REPORT_KML; //NON-NLS
|
String kmlFileFullPath = baseReportDir + REPORT_KML; //NON-NLS
|
||||||
|
|
||||||
currentCase = Case.getCurrentCase();
|
|
||||||
skCase = currentCase.getSleuthkitCase();
|
skCase = currentCase.getSleuthkitCase();
|
||||||
|
|
||||||
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportKML.progress.loading"));
|
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportKML.progress.loading"));
|
||||||
@ -382,7 +387,7 @@ class ReportKML implements GeneralReportModule {
|
|||||||
if (result == ReportProgressPanel.ReportStatus.ERROR) {
|
if (result == ReportProgressPanel.ReportStatus.ERROR) {
|
||||||
prependedStatus = "Incomplete ";
|
prependedStatus = "Incomplete ";
|
||||||
}
|
}
|
||||||
Case.getCurrentCase().addReport(kmlFileFullPath,
|
Case.getOpenCase().addReport(kmlFileFullPath,
|
||||||
NbBundle.getMessage(this.getClass(), "ReportKML.genReport.srcModuleName.text"),
|
NbBundle.getMessage(this.getClass(), "ReportKML.genReport.srcModuleName.text"),
|
||||||
prependedStatus + NbBundle.getMessage(this.getClass(), "ReportKML.genReport.reportName"));
|
prependedStatus + NbBundle.getMessage(this.getClass(), "ReportKML.genReport.reportName"));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@ -392,6 +397,9 @@ class ReportKML implements GeneralReportModule {
|
|||||||
String errorMessage = String.format("Error adding %s to case as a report", kmlFileFullPath); //NON-NLS
|
String errorMessage = String.format("Error adding %s to case as a report", kmlFileFullPath); //NON-NLS
|
||||||
logger.log(Level.SEVERE, errorMessage, ex);
|
logger.log(Level.SEVERE, errorMessage, ex);
|
||||||
result = ReportProgressPanel.ReportStatus.ERROR;
|
result = ReportProgressPanel.ReportStatus.ERROR;
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
result = ReportProgressPanel.ReportStatus.ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
progressPanel.complete(result);
|
progressPanel.complete(result);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2013-2014 Basis Technology Corp.
|
* Copyright 2013-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -41,6 +41,7 @@ import javax.swing.event.ListDataListener;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
@ -97,8 +98,8 @@ final class ReportVisualPanel2 extends JPanel {
|
|||||||
private void initTags() {
|
private void initTags() {
|
||||||
List<TagName> tagNamesInUse;
|
List<TagName> tagNamesInUse;
|
||||||
try {
|
try {
|
||||||
tagNamesInUse = Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse();
|
tagNamesInUse = Case.getOpenCase().getServices().getTagsManager().getTagNamesInUse();
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -136,6 +137,7 @@ final class ReportVisualPanel2 extends JPanel {
|
|||||||
private void initArtifactTypes() {
|
private void initArtifactTypes() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Case openCase = Case.getOpenCase();
|
||||||
ArrayList<BlackboardArtifact.Type> doNotReport = new ArrayList<>();
|
ArrayList<BlackboardArtifact.Type> doNotReport = new ArrayList<>();
|
||||||
doNotReport.add(new BlackboardArtifact.Type(BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getTypeID(),
|
doNotReport.add(new BlackboardArtifact.Type(BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getTypeID(),
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getLabel(),
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getLabel(),
|
||||||
@ -144,7 +146,7 @@ final class ReportVisualPanel2 extends JPanel {
|
|||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getLabel(),
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getLabel(),
|
||||||
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getDisplayName())); // output is too unstructured for table review
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getDisplayName())); // output is too unstructured for table review
|
||||||
|
|
||||||
artifacts = Case.getCurrentCase().getSleuthkitCase().getArtifactTypesInUse();
|
artifacts = openCase.getSleuthkitCase().getArtifactTypesInUse();
|
||||||
|
|
||||||
artifacts.removeAll(doNotReport);
|
artifacts.removeAll(doNotReport);
|
||||||
|
|
||||||
@ -152,7 +154,7 @@ final class ReportVisualPanel2 extends JPanel {
|
|||||||
for (BlackboardArtifact.Type type : artifacts) {
|
for (BlackboardArtifact.Type type : artifacts) {
|
||||||
artifactStates.put(type, Boolean.TRUE);
|
artifactStates.put(type, Boolean.TRUE);
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage(), ex); //NON-NLS
|
Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage(), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ import java.util.TreeSet;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -181,11 +182,11 @@ class TableReportGenerator {
|
|||||||
String accountDisplayname = accountTypeStr;
|
String accountDisplayname = accountTypeStr;
|
||||||
if (accountTypeStr != null) {
|
if (accountTypeStr != null) {
|
||||||
try {
|
try {
|
||||||
Account.Type acctType = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager().getAccountType(accountTypeStr);
|
Account.Type acctType = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager().getAccountType(accountTypeStr);
|
||||||
if (acctType != null) {
|
if (acctType != null) {
|
||||||
accountDisplayname = acctType.getDisplayName();
|
accountDisplayname = acctType.getDisplayName();
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to get display name for account type " + accountTypeStr, ex);
|
logger.log(Level.SEVERE, "Unable to get display name for account type " + accountTypeStr, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,8 +268,8 @@ class TableReportGenerator {
|
|||||||
// Get the content tags.
|
// Get the content tags.
|
||||||
List<ContentTag> tags;
|
List<ContentTag> tags;
|
||||||
try {
|
try {
|
||||||
tags = Case.getCurrentCase().getServices().getTagsManager().getAllContentTags();
|
tags = Case.getOpenCase().getServices().getTagsManager().getAllContentTags();
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags"));
|
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags"));
|
||||||
logger.log(Level.SEVERE, "failed to get content tags", ex); //NON-NLS
|
logger.log(Level.SEVERE, "failed to get content tags", ex); //NON-NLS
|
||||||
return;
|
return;
|
||||||
@ -360,8 +361,8 @@ class TableReportGenerator {
|
|||||||
|
|
||||||
List<BlackboardArtifactTag> tags;
|
List<BlackboardArtifactTag> tags;
|
||||||
try {
|
try {
|
||||||
tags = Case.getCurrentCase().getServices().getTagsManager().getAllBlackboardArtifactTags();
|
tags = Case.getOpenCase().getServices().getTagsManager().getAllBlackboardArtifactTags();
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifactTags"));
|
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifactTags"));
|
||||||
logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); //NON-NLS
|
logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); //NON-NLS
|
||||||
return;
|
return;
|
||||||
@ -452,8 +453,8 @@ class TableReportGenerator {
|
|||||||
private void checkIfTagHasImage(BlackboardArtifactTag artifactTag) {
|
private void checkIfTagHasImage(BlackboardArtifactTag artifactTag) {
|
||||||
AbstractFile file;
|
AbstractFile file;
|
||||||
try {
|
try {
|
||||||
file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID());
|
file = Case.getOpenCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID());
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
errorList.add(
|
errorList.add(
|
||||||
NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.errGetContentFromBBArtifact"));
|
NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.errGetContentFromBBArtifact"));
|
||||||
logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); //NON-NLS
|
logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); //NON-NLS
|
||||||
@ -520,6 +521,7 @@ class TableReportGenerator {
|
|||||||
* @param tableModule module to report on
|
* @param tableModule module to report on
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
@NbBundle.Messages ({"ReportGenerator.errList.noOpenCase=No open case available."})
|
||||||
private void writeKeywordHits(TableReportModule tableModule, String comment, HashSet<String> tagNamesFilter) {
|
private void writeKeywordHits(TableReportModule tableModule, String comment, HashSet<String> tagNamesFilter) {
|
||||||
|
|
||||||
// Query for keyword lists-only so that we can tell modules what lists
|
// Query for keyword lists-only so that we can tell modules what lists
|
||||||
@ -528,7 +530,15 @@ class TableReportGenerator {
|
|||||||
// so that we only report the lists that we will later provide with real
|
// so that we only report the lists that we will later provide with real
|
||||||
// hits. If no keyord hits are tagged, then we make the page for nothing.
|
// hits. If no keyord hits are tagged, then we make the page for nothing.
|
||||||
String orderByClause;
|
String orderByClause;
|
||||||
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
errorList.add(Bundle.ReportGenerator_errList_noOpenCase());
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case: ", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (openCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
||||||
orderByClause = "ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST"; //NON-NLS
|
orderByClause = "ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST"; //NON-NLS
|
||||||
} else {
|
} else {
|
||||||
orderByClause = "ORDER BY list ASC"; //NON-NLS
|
orderByClause = "ORDER BY list ASC"; //NON-NLS
|
||||||
@ -546,7 +556,7 @@ class TableReportGenerator {
|
|||||||
+ //NON-NLS
|
+ //NON-NLS
|
||||||
"GROUP BY list " + orderByClause; //NON-NLS
|
"GROUP BY list " + orderByClause; //NON-NLS
|
||||||
|
|
||||||
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCase().getSleuthkitCase().executeQuery(keywordListQuery)) {
|
try (SleuthkitCase.CaseDbQuery dbQuery = openCase.getSleuthkitCase().executeQuery(keywordListQuery)) {
|
||||||
ResultSet listsRs = dbQuery.getResultSet();
|
ResultSet listsRs = dbQuery.getResultSet();
|
||||||
List<String> lists = new ArrayList<>();
|
List<String> lists = new ArrayList<>();
|
||||||
while (listsRs.next()) {
|
while (listsRs.next()) {
|
||||||
@ -569,7 +579,7 @@ class TableReportGenerator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
if (openCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
||||||
orderByClause = "ORDER BY convert_to(att3.value_text, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
orderByClause = "ORDER BY convert_to(att3.value_text, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
||||||
+ "convert_to(att1.value_text, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
+ "convert_to(att1.value_text, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
||||||
+ "convert_to(f.parent_path, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
+ "convert_to(f.parent_path, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
||||||
@ -602,7 +612,7 @@ class TableReportGenerator {
|
|||||||
+ //NON-NLS
|
+ //NON-NLS
|
||||||
orderByClause; //NON-NLS
|
orderByClause; //NON-NLS
|
||||||
|
|
||||||
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCase().getSleuthkitCase().executeQuery(keywordsQuery)) {
|
try (SleuthkitCase.CaseDbQuery dbQuery = openCase.getSleuthkitCase().executeQuery(keywordsQuery)) {
|
||||||
ResultSet resultSet = dbQuery.getResultSet();
|
ResultSet resultSet = dbQuery.getResultSet();
|
||||||
|
|
||||||
String currentKeyword = "";
|
String currentKeyword = "";
|
||||||
@ -627,9 +637,9 @@ class TableReportGenerator {
|
|||||||
String uniquePath = "";
|
String uniquePath = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
AbstractFile f = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(objId);
|
AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId);
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
uniquePath = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(objId).getUniquePath();
|
uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath();
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
errorList.add(
|
errorList.add(
|
||||||
@ -685,7 +695,15 @@ class TableReportGenerator {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void writeHashsetHits(TableReportModule tableModule, String comment, HashSet<String> tagNamesFilter) {
|
private void writeHashsetHits(TableReportModule tableModule, String comment, HashSet<String> tagNamesFilter) {
|
||||||
String orderByClause;
|
String orderByClause;
|
||||||
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
errorList.add(Bundle.ReportGenerator_errList_noOpenCase());
|
||||||
|
logger.log(Level.SEVERE, "Exception while getting open case: ", ex); //NON-NLS
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (openCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
||||||
orderByClause = "ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST"; //NON-NLS
|
orderByClause = "ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST"; //NON-NLS
|
||||||
} else {
|
} else {
|
||||||
orderByClause = "ORDER BY att.value_text ASC"; //NON-NLS
|
orderByClause = "ORDER BY att.value_text ASC"; //NON-NLS
|
||||||
@ -703,7 +721,7 @@ class TableReportGenerator {
|
|||||||
+ //NON-NLS
|
+ //NON-NLS
|
||||||
"GROUP BY list " + orderByClause; //NON-NLS
|
"GROUP BY list " + orderByClause; //NON-NLS
|
||||||
|
|
||||||
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCase().getSleuthkitCase().executeQuery(hashsetsQuery)) {
|
try (SleuthkitCase.CaseDbQuery dbQuery = openCase.getSleuthkitCase().executeQuery(hashsetsQuery)) {
|
||||||
// Query for hashsets
|
// Query for hashsets
|
||||||
ResultSet listsRs = dbQuery.getResultSet();
|
ResultSet listsRs = dbQuery.getResultSet();
|
||||||
List<String> lists = new ArrayList<>();
|
List<String> lists = new ArrayList<>();
|
||||||
@ -722,7 +740,7 @@ class TableReportGenerator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
if (openCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
||||||
orderByClause = "ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
orderByClause = "ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
||||||
+ "convert_to(f.parent_path, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
+ "convert_to(f.parent_path, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
||||||
+ "convert_to(f.name, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
+ "convert_to(f.name, 'SQL_ASCII') ASC NULLS FIRST, " //NON-NLS
|
||||||
@ -745,7 +763,7 @@ class TableReportGenerator {
|
|||||||
+ //NON-NLS
|
+ //NON-NLS
|
||||||
orderByClause; //NON-NLS
|
orderByClause; //NON-NLS
|
||||||
|
|
||||||
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCase().getSleuthkitCase().executeQuery(hashsetHitsQuery)) {
|
try (SleuthkitCase.CaseDbQuery dbQuery = openCase.getSleuthkitCase().executeQuery(hashsetHitsQuery)) {
|
||||||
// Query for hashset hits
|
// Query for hashset hits
|
||||||
ResultSet resultSet = dbQuery.getResultSet();
|
ResultSet resultSet = dbQuery.getResultSet();
|
||||||
String currentSet = "";
|
String currentSet = "";
|
||||||
@ -768,9 +786,9 @@ class TableReportGenerator {
|
|||||||
String uniquePath = "";
|
String uniquePath = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
AbstractFile f = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(objId);
|
AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId);
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
uniquePath = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(objId).getUniquePath();
|
uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath();
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
errorList.add(
|
errorList.add(
|
||||||
@ -834,9 +852,9 @@ class TableReportGenerator {
|
|||||||
this.attributes = attrs;
|
this.attributes = attrs;
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
try {
|
try {
|
||||||
this.content = Case.getCurrentCase().getSleuthkitCase().getContentById(artifact.getObjectID());
|
this.content = Case.getOpenCase().getSleuthkitCase().getContentById(artifact.getObjectID());
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Could not get content from database");
|
logger.log(Level.SEVERE, "Could not get content from database", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -972,12 +990,12 @@ class TableReportGenerator {
|
|||||||
|
|
||||||
HashSet<String> allTags = getTags();
|
HashSet<String> allTags = getTags();
|
||||||
try {
|
try {
|
||||||
List<ContentTag> contentTags = Case.getCurrentCase().getServices().getTagsManager().getContentTagsByContent(content);
|
List<ContentTag> contentTags = Case.getOpenCase().getServices().getTagsManager().getContentTagsByContent(content);
|
||||||
for (ContentTag ct : contentTags) {
|
for (ContentTag ct : contentTags) {
|
||||||
String notableString = ct.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
String notableString = ct.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
allTags.add(ct.getName().getDisplayName() + notableString);
|
allTags.add(ct.getName().getDisplayName() + notableString);
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags"));
|
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags"));
|
||||||
logger.log(Level.SEVERE, "Failed to get content tags", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to get content tags", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
@ -1008,8 +1026,8 @@ class TableReportGenerator {
|
|||||||
private List<ArtifactData> getFilteredArtifacts(BlackboardArtifact.Type type, HashSet<String> tagNamesFilter) {
|
private List<ArtifactData> getFilteredArtifacts(BlackboardArtifact.Type type, HashSet<String> tagNamesFilter) {
|
||||||
List<ArtifactData> artifacts = new ArrayList<>();
|
List<ArtifactData> artifacts = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
for (BlackboardArtifact artifact : Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) {
|
for (BlackboardArtifact artifact : Case.getOpenCase().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) {
|
||||||
List<BlackboardArtifactTag> tags = Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact);
|
List<BlackboardArtifactTag> tags = Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact);
|
||||||
HashSet<String> uniqueTagNames = new HashSet<>();
|
HashSet<String> uniqueTagNames = new HashSet<>();
|
||||||
for (BlackboardArtifactTag tag : tags) {
|
for (BlackboardArtifactTag tag : tags) {
|
||||||
String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : "";
|
||||||
@ -1019,13 +1037,13 @@ class TableReportGenerator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
artifacts.add(new ArtifactData(artifact, Case.getCurrentCase().getSleuthkitCase().getBlackboardAttributes(artifact), uniqueTagNames));
|
artifacts.add(new ArtifactData(artifact, Case.getOpenCase().getSleuthkitCase().getBlackboardAttributes(artifact), uniqueTagNames));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBAttribs"));
|
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBAttribs"));
|
||||||
logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifacts"));
|
errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifacts"));
|
||||||
logger.log(Level.SEVERE, "Failed to get Blackboard Artifacts when generating report.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to get Blackboard Artifacts when generating report.", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
@ -1609,12 +1627,12 @@ class TableReportGenerator {
|
|||||||
+ //NON-NLS
|
+ //NON-NLS
|
||||||
"WHERE tn.tag_name_id = bat.tag_name_id AND bat.artifact_id = " + artifactId; //NON-NLS
|
"WHERE tn.tag_name_id = bat.tag_name_id AND bat.artifact_id = " + artifactId; //NON-NLS
|
||||||
|
|
||||||
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCase().getSleuthkitCase().executeQuery(query)) {
|
try (SleuthkitCase.CaseDbQuery dbQuery = Case.getOpenCase().getSleuthkitCase().executeQuery(query)) {
|
||||||
ResultSet tagNameRows = dbQuery.getResultSet();
|
ResultSet tagNameRows = dbQuery.getResultSet();
|
||||||
while (tagNameRows.next()) {
|
while (tagNameRows.next()) {
|
||||||
uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS
|
uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS
|
||||||
}
|
}
|
||||||
} catch (TskCoreException | SQLException ex) {
|
} catch (TskCoreException | SQLException | NoCurrentCaseException ex) {
|
||||||
throw new TskCoreException("Error getting tag names for artifact: ", ex);
|
throw new TskCoreException("Error getting tag names for artifact: ", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import javax.swing.JPanel;
|
|||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||||
import org.sleuthkit.autopsy.report.GeneralReportModule;
|
import org.sleuthkit.autopsy.report.GeneralReportModule;
|
||||||
@ -66,6 +67,14 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateReport(String reportPath, ReportProgressPanel progressPanel) {
|
public void generateReport(String reportPath, ReportProgressPanel progressPanel) {
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "No open Case", "Exception while getting open case.", JOptionPane.ERROR_MESSAGE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
progressPanel.setIndeterminate(true);
|
progressPanel.setIndeterminate(true);
|
||||||
progressPanel.start();
|
progressPanel.start();
|
||||||
progressPanel.updateStatusLabel("Adding hashes...");
|
progressPanel.updateStatusLabel("Adding hashes...");
|
||||||
@ -74,7 +83,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
if (hashSet != null) {
|
if (hashSet != null) {
|
||||||
progressPanel.updateStatusLabel("Adding hashes to " + hashSet.getHashSetName() + " hash set...");
|
progressPanel.updateStatusLabel("Adding hashes to " + hashSet.getHashSetName() + " hash set...");
|
||||||
|
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
TagsManager tagsManager = openCase.getServices().getTagsManager();
|
||||||
List<TagName> tagNames = configPanel.getSelectedTagNames();
|
List<TagName> tagNames = configPanel.getSelectedTagNames();
|
||||||
ArrayList<String> failedExports = new ArrayList<>();
|
ArrayList<String> failedExports = new ArrayList<>();
|
||||||
for (TagName tagName : tagNames) {
|
for (TagName tagName : tagNames) {
|
||||||
@ -91,7 +100,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
if (content instanceof AbstractFile) {
|
if (content instanceof AbstractFile) {
|
||||||
if (null != ((AbstractFile) content).getMd5Hash()) {
|
if (null != ((AbstractFile) content).getMd5Hash()) {
|
||||||
try {
|
try {
|
||||||
hashSet.addHashes(tag.getContent(), Case.getCurrentCase().getDisplayName());
|
hashSet.addHashes(tag.getContent(), openCase.getDisplayName());
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Error adding hash for obj_id = " + tag.getContent().getId() + " to hash set " + hashSet.getHashSetName(), ex);
|
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Error adding hash for obj_id = " + tag.getContent().getId() + " to hash set " + hashSet.getHashSetName(), ex);
|
||||||
failedExports.add(tag.getContent().getName());
|
failedExports.add(tag.getContent().getName());
|
||||||
|
@ -34,6 +34,7 @@ import javax.swing.ListCellRenderer;
|
|||||||
import javax.swing.ListModel;
|
import javax.swing.ListModel;
|
||||||
import javax.swing.event.ListDataListener;
|
import javax.swing.event.ListDataListener;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager;
|
||||||
@ -67,10 +68,13 @@ class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
|
|||||||
private void populateTagNameComponents() {
|
private void populateTagNameComponents() {
|
||||||
// Get the tag names in use for the current case.
|
// Get the tag names in use for the current case.
|
||||||
try {
|
try {
|
||||||
tagNames = Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse();
|
tagNames = Case.getOpenCase().getServices().getTagsManager().getTagNamesInUse();
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
||||||
JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE);
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
|
JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Exception while getting open case.", JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark the tag names as unselected. Note that tagNameSelections is a
|
// Mark the tag names as unselected. Note that tagNameSelections is a
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
import javax.xml.bind.DatatypeConverter;
|
||||||
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.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -63,8 +64,8 @@ final class CustomArtifactType {
|
|||||||
*
|
*
|
||||||
* @throws BlackboardException If there is an error adding any of the types.
|
* @throws BlackboardException If there is an error adding any of the types.
|
||||||
*/
|
*/
|
||||||
static void addToCaseDatabase() throws Blackboard.BlackboardException {
|
static void addToCaseDatabase() throws Blackboard.BlackboardException, NoCurrentCaseException {
|
||||||
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard();
|
||||||
artifactType = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAME, ARTIFACT_DISPLAY_NAME);
|
artifactType = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAME, ARTIFACT_DISPLAY_NAME);
|
||||||
intAttrType = blackboard.getOrAddAttributeType(INT_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER, INT_ATTR_DISPLAY_NAME);
|
intAttrType = blackboard.getOrAddAttributeType(INT_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER, INT_ATTR_DISPLAY_NAME);
|
||||||
doubleAttrType = blackboard.getOrAddAttributeType(DOUBLE_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE, DOUBLE_ATTR_DISPLAY_NAME);
|
doubleAttrType = blackboard.getOrAddAttributeType(DOUBLE_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE, DOUBLE_ATTR_DISPLAY_NAME);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.test;
|
|||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleAdapter;
|
import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleAdapter;
|
||||||
@ -53,7 +54,7 @@ public class CustomArtifactsCreatorDataSourceIngestModule extends DataSourceInge
|
|||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
try {
|
try {
|
||||||
CustomArtifactType.addToCaseDatabase();
|
CustomArtifactType.addToCaseDatabase();
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException | NoCurrentCaseException ex) {
|
||||||
throw new IngestModuleException(Bundle.CustomArtifactsCreatorDataSourceIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
|
throw new IngestModuleException(Bundle.CustomArtifactsCreatorDataSourceIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.test;
|
|||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.FileIngestModuleAdapter;
|
import org.sleuthkit.autopsy.ingest.FileIngestModuleAdapter;
|
||||||
@ -52,7 +53,7 @@ final class CustomArtifactsCreatorFileIngestModule extends FileIngestModuleAdapt
|
|||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
try {
|
try {
|
||||||
CustomArtifactType.addToCaseDatabase();
|
CustomArtifactType.addToCaseDatabase();
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException | NoCurrentCaseException ex) {
|
||||||
throw new IngestModuleException(Bundle.CustomArtifactsCreatorFileIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
|
throw new IngestModuleException(Bundle.CustomArtifactsCreatorFileIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -25,6 +25,7 @@ import java.util.logging.Level;
|
|||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
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.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.FileIngestModuleAdapter;
|
import org.sleuthkit.autopsy.ingest.FileIngestModuleAdapter;
|
||||||
@ -53,10 +54,10 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
|
||||||
try {
|
try {
|
||||||
|
Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard();
|
||||||
artifactType = blackboard.getOrAddArtifactType(INT_ARTIFACT_TYPE_NAME, INT_ARTIFACT_DISPLAY_NAME);
|
artifactType = blackboard.getOrAddArtifactType(INT_ARTIFACT_TYPE_NAME, INT_ARTIFACT_DISPLAY_NAME);
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException | NoCurrentCaseException ex) {
|
||||||
throw new IngestModuleException(Bundle.InterestingArtifactCreatorIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
|
throw new IngestModuleException(Bundle.InterestingArtifactCreatorIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +77,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt
|
|||||||
* type.
|
* type.
|
||||||
*/
|
*/
|
||||||
int randomArtIndex = (int) (Math.random() * 3);
|
int randomArtIndex = (int) (Math.random() * 3);
|
||||||
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard();
|
||||||
BlackboardArtifact.Type artifactTypeBase = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAMES[randomArtIndex], ARTIFACT_DISPLAY_NAMES[randomArtIndex]);
|
BlackboardArtifact.Type artifactTypeBase = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAMES[randomArtIndex], ARTIFACT_DISPLAY_NAMES[randomArtIndex]);
|
||||||
BlackboardArtifact artifactBase = file.newArtifact(artifactTypeBase.getTypeID());
|
BlackboardArtifact artifactBase = file.newArtifact(artifactTypeBase.getTypeID());
|
||||||
Collection<BlackboardAttribute> baseAttributes = new ArrayList<>();
|
Collection<BlackboardAttribute> baseAttributes = new ArrayList<>();
|
||||||
@ -123,7 +124,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt
|
|||||||
attributes.add(att3);
|
attributes.add(att3);
|
||||||
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT, MODULE_NAME, artifactBase.getArtifactID()));
|
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT, MODULE_NAME, artifactBase.getArtifactID()));
|
||||||
artifact.addAttributes(attributes);
|
artifact.addAttributes(attributes);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, String.format("Failed to process file (obj_id = %d)", file.getId()), ex);
|
logger.log(Level.SEVERE, String.format("Failed to process file (obj_id = %d)", file.getId()), ex);
|
||||||
return ProcessResult.ERROR;
|
return ProcessResult.ERROR;
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2014-2017 Basis Technology Corp.
|
* Copyright 2014-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -33,6 +33,7 @@ import org.openide.util.HelpCtx;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.actions.CallableSystemAction;
|
import org.openide.util.actions.CallableSystemAction;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.core.Installer;
|
import org.sleuthkit.autopsy.core.Installer;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -80,7 +81,7 @@ public final class OpenTimelineAction extends CallableSystemAction {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
/**
|
/**
|
||||||
* We used to also check if Case.getCurrentCase().hasData() was true. We
|
* We used to also check if Case.getOpenCase().hasData() was true. We
|
||||||
* disabled that check because if it is executed while a data source is
|
* disabled that check because if it is executed while a data source is
|
||||||
* being added, it blocks the edt. We still do that in ImageGallery.
|
* being added, it blocks the edt. We still do that in ImageGallery.
|
||||||
*/
|
*/
|
||||||
@ -111,7 +112,7 @@ public final class OpenTimelineAction extends CallableSystemAction {
|
|||||||
"OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."})
|
"OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."})
|
||||||
synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) {
|
synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) {
|
||||||
try {
|
try {
|
||||||
Case currentCase = Case.getCurrentCase();
|
Case currentCase = Case.getOpenCase();
|
||||||
if (currentCase.hasData() == false) {
|
if (currentCase.hasData() == false) {
|
||||||
MessageNotifyUtil.Message.info(Bundle.OpenTimeLineAction_msgdlg_text());
|
MessageNotifyUtil.Message.info(Bundle.OpenTimeLineAction_msgdlg_text());
|
||||||
logger.log(Level.INFO, "Could not create timeline, there are no data sources.");// NON-NLS
|
logger.log(Level.INFO, "Could not create timeline, there are no data sources.");// NON-NLS
|
||||||
@ -131,7 +132,7 @@ public final class OpenTimelineAction extends CallableSystemAction {
|
|||||||
MessageNotifyUtil.Message.error(Bundle.OpenTimelineAction_settingsErrorMessage());
|
MessageNotifyUtil.Message.error(Bundle.OpenTimelineAction_settingsErrorMessage());
|
||||||
logger.log(Level.SEVERE, "Failed to initialize per case timeline settings.", iOException);
|
logger.log(Level.SEVERE, "Failed to initialize per case timeline settings.", iOException);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException e) {
|
} catch (NoCurrentCaseException e) {
|
||||||
//there is no case... Do nothing.
|
//there is no case... Do nothing.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,8 +213,8 @@ public final class OpenTimelineAction extends CallableSystemAction {
|
|||||||
|
|
||||||
private boolean tooManyFiles() {
|
private boolean tooManyFiles() {
|
||||||
try {
|
try {
|
||||||
return FILE_LIMIT < Case.getCurrentCase().getSleuthkitCase().countFilesWhere("1 = 1");
|
return FILE_LIMIT < Case.getOpenCase().getSleuthkitCase().countFilesWhere("1 = 1");
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Can not open timeline with no case open.", ex);
|
logger.log(Level.SEVERE, "Can not open timeline with no case open.", ex);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error counting files in the DB.", ex);
|
logger.log(Level.SEVERE, "Error counting files in the DB.", ex);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2014-2016 Basis Technology Corp.
|
* Copyright 2014-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -67,6 +67,7 @@ import org.openide.util.NbBundle;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import static org.sleuthkit.autopsy.casemodule.Case.Events.CURRENT_CASE;
|
import static org.sleuthkit.autopsy.casemodule.Case.Events.CURRENT_CASE;
|
||||||
import static org.sleuthkit.autopsy.casemodule.Case.Events.DATA_SOURCE_ADDED;
|
import static org.sleuthkit.autopsy.casemodule.Case.Events.DATA_SOURCE_ADDED;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent;
|
||||||
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent;
|
||||||
@ -949,8 +950,8 @@ public class TimeLineController {
|
|||||||
* already closed.
|
* already closed.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase();
|
Case.getOpenCase();
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (NoCurrentCaseException notUsed) {
|
||||||
// Case is closed, do nothing.
|
// Case is closed, do nothing.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -51,6 +51,7 @@ import org.openide.windows.RetainLocation;
|
|||||||
import org.openide.windows.TopComponent;
|
import org.openide.windows.TopComponent;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.actions.AddBookmarkTagAction;
|
import org.sleuthkit.autopsy.actions.AddBookmarkTagAction;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataContentPanel;
|
import org.sleuthkit.autopsy.corecomponents.DataContentPanel;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
|
import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
|
||||||
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
|
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
|
||||||
@ -132,7 +133,7 @@ public final class TimeLineTopComponent extends TopComponent implements Explorer
|
|||||||
contentViewerPanel.setNode(null);
|
contentViewerPanel.setNode(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
|
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
|
||||||
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); // NON-NLS
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
|
@ -47,6 +47,7 @@ import org.controlsfx.validation.Validator;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.FileUtil;
|
import org.sleuthkit.autopsy.coreutils.FileUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.timeline.PromptDialogManager;
|
import org.sleuthkit.autopsy.timeline.PromptDialogManager;
|
||||||
@ -152,12 +153,12 @@ public class SaveSnapshotAsReport extends Action {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
//add main file as report to case
|
//add main file as report to case
|
||||||
Case.getCurrentCase().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName);
|
Case.getOpenCase().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.WARNING, "Failed to add " + reportMainFilePath.toString() + " to case as a report", ex); //NON_NLS
|
LOGGER.log(Level.WARNING, "Failed to add " + reportMainFilePath.toString() + " to case as a report", ex); //NON_NLS
|
||||||
new Alert(Alert.AlertType.ERROR, Bundle.SaveSnapShotAsReport_FailedToAddReport()).show();
|
new Alert(Alert.AlertType.ERROR, Bundle.SaveSnapShotAsReport_FailedToAddReport()).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//notify user of report location
|
//notify user of report location
|
||||||
final Alert alert = new Alert(Alert.AlertType.INFORMATION, null, OPEN, OK);
|
final Alert alert = new Alert(Alert.AlertType.INFORMATION, null, OPEN, OK);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -33,6 +33,7 @@ import org.openide.nodes.Sheet;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
import org.sleuthkit.autopsy.datamodel.DataModelActionsFactory;
|
import org.sleuthkit.autopsy.datamodel.DataModelActionsFactory;
|
||||||
@ -215,14 +216,14 @@ public class EventNode extends DisplayableItemNode {
|
|||||||
* @return An EventNode with the file (and artifact) backing this event in
|
* @return An EventNode with the file (and artifact) backing this event in
|
||||||
* its lookup.
|
* its lookup.
|
||||||
*/
|
*/
|
||||||
public static EventNode createEventNode(final Long eventID, FilteredEventsModel eventsModel) throws TskCoreException, IllegalStateException {
|
public static EventNode createEventNode(final Long eventID, FilteredEventsModel eventsModel) throws TskCoreException, NoCurrentCaseException {
|
||||||
/*
|
/*
|
||||||
* Look up the event by id and creata an EventNode with the appropriate
|
* Look up the event by id and creata an EventNode with the appropriate
|
||||||
* data in the lookup.
|
* data in the lookup.
|
||||||
*/
|
*/
|
||||||
final SingleEvent eventById = eventsModel.getEventById(eventID);
|
final SingleEvent eventById = eventsModel.getEventById(eventID);
|
||||||
|
|
||||||
SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase sleuthkitCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
AbstractFile file = sleuthkitCase.getAbstractFileById(eventById.getFileID());
|
AbstractFile file = sleuthkitCase.getAbstractFileById(eventById.getFileID());
|
||||||
|
|
||||||
if (eventById.getArtifactID().isPresent()) {
|
if (eventById.getArtifactID().isPresent()) {
|
||||||
|
@ -29,6 +29,7 @@ import org.openide.nodes.Children;
|
|||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
|
import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
|
||||||
import org.sleuthkit.autopsy.datamodel.DisplayableItemNodeVisitor;
|
import org.sleuthkit.autopsy.datamodel.DisplayableItemNodeVisitor;
|
||||||
@ -130,7 +131,7 @@ public class EventRootNode extends DisplayableItemNode {
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
return EventNode.createEventNode(eventID, filteredEvents);
|
return EventNode.createEventNode(eventID, filteredEvents);
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
|
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
|
||||||
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); // NON-NLS
|
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); // NON-NLS
|
||||||
return null;
|
return null;
|
||||||
|
@ -78,6 +78,7 @@ import org.controlsfx.control.action.ActionUtils;
|
|||||||
import org.openide.awt.Actions;
|
import org.openide.awt.Actions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.actions.Presenter;
|
import org.openide.util.actions.Presenter;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||||
@ -668,7 +669,7 @@ class ListTimeline extends BorderPane {
|
|||||||
//show new context menu.
|
//show new context menu.
|
||||||
new ContextMenu(menuItems.toArray(new MenuItem[menuItems.size()]))
|
new ContextMenu(menuItems.toArray(new MenuItem[menuItems.size()]))
|
||||||
.show(this, contextMenuEvent.getScreenX(), contextMenuEvent.getScreenY());
|
.show(this, contextMenuEvent.getScreenX(), contextMenuEvent.getScreenY());
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
|
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
|
||||||
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); //NON-NLS
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
|
@ -41,6 +41,7 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
|||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
import static junit.framework.Assert.assertFalse;
|
import static junit.framework.Assert.assertFalse;
|
||||||
import static junit.framework.Assert.assertTrue;
|
import static junit.framework.Assert.assertTrue;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -2343,9 +2344,9 @@ public class CentralRepoDatamodelTest extends TestCase {
|
|||||||
// Test creating a case from an Autopsy case
|
// Test creating a case from an Autopsy case
|
||||||
// The case may already be in the database - the result is the same either way
|
// The case may already be in the database - the result is the same either way
|
||||||
try {
|
try {
|
||||||
caseB = EamDb.getInstance().newCase(Case.getCurrentCase());
|
caseB = EamDb.getInstance().newCase(Case.getOpenCase());
|
||||||
assertTrue("Failed to create correlation case from Autopsy case", caseB != null);
|
assertTrue("Failed to create correlation case from Autopsy case", caseB != null);
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException | NoCurrentCaseException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
Exceptions.printStackTrace(ex);
|
||||||
Assert.fail(ex);
|
Assert.fail(ex);
|
||||||
return;
|
return;
|
||||||
@ -2412,9 +2413,9 @@ public class CentralRepoDatamodelTest extends TestCase {
|
|||||||
|
|
||||||
// Test getting a case from an Autopsy case
|
// Test getting a case from an Autopsy case
|
||||||
try {
|
try {
|
||||||
CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentCase());
|
CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getOpenCase());
|
||||||
assertTrue("getCase returned null for current Autopsy case", tempCase != null);
|
assertTrue("getCase returned null for current Autopsy case", tempCase != null);
|
||||||
} catch (EamDbException ex) {
|
} catch (EamDbException | NoCurrentCaseException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
Exceptions.printStackTrace(ex);
|
||||||
Assert.fail(ex);
|
Assert.fail(ex);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2016 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -25,6 +25,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
@ -57,9 +58,9 @@ class ArtifactTextExtractor implements TextExtractor<BlackboardArtifact> {
|
|||||||
|
|
||||||
Case currentCase;
|
Case currentCase;
|
||||||
try {
|
try {
|
||||||
currentCase = Case.getCurrentCase();
|
currentCase = Case.getOpenCase();
|
||||||
} catch (IllegalStateException ignore) {
|
} catch (NoCurrentCaseException ignore) {
|
||||||
// thorown by Case.getCurrentCase() if currentCase is null
|
// thorown by Case.getOpenCase() if currentCase is null
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ import org.openide.util.Lookup;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.keywordsearch.KeywordSearchResultFactory.AdHocQueryResult;
|
import org.sleuthkit.autopsy.keywordsearch.KeywordSearchResultFactory.AdHocQueryResult;
|
||||||
@ -176,7 +177,7 @@ public class ExtractedContentViewer implements DataContentViewer {
|
|||||||
if (rawArtifactText != null) {
|
if (rawArtifactText != null) {
|
||||||
sources.add(rawArtifactText);
|
sources.add(rawArtifactText);
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Error creating RawText for " + file, ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error creating RawText for " + file, ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +207,7 @@ public class ExtractedContentViewer implements DataContentViewer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static private IndexedText getRawArtifactText(BlackboardArtifact artifact) throws TskCoreException {
|
static private IndexedText getRawArtifactText(BlackboardArtifact artifact) throws TskCoreException, NoCurrentCaseException {
|
||||||
IndexedText rawArtifactText = null;
|
IndexedText rawArtifactText = null;
|
||||||
if (null != artifact) {
|
if (null != artifact) {
|
||||||
/*
|
/*
|
||||||
@ -219,7 +220,7 @@ public class ExtractedContentViewer implements DataContentViewer {
|
|||||||
BlackboardAttribute attribute = artifact.getAttribute(TSK_ASSOCIATED_ARTIFACT_TYPE);
|
BlackboardAttribute attribute = artifact.getAttribute(TSK_ASSOCIATED_ARTIFACT_TYPE);
|
||||||
if (attribute != null) {
|
if (attribute != null) {
|
||||||
long artifactId = attribute.getValueLong();
|
long artifactId = attribute.getValueLong();
|
||||||
BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(artifactId);
|
BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(artifactId);
|
||||||
rawArtifactText = new RawText(associatedArtifact, associatedArtifact.getArtifactID());
|
rawArtifactText = new RawText(associatedArtifact, associatedArtifact.getArtifactID());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -24,6 +24,7 @@ import java.util.Comparator;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
@ -116,7 +117,12 @@ class KeywordHit implements Comparable<KeywordHit> {
|
|||||||
long getContentID() throws TskCoreException {
|
long getContentID() throws TskCoreException {
|
||||||
if (isArtifactHit()) {
|
if (isArtifactHit()) {
|
||||||
// If the hit was in an artifact, look up the source content for the artifact.
|
// If the hit was in an artifact, look up the source content for the artifact.
|
||||||
SleuthkitCase caseDb = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase caseDb;
|
||||||
|
try {
|
||||||
|
caseDb = Case.getOpenCase().getSleuthkitCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
throw new TskCoreException("Exception while getting open case.", ex);
|
||||||
|
}
|
||||||
try (SleuthkitCase.CaseDbQuery executeQuery =
|
try (SleuthkitCase.CaseDbQuery executeQuery =
|
||||||
caseDb.executeQuery(GET_CONTENT_ID_FROM_ARTIFACT_ID + this.solrObjectId);
|
caseDb.executeQuery(GET_CONTENT_ID_FROM_ARTIFACT_ID + this.solrObjectId);
|
||||||
ResultSet resultSet = executeQuery.getResultSet();) {
|
ResultSet resultSet = executeQuery.getResultSet();) {
|
||||||
|
@ -27,6 +27,7 @@ import java.util.logging.Level;
|
|||||||
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.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -144,7 +145,8 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
@Messages({
|
@Messages({
|
||||||
"KeywordSearchIngestModule.startupMessage.failedToGetIndexSchema=Failed to get schema version for text index.",
|
"KeywordSearchIngestModule.startupMessage.failedToGetIndexSchema=Failed to get schema version for text index.",
|
||||||
"# {0} - Solr version number", "KeywordSearchIngestModule.startupException.indexSolrVersionNotSupported=Adding text no longer supported for Solr version {0} of the text index.",
|
"# {0} - Solr version number", "KeywordSearchIngestModule.startupException.indexSolrVersionNotSupported=Adding text no longer supported for Solr version {0} of the text index.",
|
||||||
"# {0} - schema version number", "KeywordSearchIngestModule.startupException.indexSchemaNotSupported=Adding text no longer supported for schema version {0} of the text index."
|
"# {0} - schema version number", "KeywordSearchIngestModule.startupException.indexSchemaNotSupported=Adding text no longer supported for schema version {0} of the text index.",
|
||||||
|
"KeywordSearchIngestModule.noOpenCase.errMsg=No open case available."
|
||||||
})
|
})
|
||||||
@Override
|
@Override
|
||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
@ -180,11 +182,17 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
|
|
||||||
// increment the module reference count
|
// increment the module reference count
|
||||||
// if first instance of this module for this job then check the server and existence of keywords
|
// if first instance of this module for this job then check the server and existence of keywords
|
||||||
|
Case openCase;
|
||||||
|
try {
|
||||||
|
openCase = Case.getOpenCase();
|
||||||
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
throw new IngestModuleException(Bundle.KeywordSearchIngestModule_noOpenCase_errMsg(), ex);
|
||||||
|
}
|
||||||
if (refCounter.incrementAndGet(jobId) == 1) {
|
if (refCounter.incrementAndGet(jobId) == 1) {
|
||||||
if (Case.getCurrentCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
if (openCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
|
||||||
// for multi-user cases need to verify connection to remore SOLR server
|
// for multi-user cases need to verify connection to remore SOLR server
|
||||||
KeywordSearchService kwsService = new SolrSearchService();
|
KeywordSearchService kwsService = new SolrSearchService();
|
||||||
Server.IndexingServerProperties properties = Server.getMultiUserServerProperties(Case.getCurrentCase().getCaseDirectory());
|
Server.IndexingServerProperties properties = Server.getMultiUserServerProperties(openCase.getCaseDirectory());
|
||||||
int port;
|
int port;
|
||||||
try {
|
try {
|
||||||
port = Integer.parseInt(properties.getPort());
|
port = Integer.parseInt(properties.getPort());
|
||||||
|
@ -39,6 +39,7 @@ import org.openide.nodes.Node;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.Lookups;
|
import org.openide.util.lookup.Lookups;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
import org.sleuthkit.autopsy.datamodel.AbstractAbstractFileNode;
|
import org.sleuthkit.autopsy.datamodel.AbstractAbstractFileNode;
|
||||||
@ -147,8 +148,8 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValue> {
|
|||||||
}
|
}
|
||||||
SleuthkitCase tskCase;
|
SleuthkitCase tskCase;
|
||||||
try {
|
try {
|
||||||
tskCase = Case.getCurrentCase().getSleuthkitCase();
|
tskCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
} catch (IllegalStateException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "There was no case open.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "There was no case open.", ex); //NON-NLS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -32,6 +32,7 @@ import org.netbeans.api.progress.ProgressHandle;
|
|||||||
import org.netbeans.api.progress.aggregate.ProgressContributor;
|
import org.netbeans.api.progress.aggregate.ProgressContributor;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
@ -212,9 +213,9 @@ class QueryResults {
|
|||||||
*/
|
*/
|
||||||
Content content = null;
|
Content content = null;
|
||||||
try {
|
try {
|
||||||
SleuthkitCase tskCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase tskCase = Case.getOpenCase().getSleuthkitCase();
|
||||||
content = tskCase.getContentById(hit.getContentID());
|
content = tskCase.getContentById(hit.getContentID());
|
||||||
} catch (TskCoreException | IllegalStateException tskCoreException) {
|
} catch (TskCoreException | NoCurrentCaseException tskCoreException) {
|
||||||
logger.log(Level.SEVERE, "Failed to get text source object for ", tskCoreException); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to get text source object for ", tskCoreException); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -39,6 +39,7 @@ import org.apache.solr.common.params.CursorMarkParams;
|
|||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
import org.sleuthkit.autopsy.datamodel.CreditCards;
|
import org.sleuthkit.autopsy.datamodel.CreditCards;
|
||||||
@ -590,11 +591,11 @@ final class RegexQuery implements KeywordSearchQuery {
|
|||||||
* Create an account instance.
|
* Create an account instance.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
AccountFileInstance ccAccountInstance = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString() , MODULE_NAME, content);
|
AccountFileInstance ccAccountInstance = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString() , MODULE_NAME, content);
|
||||||
|
|
||||||
ccAccountInstance.addAttributes(attributes);
|
ccAccountInstance.addAttributes(attributes);
|
||||||
|
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -34,6 +34,7 @@ import org.apache.solr.client.solrj.SolrQuery;
|
|||||||
import org.apache.solr.client.solrj.response.TermsResponse.Term;
|
import org.apache.solr.client.solrj.response.TermsResponse.Term;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.Version;
|
import org.sleuthkit.autopsy.coreutils.Version;
|
||||||
import org.sleuthkit.autopsy.datamodel.CreditCards;
|
import org.sleuthkit.autopsy.datamodel.CreditCards;
|
||||||
@ -494,10 +495,9 @@ final class TermsComponentQuery implements KeywordSearchQuery {
|
|||||||
* Create an account.
|
* Create an account.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
AccountFileInstance ccAccountInstance = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content);
|
AccountFileInstance ccAccountInstance = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content);
|
||||||
ccAccountInstance.addAttributes(attributes);
|
ccAccountInstance.addAttributes(attributes);
|
||||||
//newArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(ccAccountInstance.getArtifactId());
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
} catch (TskCoreException ex) {
|
|
||||||
LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,8 @@
|
|||||||
<!-- Disabled. Could enforce in future, but not top priority right now.
|
<!-- Disabled. Could enforce in future, but not top priority right now.
|
||||||
<rule ref="rulesets/java/design.xml/UseLocaleWithCaseConversions"/> -->
|
<rule ref="rulesets/java/design.xml/UseLocaleWithCaseConversions"/> -->
|
||||||
<rule ref="rulesets/java/design.xml/AvoidProtectedFieldInFinalClass"/>
|
<rule ref="rulesets/java/design.xml/AvoidProtectedFieldInFinalClass"/>
|
||||||
<rule ref="rulesets/java/design.xml/AvoidSynchronizedAtMethodLevel"/>
|
<!-- Disabled. Could enforce in future, but not top priority right now.
|
||||||
|
<rule ref="rulesets/java/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
|
||||||
<rule ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify"/>
|
<rule ref="rulesets/java/design.xml/UseNotifyAllInsteadOfNotify"/>
|
||||||
<rule ref="rulesets/java/design.xml/AbstractClassWithoutAbstractMethod"/>
|
<rule ref="rulesets/java/design.xml/AbstractClassWithoutAbstractMethod"/>
|
||||||
<rule ref="rulesets/java/design.xml/SimplifyConditional"/>
|
<rule ref="rulesets/java/design.xml/SimplifyConditional"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user