diff --git a/Core/build.xml b/Core/build.xml
index 77cfbf977e..b7b0e202c7 100644
--- a/Core/build.xml
+++ b/Core/build.xml
@@ -40,10 +40,6 @@
-
-
-
-
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED
index 853a49859f..64dfb6481a 100755
--- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties-MERGED
@@ -230,10 +230,15 @@ AddImageWizardIngestConfigPanel.dsProcDone.errs.text=*Errors encountered in addi
AddImageWizardIngestConfigVisual.getName.text=Configure Ingest Modules
AddImageWizardIterator.stepXofN=Step {0} of {1}
AddLocalFilesTask.localFileAdd.progress.text=Adding: {0}/{1}
-Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open!
+Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open\!
Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the database with the following path has been made:\n {0}
Case.open.msgDlg.updated.title=Case Database Schema Update
-Case.checkImgExist.confDlg.doesntExist.msg=One of the images associated with \nthis case are missing. Would you like to search for them now?\nPreviously, the image was located at:\n{0}\nPlease note that you will still be able to browse directories and generate reports\nif you choose No, but you will not be able to view file content or run the ingest process.
+Case.checkImgExist.confDlg.doesntExist.msg=One of the images associated with \n\
+this case are missing. Would you like to search for them now?\n\
+Previously, the image was located at:\n\
+{0}\n\
+Please note that you will still be able to browse directories and generate reports\n\
+if you choose No, but you will not be able to view file content or run the ingest process.
Case.checkImgExist.confDlg.doesntExist.title=Missing Image
Case.addImg.exception.msg=Error adding image to the case
Case.updateCaseName.exception.msg=Error while trying to update the case name.
@@ -252,9 +257,12 @@ Case.GetCaseTypeGivenPath.Failure=Unable to get case type
Case.metaDataFileCorrupt.exception.msg=The case metadata file (.aut) is corrupted.
Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk.
Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1}
-CaseDeleteAction.closeConfMsg.text=Are you sure want to close and delete this case? \nCase Name: {0}\nCase Directory: {1}
+CaseDeleteAction.closeConfMsg.text=Are you sure want to close and delete this case? \n\
+ Case Name: {0}\n\
+ Case Directory: {1}
CaseDeleteAction.closeConfMsg.title=Warning: Closing the Current Case
-CaseDeleteAction.msgDlg.fileInUse.msg=The delete action cannot be fully completed because the folder or file in it is open by another program.\n\nClose the folder and file and try again or you can delete the case manually.
+CaseDeleteAction.msgDlg.fileInUse.msg=The delete action cannot be fully completed because the folder or file in it is open by another program.\n\n\
+Close the folder and file and try again or you can delete the case manually.
CaseDeleteAction.msgDlg.fileInUse.title=Error: Folder In Use
CaseDeleteAction.msgDlg.caseDelete.msg=Case {0} has been deleted.
CaseOpenAction.autFilter.title={0} Case File ( {1})
@@ -286,7 +294,8 @@ NewCaseWizardAction.databaseProblem1.text=Cannot open database. Cancelling case
NewCaseWizardAction.databaseProblem2.text=Error
NewCaseWizardPanel1.validate.errMsg.invalidSymbols=The Case Name cannot contain any of the following symbols: \\ / : * ? " < > |
NewCaseWizardPanel1.validate.errMsg.dirExists=Case directory ''{0}'' already exists.
-NewCaseWizardPanel1.validate.confMsg.createDir.msg=The base directory "{0}" does not exist. \n\nDo you want to create that directory?
+NewCaseWizardPanel1.validate.confMsg.createDir.msg=The base directory "{0}" does not exist. \n\n\
+ Do you want to create that directory?
NewCaseWizardPanel1.validate.confMsg.createDir.title=Create directory
NewCaseWizardPanel1.validate.errMsg.cantCreateParDir.msg=Error: Could not create case parent directory {0}
NewCaseWizardPanel1.validate.errMsg.prevCreateBaseDir.msg=Prevented from creating base directory {0}
@@ -322,15 +331,15 @@ StartupWindow.title.text=Welcome
UpdateRecentCases.menuItem.clearRecentCases.text=Clear Recent Cases
UpdateRecentCases.menuItem.empty=-Empty-
AddImageWizardIngestConfigPanel.CANCEL_BUTTON.text=Cancel
-NewCaseVisualPanel1.CaseFolderOnCDriveError.text=Warning: Path to multi-user case folder is on "C:" drive
-NewCaseVisualPanel1.CaseFolderOnInternalDriveWindowsError.text=Warning: Path to case folder is on "C:" drive. Case folder is created on the target system
+NewCaseVisualPanel1.CaseFolderOnCDriveError.text=Warning: Path to multi-user case folder is on \"C:\" drive
+NewCaseVisualPanel1.CaseFolderOnInternalDriveWindowsError.text=Warning: Path to case folder is on \"C:\" drive. Case folder is created on the target system
NewCaseVisualPanel1.CaseFolderOnInternalDriveLinuxError.text=Warning: Path to case folder is on the target system. Create case folder in mounted drive.
CollaborationMonitor.addingDataSourceStatus.msg={0} adding data source
CollaborationMonitor.analyzingDataSourceStatus.msg={0} analyzing {1}
MissingImageDialog.lbWarning.text=
MissingImageDialog.lbWarning.toolTipText=
NewCaseVisualPanel1.caseParentDirWarningLabel.text=
-NewCaseVisualPanel1.multiUserCaseRadioButton.text=Multi-user\t\t
+NewCaseVisualPanel1.multiUserCaseRadioButton.text=Multi-user
NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user
NewCaseVisualPanel1.caseTypeLabel.text=Case Type:
SingleUserCaseConverter.BadDatabaseFileName=Database file does not exist!
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java
index 370e978804..c9640f1a13 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java
@@ -19,7 +19,6 @@
package org.sleuthkit.autopsy.casemodule;
import com.google.common.annotations.Beta;
-import com.google.common.eventbus.Subscribe;
import org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData;
import java.awt.Frame;
import java.awt.event.ActionEvent;
@@ -69,6 +68,7 @@ import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.actions.OpenOutputFolderAction;
import org.sleuthkit.autopsy.appservices.AutopsyService;
import org.sleuthkit.autopsy.appservices.AutopsyService.CaseContext;
+import static org.sleuthkit.autopsy.casemodule.Bundle.*;
import org.sleuthkit.autopsy.casemodule.CaseMetadata.CaseMetadataException;
import org.sleuthkit.autopsy.casemodule.datasourcesummary.DataSourceSummaryAction;
import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceEvent;
@@ -108,17 +108,12 @@ import org.sleuthkit.autopsy.events.AutopsyEventException;
import org.sleuthkit.autopsy.events.AutopsyEventPublisher;
import org.sleuthkit.autopsy.ingest.IngestJob;
import org.sleuthkit.autopsy.ingest.IngestManager;
-import org.sleuthkit.autopsy.ingest.IngestServices;
-import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException;
import org.sleuthkit.autopsy.progress.LoggingProgressIndicator;
import org.sleuthkit.autopsy.progress.ModalDialogProgressIndicator;
import org.sleuthkit.autopsy.progress.ProgressIndicator;
import org.sleuthkit.autopsy.timeline.OpenTimelineAction;
-import org.sleuthkit.autopsy.timeline.events.TimelineEventAddedEvent;
-import org.sleuthkit.datamodel.Blackboard;
-import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardArtifactTag;
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
import org.sleuthkit.datamodel.Content;
@@ -126,7 +121,6 @@ import org.sleuthkit.datamodel.ContentTag;
import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.Report;
import org.sleuthkit.datamodel.SleuthkitCase;
-import org.sleuthkit.datamodel.TimelineManager;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskUnsupportedSchemaVersionException;
@@ -161,7 +155,6 @@ public class Case {
private CollaborationMonitor collaborationMonitor;
private Services caseServices;
private boolean hasDataSources;
- private final TSKCaseRepublisher tskEventForwarder = new TSKCaseRepublisher();
/*
* Get a reference to the main window of the desktop application to use to
@@ -395,43 +388,13 @@ public class Case {
*/
TAG_DEFINITION_CHANGED,
/**
- * An timeline event, such mac time or web activity was added to the
- * current case. The old value is null and the new value is the
- * TimelineEvent that was added.
- */
- TIMELINE_EVENT_ADDED,
- /* An item in the central repository has had its comment
- * modified. The old value is null, the new value is string for current
- * comment.
+ * An item in the central repository has had its comment modified. The
+ * old value is null, the new value is string for current comment.
*/
CR_COMMENT_CHANGED;
};
- private final class TSKCaseRepublisher {
-
- @Subscribe
- public void rebroadcastTimelineEventCreated(TimelineManager.TimelineEventAddedEvent event) {
- eventPublisher.publish(new TimelineEventAddedEvent(event));
- }
-
- @Subscribe
- public void rebroadcastArtifactsPosted(Blackboard.ArtifactsPostedEvent event) {
- for (BlackboardArtifact.Type artifactType : event.getArtifactTypes()) {
- /*
- * fireModuleDataEvent is deprecated so module writers don't use
- * it (they should use Blackboard.postArtifact(s) instead), but
- * we still need a way to rebroadcast the ArtifactsPostedEvent
- * as a ModuleDataEvent.
- */
- IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(
- event.getModuleName(),
- artifactType,
- event.getArtifacts(artifactType)));
- }
- }
- }
-
/**
* Adds a subscriber to all case events. To subscribe to only specific
* events, use one of the overloads of addEventSubscriber.
@@ -536,8 +499,8 @@ public class Case {
*/
public static boolean isValidName(String caseName) {
return !(caseName.contains("\\") || caseName.contains("/") || caseName.contains(":")
- || caseName.contains("*") || caseName.contains("?") || caseName.contains("\"")
- || caseName.contains("<") || caseName.contains(">") || caseName.contains("|"));
+ || caseName.contains("*") || caseName.contains("?") || caseName.contains("\"")
+ || caseName.contains("<") || caseName.contains(">") || caseName.contains("|"));
}
/**
@@ -2165,7 +2128,7 @@ public class Case {
} else if (UserPreferences.getIsMultiUserModeEnabled()) {
caseDb = SleuthkitCase.openCase(databaseName, UserPreferences.getDatabaseConnectionInfo(), metadata.getCaseDirectory());
} else {
- throw new CaseActionException(Bundle.Case_open_exception_multiUserCaseNotEnabled());
+ throw new CaseActionException(Case_open_exception_multiUserCaseNotEnabled());
}
} catch (TskUnsupportedSchemaVersionException ex) {
throw new CaseActionException(Bundle.Case_exceptionMessage_unsupportedSchemaVersionMessage(ex.getLocalizedMessage()), ex);
@@ -2187,8 +2150,6 @@ public class Case {
private void openCaseLevelServices(ProgressIndicator progressIndicator) {
progressIndicator.progress(Bundle.Case_progressMessage_openingCaseLevelServices());
this.caseServices = new Services(caseDb);
-
- caseDb.registerForEvents(tskEventForwarder);
}
/**
@@ -2454,7 +2415,6 @@ public class Case {
*/
if (null != caseDb) {
progressIndicator.progress(Bundle.Case_progressMessage_closingCaseDatabase());
- caseDb.unregisterForEvents(tskEventForwarder);
caseDb.close();
}
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java
index 52e35041e6..6e954ce725 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java
@@ -19,22 +19,24 @@
package org.sleuthkit.autopsy.casemodule.services;
import java.io.Closeable;
+import java.io.IOException;
+import org.openide.util.Lookup;
+import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.SleuthkitCase;
+import org.sleuthkit.datamodel.TskCoreException;
+import org.sleuthkit.datamodel.TskDataException;
/**
* A representation of the blackboard, a place where artifacts and their
* attributes are posted.
*
* NOTE: This API of this class is under development.
- *
- * @deprecated Use org.sleuthkit.datamodel.Blackboard instead.
*/
-@Deprecated
public final class Blackboard implements Closeable {
- private org.sleuthkit.datamodel.Blackboard delegate;
+ private SleuthkitCase caseDb;
/**
* Constructs a representation of the blackboard, a place where artifacts
@@ -43,24 +45,27 @@ public final class Blackboard implements Closeable {
* @param casedb The case database.
*/
Blackboard(SleuthkitCase casedb) {
- this.delegate = casedb.getBlackboard();
+ this.caseDb = casedb;
}
/**
- * Indexes the text associated with an artifact.
+ * Indexes the text associated with the an artifact.
*
* @param artifact The artifact to be indexed.
*
* @throws BlackboardException If there is a problem indexing the artifact.
*/
public synchronized void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
- if (null == delegate) {
+ if (null == caseDb) {
throw new BlackboardException("Blackboard has been closed");
}
-
+ KeywordSearchService searchService = Lookup.getDefault().lookup(KeywordSearchService.class);
+ if (null == searchService) {
+ throw new BlackboardException("Keyword search service not found");
+ }
try {
- delegate.postArtifact(artifact, "");
- } catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) {
+ searchService.index(artifact);
+ } catch (TskCoreException ex) {
throw new BlackboardException("Error indexing artifact", ex);
}
}
@@ -78,14 +83,19 @@ public final class Blackboard implements Closeable {
* artifact type.
*/
public synchronized BlackboardArtifact.Type getOrAddArtifactType(String typeName, String displayName) throws BlackboardException {
- if (null == delegate) {
+ if (null == caseDb) {
throw new BlackboardException("Blackboard has been closed");
}
-
try {
- return delegate.getOrAddArtifactType(typeName, displayName);
- } catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) {
- throw new BlackboardException("Delegate org.sleuthkit.datamodel.Blackboard threw exception.", ex);
+ return caseDb.addBlackboardArtifactType(typeName, displayName);
+ } catch (TskDataException typeExistsEx) {
+ try {
+ return caseDb.getArtifactType(typeName);
+ } catch (TskCoreException ex) {
+ throw new BlackboardException("Failed to get or add artifact type", ex);
+ }
+ } catch (TskCoreException ex) {
+ throw new BlackboardException("Failed to get or add artifact type", ex);
}
}
@@ -103,23 +113,30 @@ public final class Blackboard implements Closeable {
* attribute type.
*/
public synchronized BlackboardAttribute.Type getOrAddAttributeType(String typeName, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, String displayName) throws BlackboardException {
- if (null == delegate) {
+ if (null == caseDb) {
throw new BlackboardException("Blackboard has been closed");
}
try {
- return delegate.getOrAddAttributeType(typeName, valueType, displayName);
- } catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) {
- throw new BlackboardException("Delegate org.sleuthkit.datamodel.Blackboard threw exception.", ex);
+ return caseDb.addArtifactAttributeType(typeName, valueType, displayName);
+ } catch (TskDataException typeExistsEx) {
+ try {
+ return caseDb.getAttributeType(typeName);
+ } catch (TskCoreException ex) {
+ throw new BlackboardException("Failed to get or add attribute type", ex);
+ }
+ } catch (TskCoreException ex) {
+ throw new BlackboardException("Failed to get or add attribute type", ex);
}
}
/**
* Closes the blackboard.
*
+ * @throws IOException If there is a problem closing the blackboard.
*/
@Override
- public synchronized void close() {
- delegate = null;
+ public synchronized void close() throws IOException {
+ caseDb = null;
}
/**
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java
index 7a0ef445ee..1e8d8fcb2e 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java
@@ -2,7 +2,7 @@
*
* Autopsy Forensic Browser
*
- * Copyright 2011-2018 Basis Technology Corp.
+ * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier sleuthkit org
* Copyright 2012 42six Solutions.
* Contact: aebadirad 42six com
@@ -35,7 +35,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
*/
public class Services implements Closeable {
- private final List servicesList = new ArrayList<>();
+ private final List services = new ArrayList<>();
private final FileManager fileManager;
private final TagsManager tagsManager;
private final KeywordSearchService keywordSearchService;
@@ -49,19 +49,19 @@ public class Services implements Closeable {
*/
public Services(SleuthkitCase caseDb) {
fileManager = new FileManager(caseDb);
- servicesList.add(fileManager);
+ services.add(fileManager);
tagsManager = new TagsManager(caseDb);
- servicesList.add(tagsManager);
+ services.add(tagsManager);
//This lookup fails in the functional test code. See JIRA-4571 for details.
//For the time being, the closing of this service at line 108 will be made
//null safe so that the functional tests run with no issues.
keywordSearchService = Lookup.getDefault().lookup(KeywordSearchService.class);
- servicesList.add(keywordSearchService);
+ services.add(keywordSearchService);
blackboard = new Blackboard(caseDb);
- servicesList.add(blackboard);
+ services.add(blackboard);
}
/**
@@ -95,10 +95,7 @@ public class Services implements Closeable {
* Gets the blackboard service for the current case.
*
* @return The blackboard service for the current case.
- *
- * @deprecated Use SleuthkitCase.getBlackboard() instead.
*/
- @Deprecated
public Blackboard getBlackboard() {
return blackboard;
}
@@ -110,7 +107,7 @@ public class Services implements Closeable {
*/
@Override
public void close() throws IOException {
- for (Closeable service : servicesList) {
+ for (Closeable service : services) {
if(service != null) {
service.close();
}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED
index 75866a79d0..007af703c5 100755
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED
@@ -5,7 +5,10 @@ CentralRepoCommentDialog.title.addEditCentralRepoComment=Add/Edit Central Reposi
OpenIDE-Module-Name=Central Repository
OpenIDE-Module-Display-Category=Ingest Module
OpenIDE-Module-Short-Description=Correlation Engine Ingest Module
-OpenIDE-Module-Long-Description=Correlation Engine ingest module and central database. \n\nThe Correlation Engine ingest module stores attributes of artifacts matching selected correlation types into a central database.\nStored attributes are used in future cases to correlate and analyzes files and artifacts during ingest.
+OpenIDE-Module-Long-Description=\
+ Correlation Engine ingest module and central database. \n\n\
+ The Correlation Engine ingest module stores attributes of artifacts matching selected correlation types into a central database.\n\
+ Stored attributes are used in future cases to correlate and analyzes files and artifacts during ingest.
CentralRepoCommentDialog.commentLabel.text=Comment:
CentralRepoCommentDialog.okButton.text=&OK
CentralRepoCommentDialog.cancelButton.text=C&ancel
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java
index 315c62842c..37f0f595cb 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java
@@ -23,7 +23,6 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import static java.lang.Boolean.FALSE;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
@@ -35,40 +34,35 @@ import org.apache.commons.lang3.StringUtils;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
+import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeNormalizationException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.coreutils.Logger;
-import org.sleuthkit.autopsy.coreutils.ThreadUtils;
import org.sleuthkit.autopsy.ingest.IngestManager;
+import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationDataSource;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.datamodel.AbstractFile;
-import org.sleuthkit.datamodel.Blackboard;
import org.sleuthkit.datamodel.BlackboardArtifact;
-import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT;
import org.sleuthkit.datamodel.BlackboardAttribute;
-import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT;
-import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COMMENT;
-import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME;
+import org.sleuthkit.datamodel.TskCoreException;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
+import org.sleuthkit.autopsy.coreutils.ThreadUtils;
import org.sleuthkit.autopsy.ingest.events.DataSourceAnalysisCompletedEvent;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.SleuthkitCase;
-import org.sleuthkit.datamodel.TskCoreException;
/**
* Listen for ingest events and update entries in the Central Repository
* database accordingly
*/
-@NbBundle.Messages({"IngestEventsListener.ingestmodule.name=Correlation Engine"})
public class IngestEventsListener {
private static final Logger LOGGER = Logger.getLogger(CorrelationAttributeInstance.class.getName());
- private static final String MODULE_NAME = Bundle.IngestEventsListener_ingestmodule_name();
final Collection recentlyAddedCeArtifacts = new LinkedHashSet<>();
private static int correlationModuleInstanceCount;
@@ -195,20 +189,44 @@ public class IngestEventsListener {
}
@NbBundle.Messages({"IngestEventsListener.prevTaggedSet.text=Previously Tagged As Notable (Central Repository)",
- "IngestEventsListener.prevCaseComment.text=Previous Case: "})
+ "IngestEventsListener.prevCaseComment.text=Previous Case: ",
+ "IngestEventsListener.ingestmodule.name=Correlation Engine"})
static private void postCorrelatedBadArtifactToBlackboard(BlackboardArtifact bbArtifact, List caseDisplayNames) {
- Collection attributes = Arrays.asList(
- new BlackboardAttribute(
- TSK_SET_NAME, MODULE_NAME,
- Bundle.IngestEventsListener_prevTaggedSet_text()),
- new BlackboardAttribute(
- TSK_COMMENT, MODULE_NAME,
- Bundle.IngestEventsListener_prevCaseComment_text() + caseDisplayNames.stream().distinct().collect(Collectors.joining(","))),
- new BlackboardAttribute(
- TSK_ASSOCIATED_ARTIFACT, MODULE_NAME,
- bbArtifact.getArtifactID()));
- postArtifactToBlackboard(bbArtifact, attributes);
+ try {
+ String MODULE_NAME = Bundle.IngestEventsListener_ingestmodule_name();
+
+ Collection attributes = new ArrayList<>();
+ attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME,
+ Bundle.IngestEventsListener_prevTaggedSet_text()));
+ attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COMMENT, MODULE_NAME,
+ Bundle.IngestEventsListener_prevCaseComment_text() + caseDisplayNames.stream().distinct().collect(Collectors.joining(",", "", ""))));
+ attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT, MODULE_NAME, bbArtifact.getArtifactID()));
+
+ SleuthkitCase tskCase = bbArtifact.getSleuthkitCase();
+ AbstractFile abstractFile = tskCase.getAbstractFileById(bbArtifact.getObjectID());
+ org.sleuthkit.datamodel.Blackboard tskBlackboard = tskCase.getBlackboard();
+ // Create artifact if it doesn't already exist.
+ if (!tskBlackboard.artifactExists(abstractFile, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT, attributes)) {
+ BlackboardArtifact tifArtifact = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT);
+ tifArtifact.addAttributes(attributes);
+
+ try {
+ // index the artifact for keyword search
+ Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard();
+ blackboard.indexArtifact(tifArtifact);
+ } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) {
+ LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS
+ }
+
+ // fire event to notify UI of this new artifact
+ IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(MODULE_NAME, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT));
+ }
+ } catch (TskCoreException ex) {
+ LOGGER.log(Level.SEVERE, "Failed to create BlackboardArtifact.", ex); // NON-NLS
+ } catch (IllegalStateException ex) {
+ LOGGER.log(Level.SEVERE, "Failed to create BlackboardAttribute.", ex); // NON-NLS
+ }
}
/**
@@ -222,32 +240,34 @@ public class IngestEventsListener {
"# {1} - count",
"IngestEventsListener.prevCount.text=Number of previous {0}: {1}"})
static private void postCorrelatedPreviousArtifactToBlackboard(BlackboardArtifact bbArtifact) {
- Collection attributes = Arrays.asList(
- new BlackboardAttribute(
- TSK_SET_NAME, MODULE_NAME,
- Bundle.IngestEventsListener_prevExists_text()),
- new BlackboardAttribute(
- TSK_ASSOCIATED_ARTIFACT, MODULE_NAME,
- bbArtifact.getArtifactID()));
- postArtifactToBlackboard(bbArtifact, attributes);
- }
- private static void postArtifactToBlackboard(BlackboardArtifact bbArtifact, Collection attributes) {
try {
+ String MODULE_NAME = Bundle.IngestEventsListener_ingestmodule_name();
+
+ Collection attributes = new ArrayList<>();
+ BlackboardAttribute att = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME,
+ Bundle.IngestEventsListener_prevExists_text());
+ attributes.add(att);
+ attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT, MODULE_NAME, bbArtifact.getArtifactID()));
+
SleuthkitCase tskCase = bbArtifact.getSleuthkitCase();
- AbstractFile abstractFile = tskCase.getAbstractFileById(bbArtifact.getObjectID());
- Blackboard blackboard = tskCase.getBlackboard();
+ AbstractFile abstractFile = bbArtifact.getSleuthkitCase().getAbstractFileById(bbArtifact.getObjectID());
+ org.sleuthkit.datamodel.Blackboard tskBlackboard = tskCase.getBlackboard();
// Create artifact if it doesn't already exist.
- if (!blackboard.artifactExists(abstractFile, TSK_INTERESTING_ARTIFACT_HIT, attributes)) {
- BlackboardArtifact tifArtifact = abstractFile.newArtifact(TSK_INTERESTING_ARTIFACT_HIT);
+ if (!tskBlackboard.artifactExists(abstractFile, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT, attributes)) {
+ BlackboardArtifact tifArtifact = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT);
tifArtifact.addAttributes(attributes);
try {
// index the artifact for keyword search
- blackboard.postArtifact(tifArtifact, MODULE_NAME);
- } catch (Blackboard.BlackboardException ex) {
+ Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard();
+ blackboard.indexArtifact(tifArtifact);
+ } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) {
LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS
}
+
+ // fire event to notify UI of this new artifact
+ IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(MODULE_NAME, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT));
}
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Failed to create BlackboardArtifact.", ex); // NON-NLS
@@ -420,8 +440,8 @@ public class IngestEventsListener {
private final boolean createCorrelationAttributes;
private DataAddedTask(EamDb db, PropertyChangeEvent evt, boolean flagNotableItemsEnabled, boolean flagPreviousItemsEnabled, boolean createCorrelationAttributes) {
- this.dbManager = db;
- this.event = evt;
+ dbManager = db;
+ event = evt;
this.flagNotableItemsEnabled = flagNotableItemsEnabled;
this.flagPreviousItemsEnabled = flagPreviousItemsEnabled;
this.createCorrelationAttributes = createCorrelationAttributes;
@@ -463,7 +483,7 @@ public class IngestEventsListener {
}
}
if (flagPreviousItemsEnabled
- && (eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.USBID_TYPE_ID
+ && (eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.USBID_TYPE_ID
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.ICCID_TYPE_ID
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.IMEI_TYPE_ID
|| eamArtifact.getCorrelationType().getId() == CorrelationAttributeInstance.IMSI_TYPE_ID
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java
index 792a3f2ebb..f244421880 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java
@@ -19,44 +19,41 @@
package org.sleuthkit.autopsy.centralrepository.ingestmodule;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import java.util.List;
import java.util.logging.Level;
import java.util.stream.Collectors;
import org.openide.util.NbBundle.Messages;
+import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
+import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeNormalizationException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationDataSource;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum;
-import org.sleuthkit.autopsy.centralrepository.eventlisteners.IngestEventsListener;
import org.sleuthkit.autopsy.core.RuntimeProperties;
-import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
-import org.sleuthkit.autopsy.healthmonitor.HealthMonitor;
-import org.sleuthkit.autopsy.healthmonitor.TimingMetric;
import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestJobContext;
import org.sleuthkit.autopsy.ingest.IngestMessage;
import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.autopsy.ingest.IngestServices;
+import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationDataSource;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum;
+import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
import org.sleuthkit.datamodel.AbstractFile;
-import org.sleuthkit.datamodel.Blackboard;
import org.sleuthkit.datamodel.BlackboardArtifact;
-import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT;
import org.sleuthkit.datamodel.BlackboardAttribute;
-import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COMMENT;
-import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME;
import org.sleuthkit.datamodel.HashUtility;
-import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData;
+import org.sleuthkit.autopsy.centralrepository.eventlisteners.IngestEventsListener;
+import org.sleuthkit.autopsy.healthmonitor.HealthMonitor;
+import org.sleuthkit.autopsy.healthmonitor.TimingMetric;
+import org.sleuthkit.datamodel.SleuthkitCase;
/**
* Ingest module for inserting entries into the Central Repository database on
@@ -66,8 +63,6 @@ import org.sleuthkit.datamodel.TskData;
"CentralRepoIngestModule.prevCaseComment.text=Previous Case: "})
final class CentralRepoIngestModule implements FileIngestModule {
- private static final String MODULE_NAME = CentralRepoIngestModuleFactory.getModuleName();
-
static final boolean DEFAULT_FLAG_TAGGED_NOTABLE_ITEMS = true;
static final boolean DEFAULT_FLAG_PREVIOUS_DEVICES = true;
static final boolean DEFAULT_CREATE_CR_PROPERTIES = true;
@@ -79,10 +74,10 @@ final class CentralRepoIngestModule implements FileIngestModule {
private long jobId;
private CorrelationCase eamCase;
private CorrelationDataSource eamDataSource;
+ private Blackboard blackboard;
private CorrelationAttributeInstance.Type filesType;
private final boolean flagTaggedNotableItems;
private final boolean flagPreviouslySeenDevices;
- private Blackboard blackboard;
private final boolean createCorrelationProperties;
/**
@@ -109,7 +104,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
}
try {
- blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard();
+ blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard();
} catch (NoCurrentCaseException ex) {
logger.log(Level.SEVERE, "Exception while getting open case.", ex);
return ProcessResult.ERROR;
@@ -163,7 +158,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
}
}
- // insert this file into the central repository
+ // insert this file into the central repository
if (createCorrelationProperties) {
try {
CorrelationAttributeInstance cefi = new CorrelationAttributeInstance(
@@ -276,7 +271,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
// Don't allow sqlite central repo databases to be used for multi user cases
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.");
throw new IngestModuleException("Cannot run on a multi-user case with a SQLite central repository."); // NON-NLS
}
@@ -313,7 +308,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
// if we are the first thread / module for this job, then make sure the case
// and image exist in the DB before we associate artifacts with it.
if (refCounter.incrementAndGet(jobId)
- == 1) {
+ == 1) {
// ensure we have this data source in the EAM DB
try {
if (null == centralRepoDb.getDataSource(eamCase, eamDataSource.getDataSourceObjectID())) {
@@ -335,32 +330,41 @@ final class CentralRepoIngestModule implements FileIngestModule {
*/
private void postCorrelatedBadFileToBlackboard(AbstractFile abstractFile, List caseDisplayNames) {
- Collection attributes = Arrays.asList(
- new BlackboardAttribute(
- TSK_SET_NAME, MODULE_NAME,
- Bundle.CentralRepoIngestModule_prevTaggedSet_text()),
- new BlackboardAttribute(
- TSK_COMMENT, MODULE_NAME,
- Bundle.CentralRepoIngestModule_prevCaseComment_text() + caseDisplayNames.stream().distinct().collect(Collectors.joining(","))));
try {
+ String MODULE_NAME = CentralRepoIngestModuleFactory.getModuleName();
+ Collection attributes = new ArrayList<>();
+ attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME,
+ Bundle.CentralRepoIngestModule_prevTaggedSet_text()));
+ attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COMMENT, MODULE_NAME,
+ Bundle.CentralRepoIngestModule_prevCaseComment_text() + caseDisplayNames.stream().distinct().collect(Collectors.joining(",", "", ""))));
+
+ SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase();
+ org.sleuthkit.datamodel.Blackboard tskBlackboard = tskCase.getBlackboard();
// Create artifact if it doesn't already exist.
- if (!blackboard.artifactExists(abstractFile, TSK_INTERESTING_FILE_HIT, attributes)) {
- BlackboardArtifact tifArtifact = abstractFile.newArtifact(TSK_INTERESTING_FILE_HIT);
+ if (!tskBlackboard.artifactExists(abstractFile, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT, attributes)) {
+ BlackboardArtifact tifArtifact = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT);
tifArtifact.addAttributes(attributes);
+
try {
// index the artifact for keyword search
- blackboard.postArtifact(tifArtifact, MODULE_NAME);
+ blackboard.indexArtifact(tifArtifact);
} catch (Blackboard.BlackboardException ex) {
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS
}
+
// send inbox message
sendBadFileInboxMessage(tifArtifact, abstractFile.getName(), abstractFile.getMd5Hash());
+
+ // fire event to notify UI of this new artifact
+ services.fireModuleDataEvent(new ModuleDataEvent(MODULE_NAME, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT));
}
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Failed to create BlackboardArtifact.", ex); // NON-NLS
} catch (IllegalStateException ex) {
logger.log(Level.SEVERE, "Failed to create BlackboardAttribute.", ex); // NON-NLS
+ } catch (NoCurrentCaseException ex) {
+ logger.log(Level.SEVERE, "Exception while getting open case.", ex); // NON-NLS
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AbstractCommonAttributeSearcher.java b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AbstractCommonAttributeSearcher.java
index 70ac378131..1880489cc4 100644
--- a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AbstractCommonAttributeSearcher.java
+++ b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AbstractCommonAttributeSearcher.java
@@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.commonpropertiessearch;
import java.sql.SQLException;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -31,7 +30,6 @@ import java.util.stream.Stream;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
-import org.sleuthkit.autopsy.datamodel.utils.FileTypeUtils;
import org.sleuthkit.datamodel.TskCoreException;
/**
@@ -149,7 +147,7 @@ public abstract class AbstractCommonAttributeSearcher {
}
return instanceCollatedCommonFiles;
}
-
+
/*
* The set of the MIME types that will be checked for extension mismatches
* when checkType is ONLY_MEDIA. ".jpg", ".jpeg", ".png", ".psd", ".nef",
@@ -213,7 +211,6 @@ public abstract class AbstractCommonAttributeSearcher {
"application/vnd.oasis.opendocument.text" //NON-NLS
).collect(Collectors.toSet());
-
/**
* @return the filterByMedia
*/
@@ -241,16 +238,4 @@ public abstract class AbstractCommonAttributeSearcher {
void setFilterByDoc(boolean filterByDoc) {
this.filterByDoc = filterByDoc;
}
-
-
- Set getMimeTypesToFilterOn() {
- Set mimeTypesToFilterOn = new HashSet<>();
- if (isFilterByMedia()) {
- mimeTypesToFilterOn.addAll(FileTypeUtils.FileTypeCategory.VISUAL.getMediaTypes());
- }
- if (isFilterByDoc()) {
- mimeTypesToFilterOn.addAll(FileTypeUtils.FileTypeCategory.DOCUMENTS.getMediaTypes());
- }
- return mimeTypesToFilterOn;
- }
}
diff --git a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AllInterCaseCommonAttributeSearcher.java b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AllInterCaseCommonAttributeSearcher.java
index df9312f352..ee9c70211f 100644
--- a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AllInterCaseCommonAttributeSearcher.java
+++ b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/AllInterCaseCommonAttributeSearcher.java
@@ -20,14 +20,16 @@
package org.sleuthkit.autopsy.commonpropertiessearch;
import java.sql.SQLException;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.Type;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.datamodel.TskCoreException;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.Type;
+import static org.sleuthkit.autopsy.commonpropertiessearch.AbstractCommonAttributeSearcher.MEDIA_PICS_VIDEO_MIME_TYPES;
/**
* Algorithm which finds files anywhere in the Central Repo which also occur in
@@ -54,7 +56,13 @@ public class AllInterCaseCommonAttributeSearcher extends InterCaseCommonAttribut
@Override
public CommonAttributeCountSearchResults findMatchesByCount() throws TskCoreException, NoCurrentCaseException, SQLException, EamDbException {
InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(corAttrType);
- Set mimeTypesToFilterOn = getMimeTypesToFilterOn();
+ Set mimeTypesToFilterOn = new HashSet<>();
+ if (isFilterByMedia()) {
+ mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
+ }
+ if (isFilterByDoc()) {
+ mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
+ }
Map interCaseCommonFiles = eamDbAttrInst.findInterCaseValuesByCount(Case.getCurrentCase(), mimeTypesToFilterOn);
return new CommonAttributeCountSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType);
}
@@ -62,7 +70,13 @@ public class AllInterCaseCommonAttributeSearcher extends InterCaseCommonAttribut
@Override
public CommonAttributeCaseSearchResults findMatchesByCase() throws TskCoreException, NoCurrentCaseException, SQLException, EamDbException {
InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(corAttrType);
- Set mimeTypesToFilterOn = getMimeTypesToFilterOn();
+ Set mimeTypesToFilterOn = new HashSet<>();
+ if (isFilterByMedia()) {
+ mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
+ }
+ if (isFilterByDoc()) {
+ mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
+ }
Map> interCaseCommonFiles = eamDbAttrInst.findInterCaseValuesByCase(Case.getCurrentCase(), mimeTypesToFilterOn);
return new CommonAttributeCaseSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType);
}
diff --git a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseCommonAttributeSearcher.java b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseCommonAttributeSearcher.java
index cb9b076cb1..381ccf441c 100644
--- a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseCommonAttributeSearcher.java
+++ b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/InterCaseCommonAttributeSearcher.java
@@ -19,10 +19,10 @@
*/
package org.sleuthkit.autopsy.commonpropertiessearch;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.Type;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.Type;
/**
* Provides logic for selecting common files from all data sources and all cases
diff --git a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/IntraCaseCommonAttributeSearcher.java b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/IntraCaseCommonAttributeSearcher.java
index f8b1000a59..dac83a333e 100644
--- a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/IntraCaseCommonAttributeSearcher.java
+++ b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/IntraCaseCommonAttributeSearcher.java
@@ -23,9 +23,9 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
@@ -45,6 +45,8 @@ import org.sleuthkit.datamodel.TskCoreException;
@SuppressWarnings("PMD.AbstractNaming")
public abstract class IntraCaseCommonAttributeSearcher extends AbstractCommonAttributeSearcher {
+ private static final String FILTER_BY_MIME_TYPES_WHERE_CLAUSE = " and mime_type in (%s)"; //NON-NLS // where %s is csv list of mime_types to filter on
+
private final Map dataSourceIdToNameMap;
/**
@@ -156,14 +158,25 @@ public abstract class IntraCaseCommonAttributeSearcher extends AbstractCommonAtt
* to filter on were given.
*/
String determineMimeTypeFilter() {
- Set mimeTypesToFilterOn = getMimeTypesToFilterOn();
- if (mimeTypesToFilterOn.isEmpty()) {
- return "";
- } else {
- String mimeTypeString = mimeTypesToFilterOn.stream()
- .map(mimeType -> "'" + mimeType + "'")
- .collect(Collectors.joining(","));
- return String.format(" and mime_type in (%s)", new Object[]{mimeTypeString});
+
+ Set mimeTypesToFilterOn = new HashSet<>();
+ String mimeTypeString = "";
+ if (isFilterByMedia()) {
+ mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
}
+ if (isFilterByDoc()) {
+ mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
+ }
+ StringBuilder mimeTypeFilter = new StringBuilder(mimeTypesToFilterOn.size());
+ if (!mimeTypesToFilterOn.isEmpty()) {
+ for (String mimeType : mimeTypesToFilterOn) {
+ mimeTypeFilter.append(SINGLE_QUOTE).append(mimeType).append(SINGLE_QUTOE_COMMA);
+ }
+ mimeTypeString = mimeTypeFilter.toString().substring(0, mimeTypeFilter.length() - 1);
+ mimeTypeString = String.format(FILTER_BY_MIME_TYPES_WHERE_CLAUSE, new Object[]{mimeTypeString});
+ }
+ return mimeTypeString;
}
+ static final String SINGLE_QUTOE_COMMA = "',";
+ static final String SINGLE_QUOTE = "'";
}
diff --git a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/SingleInterCaseCommonAttributeSearcher.java b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/SingleInterCaseCommonAttributeSearcher.java
index e7026d59b1..8d0cca8412 100644
--- a/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/SingleInterCaseCommonAttributeSearcher.java
+++ b/Core/src/org/sleuthkit/autopsy/commonpropertiessearch/SingleInterCaseCommonAttributeSearcher.java
@@ -20,15 +20,17 @@
package org.sleuthkit.autopsy.commonpropertiessearch;
import java.sql.SQLException;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
-import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.Type;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.datamodel.TskCoreException;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.Type;
+import static org.sleuthkit.autopsy.commonpropertiessearch.AbstractCommonAttributeSearcher.MEDIA_PICS_VIDEO_MIME_TYPES;
/**
*
@@ -50,7 +52,7 @@ public class SingleInterCaseCommonAttributeSearcher extends InterCaseCommonAttri
* @throws EamDbException
*/
public SingleInterCaseCommonAttributeSearcher(int correlationCaseId, boolean filterByMediaMimeType,
- boolean filterByDocMimeType, Type corAttrType, int percentageThreshold) throws EamDbException {
+ boolean filterByDocMimeType, Type corAttrType, int percentageThreshold) throws EamDbException {
super(filterByMediaMimeType, filterByDocMimeType, corAttrType, percentageThreshold);
this.corrleationCaseId = correlationCaseId;
@@ -74,7 +76,13 @@ public class SingleInterCaseCommonAttributeSearcher extends InterCaseCommonAttri
CorrelationCase correlationCase = this.getCorrelationCaseFromId(this.corrleationCaseId);
this.correlationCaseName = correlationCase.getDisplayName();
InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(this.corAttrType);
- Set mimeTypesToFilterOn = getMimeTypesToFilterOn();
+ Set mimeTypesToFilterOn = new HashSet<>();
+ if (isFilterByMedia()) {
+ mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
+ }
+ if (isFilterByDoc()) {
+ mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
+ }
Map interCaseCommonFiles = eamDbAttrInst.findSingleInterCaseValuesByCount(Case.getCurrentCase(), mimeTypesToFilterOn, correlationCase);
return new CommonAttributeCountSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType);
@@ -97,7 +105,13 @@ public class SingleInterCaseCommonAttributeSearcher extends InterCaseCommonAttri
CorrelationCase correlationCase = this.getCorrelationCaseFromId(this.corrleationCaseId);
this.correlationCaseName = correlationCase.getDisplayName();
InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(this.corAttrType);
- Set mimeTypesToFilterOn = getMimeTypesToFilterOn();
+ Set mimeTypesToFilterOn = new HashSet<>();
+ if (isFilterByMedia()) {
+ mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
+ }
+ if (isFilterByDoc()) {
+ mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
+ }
Map> interCaseCommonFiles = eamDbAttrInst.findSingleInterCaseValuesByCase(Case.getCurrentCase(), mimeTypesToFilterOn, correlationCase);
return new CommonAttributeCaseSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType);
diff --git a/Core/src/org/sleuthkit/autopsy/communications/snapshot/comm_snapshot_template.html b/Core/src/org/sleuthkit/autopsy/communications/snapshot/comm_snapshot_template.html
old mode 100644
new mode 100755
diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java
index 79f58eef64..ab92f3f543 100644
--- a/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java
+++ b/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java
@@ -33,8 +33,7 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
import org.sleuthkit.datamodel.AbstractFile;
/**
- * Content viewer that incorporates file type-specific viewers, such as ones
- * for pictures, video, etc.
+ * Generic Application content viewer
*/
@ServiceProvider(service = DataContentViewer.class, position = 3)
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
@@ -74,7 +73,7 @@ public class FileViewer extends javax.swing.JPanel implements DataContentViewer
initComponents();
- //LOGGER.log(Level.INFO, "Created ApplicationContentViewer instance: {0}", this); //NON-NLS
+ LOGGER.log(Level.INFO, "Created ApplicationContentViewer instance: {0}", this); //NON-NLS
}
/**
@@ -120,7 +119,7 @@ public class FileViewer extends javax.swing.JPanel implements DataContentViewer
String mimeType = file.getMIMEType();
if (Strings.isNullOrEmpty(mimeType)) {
- // LOGGER.log(Level.INFO, "Mimetype not known for file: {0}", file.getName()); //NON-NLS
+ LOGGER.log(Level.INFO, "Mimetype not known for file: {0}", file.getName()); //NON-NLS
try {
FileTypeDetector fileTypeDetector = new FileTypeDetector();
mimeType = fileTypeDetector.getMIMEType(file);
@@ -133,16 +132,18 @@ public class FileViewer extends javax.swing.JPanel implements DataContentViewer
if (mimeType.equalsIgnoreCase("application/octet-stream")) {
return;
}
+ else {
+ FileTypeViewer viewer = getSupportingViewer(mimeType);
+ if (viewer != null) {
+ lastViewer = viewer;
- FileTypeViewer viewer = getSupportingViewer(mimeType);
- if (viewer != null) {
- lastViewer = viewer;
-
- viewer.setFile(file);
- this.removeAll();
- this.add(viewer.getComponent());
- this.repaint();
- }
+ viewer.setFile(file);
+ this.removeAll();
+ this.add(viewer.getComponent());
+ this.repaint();
+ }
+ }
+
}
@Override
diff --git a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties-MERGED
index f7039ab4ce..087eaec314 100755
--- a/Core/src/org/sleuthkit/autopsy/core/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/core/Bundle.properties-MERGED
@@ -3,7 +3,13 @@ Installer.closing.confirmationDialog.title=Ingest is Running
# {0} - exception message
Installer.closing.messageBox.caseCloseExceptionMessage=Error closing case: {0}
OpenIDE-Module-Display-Category=Infrastructure
-OpenIDE-Module-Long-Description=This is the core Autopsy module.\n\nThe module contains the core components needed for the bare application to run; the RCP platform, windowing GUI, sleuthkit bindings, datamodel / storage, explorer, result viewers, content viewers, ingest framework, reporting, and core tools, such as the file search.\n\nThe framework included in the module contains APIs for developing modules for ingest, viewers and reporting. The modules can be deployed as Plugins using the Autopsy plugin installer.\nThis module should not be uninstalled - without it, Autopsy will not run.\n\nFor more information, see http://www.sleuthkit.org/autopsy/
+OpenIDE-Module-Long-Description=\
+ This is the core Autopsy module.\n\n\
+ The module contains the core components needed for the bare application to run; the RCP platform, windowing GUI, sleuthkit bindings, datamodel / storage, explorer, result viewers, content viewers, ingest framework, reporting, and core tools, such as the file search.\n\n\
+ The framework included in the module contains APIs for developing modules for ingest, viewers and reporting. \
+ The modules can be deployed as Plugins using the Autopsy plugin installer.\n\
+ This module should not be uninstalled - without it, Autopsy will not run.\n\n\
+ For more information, see http://www.sleuthkit.org/autopsy/
OpenIDE-Module-Name=Autopsy-Core
OpenIDE-Module-Short-Description=Autopsy Core Module
org_sleuthkit_autopsy_core_update_center=http://sleuthkit.org/autopsy/updates.xml
diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties-MERGED
index 999e1a22f7..fba1300c93 100755
--- a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties-MERGED
@@ -63,9 +63,9 @@ DataContentViewerHex.pageLabel2.text=Page
DataContentViewerString.pageLabel2.text=Page
# Product Information panel
-LBL_Description=
SortChooser.dialogTitle=Choose Sort Criteria
ThumbnailViewChildren.progress.cancelling=(Cancelling)
# {0} - file name
@@ -102,7 +102,7 @@ DataResultViewerThumbnail.pageNextButton.text=
DataResultViewerThumbnail.imagesLabel.text=Images:
DataResultViewerThumbnail.imagesRangeLabel.text=-
DataResultViewerThumbnail.pageNumLabel.text=-
-DataResultViewerThumbnail.filePathLabel.text=\
+DataResultViewerThumbnail.filePathLabel.text=\ \ \
DataResultViewerThumbnail.goToPageLabel.text=Go to Page:
DataResultViewerThumbnail.goToPageField.text=
AdvancedConfigurationDialog.cancelButton.text=Cancel
diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties-MERGED
index 702b726e08..17791d159d 100755
--- a/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/coreutils/Bundle.properties-MERGED
@@ -23,7 +23,9 @@ PlatformUtil.getProcVmUsed.sigarNotInit.msg=Cannot get virt mem used, sigar not
PlatformUtil.getProcVmUsed.gen.msg=Cannot get virt mem used, {0}
PlatformUtil.getJvmMemInfo.usageText=JVM heap usage: {0}, JVM non-heap usage: {1}
PlatformUtil.getPhysicalMemInfo.usageText=Physical memory usage (max, total, free): {0}, {1}, {2}
-PlatformUtil.getAllMemUsageInfo.usageText={0}\n{1}\nProcess Virtual Memory: {2}
+PlatformUtil.getAllMemUsageInfo.usageText={0}\n\
+{1}\n\
+Process Virtual Memory: {2}
# {0} - file name
ReadImageTask.mesageText=Reading image: {0}
StringExtract.illegalStateException.cannotInit.msg=Unicode table not properly initialized, cannot instantiate StringExtract
diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ColorUtilities.java b/Core/src/org/sleuthkit/autopsy/coreutils/ColorUtilities.java
index e524a02352..87f0a76cce 100644
--- a/Core/src/org/sleuthkit/autopsy/coreutils/ColorUtilities.java
+++ b/Core/src/org/sleuthkit/autopsy/coreutils/ColorUtilities.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2013-8 Basis Technology Corp.
+ * Copyright 2013 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,9 +21,9 @@ package org.sleuthkit.autopsy.coreutils;
import javafx.scene.paint.Color;
/**
- * Utilities for dealing with colors.
+ *
*/
-final public class ColorUtilities {
+public class ColorUtilities {
private ColorUtilities() {
}
diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java
index 63253062d9..0a76b2a7fa 100644
--- a/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java
+++ b/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java
@@ -128,7 +128,12 @@ public final class ExecUtil {
* @throws IOException if an I/O error occurs.
*/
public static int execute(ProcessBuilder processBuilder) throws SecurityException, IOException {
- return ExecUtil.execute(processBuilder, 30, TimeUnit.DAYS, () -> false);
+ return ExecUtil.execute(processBuilder, 30, TimeUnit.DAYS, new ProcessTerminator() {
+ @Override
+ public boolean shouldTerminateProcess() {
+ return false;
+ }
+ });
}
/**
@@ -165,29 +170,6 @@ public final class ExecUtil {
*/
public static int execute(ProcessBuilder processBuilder, long timeOut, TimeUnit units, ProcessTerminator terminator) throws SecurityException, IOException {
Process process = processBuilder.start();
- return waitForTermination(processBuilder.command().get(0), process, timeOut, units, terminator);
- }
-
- /**
- * Wait for the given process to finish, using the given ProcessTerminator.
- *
- * @param command The command that was used to start the process. Used
- * only for logging purposes.
- * @param process The process to wait for.
- * @param terminator The ProcessTerminator used to determine if the process
- * should be killed.
- *
- * @returnthe exit value of the process
- *
- * @throws SecurityException if a security manager exists and vetoes any
- * aspect of running the process.
- * @throws IOException if an I/o error occurs.
- */
- public static int waitForTermination(String command, Process process, ProcessTerminator terminator) throws SecurityException, IOException {
- return ExecUtil.waitForTermination(command, process, ExecUtil.DEFAULT_TIMEOUT, ExecUtil.DEFAULT_TIMEOUT_UNITS, terminator);
- }
-
- private static int waitForTermination(String command, Process process, long timeOut, TimeUnit units, ProcessTerminator terminator) throws SecurityException, IOException {
try {
do {
process.waitFor(timeOut, units);
@@ -196,7 +178,7 @@ public final class ExecUtil {
try {
process.waitFor(); //waiting to help ensure process is shutdown before calling interrupt() or returning
} catch (InterruptedException exx) {
- Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, String.format("Wait for process termination following killProcess was interrupted for command %s", command));
+ Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, String.format("Wait for process termination following killProcess was interrupted for command %s", processBuilder.command().get(0)));
}
}
} while (process.isAlive());
@@ -207,9 +189,9 @@ public final class ExecUtil {
try {
process.waitFor(); //waiting to help ensure process is shutdown before calling interrupt() or returning
} catch (InterruptedException exx) {
- Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, String.format("Wait for process termination following killProcess was interrupted for command %s", command));
+ Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, String.format("Wait for process termination following killProcess was interrupted for command %s", processBuilder.command().get(0)));
}
- Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, "Thread interrupted while running {0}", command); // NON-NLS
+ Logger.getLogger(ExecUtil.class.getName()).log(Level.INFO, "Thread interrupted while running {0}", processBuilder.command().get(0)); // NON-NLS
Thread.currentThread().interrupt();
}
return process.exitValue();
@@ -238,26 +220,15 @@ public final class ExecUtil {
process.destroyForcibly();
}
} catch (Exception ex) {
- Logger.getLogger(ExecUtil.class.getName()).log(Level.WARNING, "Error occurred when attempting to kill process: {0}", ex.getMessage()); // NON-NLS
+ logger.log(Level.WARNING, "Error occurred when attempting to kill process: {0}", ex.getMessage()); // NON-NLS
}
}
- @Deprecated
private static final Logger logger = Logger.getLogger(ExecUtil.class.getName());
-
- @Deprecated
private Process proc = null;
-
- @Deprecated
private ExecUtil.StreamToStringRedirect errorStringRedirect = null;
-
- @Deprecated
private ExecUtil.StreamToStringRedirect outputStringRedirect = null;
-
- @Deprecated
private ExecUtil.StreamToWriterRedirect outputWriterRedirect = null;
-
- @Deprecated
private int exitValue = -100;
/**
diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/History.java b/Core/src/org/sleuthkit/autopsy/coreutils/History.java
index 87bf0a78e8..d83bb3136f 100644
--- a/Core/src/org/sleuthkit/autopsy/coreutils/History.java
+++ b/Core/src/org/sleuthkit/autopsy/coreutils/History.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2014-18 Basis Technology Corp.
+ * Copyright 2014 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +18,7 @@
*/
package org.sleuthkit.autopsy.coreutils;
+import java.util.Objects;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.ReadOnlyBooleanWrapper;
import javafx.beans.property.ReadOnlyObjectProperty;
@@ -29,11 +30,12 @@ import javax.annotation.concurrent.ThreadSafe;
/**
* A basic history implementation. Keeps a history (and forward) stack of state
- * objects of type T. exposes current state and availability of advance/retreat
- * operations via methods and JFX Property objects. Null is not a valid state,
- * and will only be the current state before the first call to advance.
+ * objects of type T. exposes current state and availability of
+ * advance/retreat operations via methods and JFX Property objects. Null is not
+ * a valid state, and will only be the current state before the first call to
+ * advance.
*
- * @param the type of objects used to represent the
+ * @param T the type of objects used to represent the
* current/historical/future states
*/
@ThreadSafe
@@ -117,21 +119,20 @@ public class History {
}
/**
- * Retreat through the history states by one, and add the current state to
+ * retreat through the history states by one, and add the current state to
* the forward states. Is a no-op if there are no history states.
*
* @return the state retreated to, or null if there were no history states.
*/
synchronized public T retreat() {
final T pop = historyStack.pop();
- if (pop != null) {
- if (pop.equals(currentState.get())) {
- return retreat();
- } else {
- forwardStack.push(currentState.get());
- currentState.set(pop);
- return pop;
- }
+
+ if (pop != null && pop.equals(currentState.get()) == false) {
+ forwardStack.push(currentState.get());
+ currentState.set(pop);
+ return pop;
+ } else if (pop != null && pop.equals(currentState.get())) {
+ return retreat();
}
return pop;
}
@@ -146,7 +147,7 @@ public class History {
* @throws IllegalArgumentException if newState == null
*/
synchronized public void advance(T newState) throws IllegalArgumentException {
- if (newState != null && newState.equals(currentState.get()) == false) {
+ if (newState != null && Objects.equals(currentState.get(), newState) == false) {
if (currentState.get() != null) {
historyStack.push(currentState.get());
}
diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/SQLiteDBConnect.java b/Core/src/org/sleuthkit/autopsy/coreutils/SQLiteDBConnect.java
index d6c9097cd3..ada674433a 100644
--- a/Core/src/org/sleuthkit/autopsy/coreutils/SQLiteDBConnect.java
+++ b/Core/src/org/sleuthkit/autopsy/coreutils/SQLiteDBConnect.java
@@ -1,19 +1,19 @@
-/*
+ /*
*
* Autopsy Forensic Browser
- *
- * Copyright 2012-2018 Basis Technology Corp.
- *
+ *
+ * Copyright 2012 Basis Technology Corp.
+ *
* Copyright 2012 42six Solutions.
* Contact: aebadirad 42six com
* Project Contact/Architect: carrier sleuthkit org
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,12 +27,12 @@ import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
-import java.util.logging.Level;
+import org.sleuthkit.autopsy.coreutils.Logger;
/**
- * Database connection class & utilities.
+ * Database connection class & utilities *
*/
-public class SQLiteDBConnect implements AutoCloseable {
+public class SQLiteDBConnect {
public String sDriver = "";
public String sUrl = null;
@@ -52,7 +52,7 @@ public class SQLiteDBConnect implements AutoCloseable {
* quick and dirty constructor to test the database passing the
* DriverManager name and the fully loaded url to handle
*/
- /*
+ /*
* NB this will typically be available if you make this class concrete and
* not abstract
*/
@@ -104,13 +104,9 @@ public class SQLiteDBConnect implements AutoCloseable {
statement.executeUpdate(instruction);
}
- /** processes an array of instructions e.g. a set of SQL command strings
- * passed from a file
- *
- * NB you should ensure you either handle empty lines in files by either
- * removing them or parsing them out since they will generate spurious
- * SQLExceptions when they are encountered during the iteration....
- */
+// processes an array of instructions e.g. a set of SQL command strings passed from a file
+//NB you should ensure you either handle empty lines in files by either removing them or parsing them out
+// since they will generate spurious SQLExceptions when they are encountered during the iteration....
public void executeStmt(String[] instructionSet) throws SQLException {
for (int i = 0; i < instructionSet.length; i++) {
executeStmt(instructionSet[i]);
@@ -124,14 +120,7 @@ public class SQLiteDBConnect implements AutoCloseable {
public void closeConnection() {
try {
conn.close();
- } catch (SQLException ex) {
- logger.log(Level.WARNING, "Unable to close connection to SQLite DB at " + sUrl, ex);
+ } catch (Exception ignore) {
}
- //Implementing Autoclosable.close() allows this class to be used in try-with-resources.
- }
-
- @Override
- public void close() {
- closeConnection();
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED
index 2998a198a0..c11a681494 100755
--- a/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED
@@ -258,10 +258,10 @@ ImageNode.getActions.viewInNewWin.text=View in New Window
ImageNode.createSheet.name.name=Name
ImageNode.createSheet.name.displayName=Name
ImageNode.createSheet.name.desc=no description
-Installer.exception.tskVerStringNull.msg=Sleuth Kit JNI test call returned without error, but version string was null!
-Installer.exception.taskVerStringBang.msg=Sleuth Kit JNI test call returned without error, but version string was ""!
-Installer.tskLibErr.msg=Problem with Sleuth Kit JNI. Test call failed!\n\nDetails: {0}
-Installer.tskLibErr.err=Fatal Error!
+Installer.exception.tskVerStringNull.msg=Sleuth Kit JNI test call returned without error, but version string was null\!
+Installer.exception.taskVerStringBang.msg=Sleuth Kit JNI test call returned without error, but version string was ""\!
+Installer.tskLibErr.msg=Problem with Sleuth Kit JNI. Test call failed\!\n\nDetails: {0}
+Installer.tskLibErr.err=Fatal Error\!
InterestingHits.interestingItems.text=INTERESTING ITEMS
InterestingHits.displayName.text=Interesting Items
InterestingHits.createSheet.name.name=Name
diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java
index 1673fd577f..c723d99b55 100644
--- a/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java
+++ b/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNode.java
@@ -51,7 +51,7 @@ public abstract class DisplayableItemNode extends AbstractNode {
*
* @throws TskCoreException
*/
- protected static AbstractFile findLinked(BlackboardArtifact artifact) throws TskCoreException {
+ static AbstractFile findLinked(BlackboardArtifact artifact) throws TskCoreException {
BlackboardAttribute pathIDAttribute = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID));
if (pathIDAttribute != null) {
long contentID = pathIDAttribute.getValueLong();
diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java
index 86289c54f9..4b3694b35f 100644
--- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java
+++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java
@@ -50,7 +50,6 @@ import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHS
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT;
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT;
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT;
-import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_TL_EVENT;
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_DOWNLOAD_SOURCE;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
@@ -147,8 +146,8 @@ public class ExtractedContent implements AutopsyVisitableItem {
return filePath + "gps-search.png"; //NON-NLS
} else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_PROG_RUN.getTypeID()) {
return filePath + "installed.png"; //NON-NLS
- } else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.getTypeID()
- || typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_SUSPECTED.getTypeID()) {
+ } else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.getTypeID() ||
+ typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_SUSPECTED.getTypeID()) {
return filePath + "encrypted-file.png"; //NON-NLS
} else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_EXT_MISMATCH_DETECTED.getTypeID()) {
return filePath + "mismatch-16.png"; //NON-NLS
@@ -238,7 +237,6 @@ public class ExtractedContent implements AutopsyVisitableItem {
doNotShow.add(new BlackboardArtifact.Type(TSK_INTERESTING_ARTIFACT_HIT));
doNotShow.add(new BlackboardArtifact.Type(TSK_ACCOUNT));
doNotShow.add(new BlackboardArtifact.Type(TSK_DATA_SOURCE_USAGE));
- doNotShow.add(new BlackboardArtifact.Type(TSK_TL_EVENT));
doNotShow.add(new BlackboardArtifact.Type(TSK_DOWNLOAD_SOURCE) );
}
@@ -267,7 +265,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
*/
}
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
- || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
+ || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/**
* This is a stop gap measure until a different way of handling
* the closing of cases is worked out. Currently, remote events
@@ -463,7 +461,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
*/
}
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
- || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
+ || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/**
* Checking for a current case is a stop gap measure until a
* different way of handling the closing of cases is worked
diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java
index b22ad038f3..c80069c7ef 100644
--- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java
+++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java
@@ -46,6 +46,7 @@ import org.openide.util.lookup.Lookups;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.CasePreferences;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
+import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.coreutils.Logger;
import static org.sleuthkit.autopsy.datamodel.Bundle.*;
import org.sleuthkit.autopsy.ingest.IngestManager;
diff --git a/Core/src/org/sleuthkit/autopsy/events/AutopsyEventPublisher.java b/Core/src/org/sleuthkit/autopsy/events/AutopsyEventPublisher.java
index fd52d6241c..02a5d2e2ab 100644
--- a/Core/src/org/sleuthkit/autopsy/events/AutopsyEventPublisher.java
+++ b/Core/src/org/sleuthkit/autopsy/events/AutopsyEventPublisher.java
@@ -173,10 +173,6 @@ public final class AutopsyEventPublisher {
stopRemotePublisher();
++tryCount;
}
- catch(RuntimeException ex) {
- logger.log(Level.SEVERE, String.format("Runtime exception in attempting to publish %s using channel %s", event.getPropertyName(), currentChannelName), ex); //NON-NLS
- break;
- }
}
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java
index 152df6f55f..9a1bd96cc7 100644
--- a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java
@@ -34,10 +34,13 @@ import java.util.logging.Level;
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.Services;
import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleProgress;
import org.sleuthkit.autopsy.ingest.IngestModule;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
+import org.sleuthkit.datamodel.FsContent;
+import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.DataSourceIngestModule;
diff --git a/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java
index b3042fb4a5..188d76acde 100644
--- a/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/examples/SampleFileIngestModule.java
@@ -1,16 +1,16 @@
/*
* Sample module in the public domain. Feel free to use this as a template
* for your modules.
- *
+ *
* Contact: Brian Carrier [carrier sleuthkit [dot] org]
*
* This is free and unencumbered software released into the public domain.
- *
+ *
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
- *
+ *
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
@@ -18,31 +18,34 @@
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
+ * OTHER DEALINGS IN THE SOFTWARE.
*/
package org.sleuthkit.autopsy.examples;
import java.util.HashMap;
import java.util.logging.Level;
+import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.FileIngestModule;
+import org.sleuthkit.autopsy.ingest.IngestModule;
import org.sleuthkit.autopsy.ingest.IngestJobContext;
import org.sleuthkit.autopsy.ingest.IngestMessage;
-import org.sleuthkit.autopsy.ingest.IngestModule;
-import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.autopsy.ingest.IngestServices;
+import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
+import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.datamodel.AbstractFile;
-import org.sleuthkit.datamodel.Blackboard;
import org.sleuthkit.datamodel.BlackboardArtifact;
+import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.TskCoreException;
+import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskData;
/**
@@ -53,7 +56,7 @@ import org.sleuthkit.datamodel.TskData;
class SampleFileIngestModule implements FileIngestModule {
private static final HashMap artifactCountsForIngestJobs = new HashMap<>();
- private static final BlackboardAttribute.ATTRIBUTE_TYPE ATTR_TYPE = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COUNT;
+ private static BlackboardAttribute.ATTRIBUTE_TYPE attrType = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COUNT;
private final boolean skipKnownFiles;
private IngestJobContext context = null;
private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter();
@@ -73,8 +76,8 @@ class SampleFileIngestModule implements FileIngestModule {
// Skip anything other than actual file system files.
if ((file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
- || (file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)
- || (file.isFile() == false)) {
+ || (file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)
+ || (file.isFile() == false)) {
return IngestModule.ProcessResult.OK;
}
@@ -98,7 +101,7 @@ class SampleFileIngestModule implements FileIngestModule {
// Make an attribute using the ID for the attribute attrType that
// was previously created.
- BlackboardAttribute attr = new BlackboardAttribute(ATTR_TYPE, SampleIngestModuleFactory.getModuleName(), count);
+ BlackboardAttribute attr = new BlackboardAttribute(attrType, SampleIngestModuleFactory.getModuleName(), count);
// Add the to the general info artifact for the file. In a
// real module, you would likely have more complex data types
@@ -110,15 +113,13 @@ class SampleFileIngestModule implements FileIngestModule {
// management of shared data.
addToBlackboardPostCount(context.getJobId(), 1L);
- /*
- * post the artifact which will index the artifact for keyword
- * search, and fire an event to notify UI of this new artifact
- */
- file.getSleuthkitCase().getBlackboard().postArtifact(art, SampleIngestModuleFactory.getModuleName());
+ // Fire an event to notify any listeners for blackboard postings.
+ ModuleDataEvent event = new ModuleDataEvent(SampleIngestModuleFactory.getModuleName(), ARTIFACT_TYPE.TSK_GEN_INFO);
+ IngestServices.getInstance().fireModuleDataEvent(event);
return IngestModule.ProcessResult.OK;
- } catch (TskCoreException | Blackboard.BlackboardException ex) {
+ } catch (TskCoreException ex) {
IngestServices ingestServices = IngestServices.getInstance();
Logger logger = ingestServices.getLogger(SampleIngestModuleFactory.getModuleName());
logger.log(Level.SEVERE, "Error processing file (id = " + file.getId() + ")", ex);
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties-MERGED
index 7ab8ecbe04..08cc69c39c 100755
--- a/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties-MERGED
@@ -14,7 +14,7 @@ KnownStatusSearchPanel.knownCheckBox.text=Known Status:
KnownStatusSearchPanel.knownBadOptionCheckBox.text=Notable
KnownStatusSearchPanel.knownOptionCheckBox.text=Known (NSRL or other)
KnownStatusSearchPanel.unknownOptionCheckBox.text=Unknown
-DateSearchFilter.noneSelectedMsg.text=At least one date type must be selected!
+DateSearchFilter.noneSelectedMsg.text=At least one date type must be selected\!
DateSearchPanel.dateCheckBox.text=Date:
DateSearchPanel.jLabel4.text=Timezone:
DateSearchPanel.jLabel3.text=*The date format is mm/dd/yyyy
@@ -56,7 +56,7 @@ FileSearchPanel.search.results.details=Large number of matches may impact perfor
FileSearchPanel.search.exception.noFilterSelected.msg=At least one filter must be selected.
FileSearchPanel.search.validationErr.msg=Validation Error: {0}
FileSearchPanel.emptyWhereClause.text=Invalid options, nothing to show.
-KnownStatusSearchFilter.noneSelectedMsg.text=At least one known status must be selected!
+KnownStatusSearchFilter.noneSelectedMsg.text=At least one known status must be selected\!
NameSearchFilter.emptyNameMsg.text=Must enter something for name search.
SearchNode.getName.text=Search Result
SizeSearchPanel.sizeCompareComboBox.equalTo=equal to
diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED
index 6be3e48e71..9e4f612b6b 100755
--- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED
@@ -140,7 +140,7 @@ IngestJob.cancelReason.outOfDiskSpace.text=Out of disk space
IngestJob.cancelReason.servicesDown.text=Services Down
IngestJob.cancelReason.caseClosed.text=Case closed
IngestJobSettingsPanel.globalSettingsButton.text=Global Settings
-gest=
+gest
IngestJobSettingsPanel.globalSettingsButton.actionCommand=Advanced
IngestJobSettingsPanel.globalSettingsButton.text=Global Settings
IngestJobSettingsPanel.pastJobsButton.text=History
diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java
index 521a2d2903..8216d66528 100644
--- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java
+++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2014-2019 Basis Technology Corp.
+ * Copyright 2014-2018 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,7 +32,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.Set;
import java.util.logging.Level;
import org.openide.util.NbBundle;
import org.openide.util.io.NbObjectInputStream;
@@ -312,10 +311,11 @@ public final class IngestJobSettings {
* Get the ingest module factories discovered by the ingest module
* loader.
*/
+ List moduleFactories = new ArrayList<>();
List allModuleFactories = IngestModuleFactoryLoader.getIngestModuleFactories();
+ HashSet loadedModuleNames = new HashSet<>();
// Add modules that are going to be used for this ingest depending on type.
- List moduleFactories = new ArrayList<>();
for (IngestModuleFactory moduleFactory : allModuleFactories) {
if (this.ingestType.equals(IngestType.ALL_MODULES)) {
moduleFactories.add(moduleFactory);
@@ -326,21 +326,15 @@ public final class IngestJobSettings {
}
}
- /**
- * Make set of module names, and a set of names of modules that are
- * enabled by default.
- */
- Set defaultEnabledModuleNames = new HashSet<>();
- Set loadedModuleNames = new HashSet<>();
for (IngestModuleFactory moduleFactory : moduleFactories) {
loadedModuleNames.add(moduleFactory.getModuleDisplayName());
- if (moduleFactory.isEnabledByDefault()) {
- defaultEnabledModuleNames.add(moduleFactory.getModuleDisplayName());
- }
}
- /** Get the enabled/disabled ingest modules settings for this context. */
- HashSet enabledModuleNames = getModulesNames(executionContext, IngestJobSettings.ENABLED_MODULES_PROPERTY, makeCsvList(defaultEnabledModuleNames));
+ /**
+ * Get the enabled/disabled ingest modules settings for this context. By
+ * default, all loaded modules are enabled.
+ */
+ HashSet enabledModuleNames = getModulesNames(executionContext, IngestJobSettings.ENABLED_MODULES_PROPERTY, makeCsvList(loadedModuleNames));
HashSet disabledModuleNames = getModulesNames(executionContext, IngestJobSettings.DISABLED_MODULES_PROPERTY, ""); //NON-NLS
/**
@@ -377,17 +371,11 @@ public final class IngestJobSettings {
} else if (disabledModuleNames.contains(moduleName)) {
moduleTemplate.setEnabled(false);
} else {
- /**
- * The module factory was loaded, but the module name does not
- * appear in the enabled/disabled module settings. Treat the
- * module as a new module and use its default enabled state.
- */
- moduleTemplate.setEnabled(moduleFactory.isEnabledByDefault());
- if (moduleFactory.isEnabledByDefault()) {
- enabledModuleNames.add(moduleName);
- } else {
- disabledModuleNames.add(moduleName);
- }
+ // The module factory was loaded, but the module name does not
+ // appear in the enabled/disabled module settings. Treat the
+ // module as a new module and enable it by default.
+ moduleTemplate.setEnabled(true);
+ enabledModuleNames.add(moduleName);
}
this.moduleTemplates.add(moduleTemplate);
}
@@ -527,7 +515,7 @@ public final class IngestJobSettings {
* @return The file path.
*/
private String getModuleSettingsFilePath(IngestModuleFactory factory) {
- String fileName = FactoryClassNameNormalizer.normalize(factory.getClass().getCanonicalName()) + IngestJobSettings.MODULE_SETTINGS_FILE_EXT;
+ String fileName = FactoryClassNameNormalizer.normalize(factory.getClass().getCanonicalName()) + IngestJobSettings.MODULE_SETTINGS_FILE_EXT;
Path path = Paths.get(this.moduleSettingsFolderPath, fileName);
return path.toAbsolutePath().toString();
}
@@ -588,7 +576,15 @@ public final class IngestJobSettings {
if (collection == null || collection.isEmpty()) {
return "";
}
- return String.join(", ", collection);
+
+ ArrayList list = new ArrayList<>();
+ list.addAll(collection);
+ StringBuilder csvList = new StringBuilder();
+ for (int i = 0; i < list.size() - 1; ++i) {
+ csvList.append(list.get(i)).append(", ");
+ }
+ csvList.append(list.get(list.size() - 1));
+ return csvList.toString();
}
/**
diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java
index 2244a4c99b..5b522d552a 100644
--- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java
+++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactory.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2011-2019 Basis Technology Corp.
+ * Copyright 2011-2016 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -240,16 +240,4 @@ public interface IngestModuleFactory {
* @return A file ingest module instance.
*/
FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings);
-
- /**
- * Queries if the module this factory creates is enabled to run during
- * ingest by default. A module might be disabled by default if is very
- * specialized or takes a very long time to run during ingest.
- *
- * @return True if the module created by this factory is be enabled, by
- * default, to run during ingest.
- */
- default boolean isEnabledByDefault() {
- return true;
- }
}
diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java
index 3117ef2f98..386326df10 100644
--- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java
+++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java
@@ -104,13 +104,9 @@ public final class IngestServices {
*
* @param moduleDataEvent A module data event, i.e., an event that
* encapsulates artifact data.
- *
- * @deprecated use org.sleuthkit.datamodel.Blackboard.postArtifact instead.
*/
- @Deprecated
public void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
IngestManager.getInstance().fireIngestModuleDataEvent(moduleDataEvent);
-
}
/**
@@ -174,7 +170,10 @@ public final class IngestServices {
* Sets all of the global configuration settings for an ingest module.
*
* @param moduleName A unique identifier for the module.
+ *
+ * @param moduleName moduleName identifier unique to that module
* @param settings A mapping of setting names to setting values.
+ *
*/
public void setConfigSettings(String moduleName, Map settings) {
ModuleSettings.setConfigSettings(moduleName, settings);
diff --git a/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java
index c463fd69ec..d78169e251 100644
--- a/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java
+++ b/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java
@@ -53,7 +53,7 @@ public class ModuleDataEvent extends ChangeEvent {
private Collection artifacts;
/**
- * @param moduleName Module name
+ * @param moduleName Module name
* @param artifactType Type of artifact that was posted to blackboard
*/
public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType) {
@@ -63,9 +63,9 @@ public class ModuleDataEvent extends ChangeEvent {
}
/**
- * @param moduleName Module Name
+ * @param moduleName Module Name
* @param blackboardArtifactType Type of the blackboard artifact posted to
- * the blackboard
+ * the blackboard
*/
public ModuleDataEvent(String moduleName, BlackboardArtifact.Type blackboardArtifactType) {
super(blackboardArtifactType);
@@ -74,10 +74,10 @@ public class ModuleDataEvent extends ChangeEvent {
}
/**
- * @param moduleName Module name
+ * @param moduleName Module name
* @param blackboardArtifactType Type of artifact posted to the blackboard
- * @param artifacts List of specific artifact ID values that
- * were added to blackboard
+ * @param artifacts List of specific artifact ID values that were added to
+ * blackboard
*/
public ModuleDataEvent(String moduleName, BlackboardArtifact.Type blackboardArtifactType, Collection artifacts) {
this(moduleName, blackboardArtifactType);
@@ -85,10 +85,10 @@ public class ModuleDataEvent extends ChangeEvent {
}
/**
- * @param moduleName Module name
+ * @param moduleName Module name
* @param artifactType Type of artifact that was posted to blackboard
- * @param artifacts List of specific artifact values that were added to
- * blackboard
+ * @param artifacts List of specific artifact values that were added to
+ * blackboard
*/
public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType, Collection artifacts) {
this(moduleName, artifactType);
diff --git a/Core/src/org/sleuthkit/autopsy/modules/dataSourceIntegrity/DataSourceIntegrityIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/dataSourceIntegrity/DataSourceIntegrityIngestModule.java
index ab59812ac0..34a7ec2702 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/dataSourceIntegrity/DataSourceIntegrityIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/dataSourceIntegrity/DataSourceIntegrityIngestModule.java
@@ -21,14 +21,10 @@ package org.sleuthkit.autopsy.modules.dataSourceIntegrity;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import javax.xml.bind.DatatypeConverter;
-import org.openide.util.Exceptions;
-import org.openide.util.NbBundle;
-import org.sleuthkit.autopsy.casemodule.Case;
-import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
+import java.util.Arrays;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.DataSourceIngestModule;
import org.sleuthkit.autopsy.ingest.DataSourceIngestModuleProgress;
@@ -37,19 +33,20 @@ import org.sleuthkit.autopsy.ingest.IngestMessage;
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
-import org.sleuthkit.datamodel.Blackboard;
-import org.sleuthkit.datamodel.BlackboardArtifact;
-import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.TskCoreException;
+import org.openide.util.NbBundle;
+import org.sleuthkit.autopsy.casemodule.Case;
+import org.sleuthkit.datamodel.BlackboardArtifact;
+import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.TskDataException;
/**
* Data source ingest module that verifies the integrity of an Expert Witness
* Format (EWF) E01 image file by generating a hash of the file and comparing it
- * to the value stored in the image. Will also generate hashes for any
- * image-type data source that has none.
+ * to the value stored in the image. Will also generate hashes for any image-type
+ * data source that has none.
*/
public class DataSourceIntegrityIngestModule implements DataSourceIngestModule {
@@ -59,12 +56,11 @@ public class DataSourceIntegrityIngestModule implements DataSourceIngestModule {
private final boolean computeHashes;
private final boolean verifyHashes;
-
+
private final List hashDataList = new ArrayList<>();
-
+
private IngestJobContext context;
- private Blackboard blackboard;
-
+
DataSourceIntegrityIngestModule(DataSourceIntegrityIngestSettings settings) {
computeHashes = settings.shouldComputeHashes();
verifyHashes = settings.shouldVerifyHashes();
@@ -76,13 +72,13 @@ public class DataSourceIntegrityIngestModule implements DataSourceIngestModule {
@Override
public void startUp(IngestJobContext context) throws IngestModuleException {
this.context = context;
-
+
// It's an error if the module is run without either option selected
if (!(computeHashes || verifyHashes)) {
throw new IngestModuleException(Bundle.DataSourceIntegrityIngestModule_startup_noCheckboxesSelected());
}
}
-
+
@NbBundle.Messages({
"# {0} - imageName",
"DataSourceIntegrityIngestModule.process.skipCompute=Not computing new hashes for {0} since the option was disabled",
@@ -101,29 +97,23 @@ public class DataSourceIntegrityIngestModule implements DataSourceIngestModule {
"# {1} - calculatedHashValue",
"DataSourceIntegrityIngestModule.process.calcHashWithType=