From 9fa154a4586051d55c3c20c31988e44ec06f6b4a Mon Sep 17 00:00:00 2001
From: Kelly Kelly <kelly@basistech.com>
Date: Wed, 12 Oct 2022 13:26:00 -0400
Subject: [PATCH] storing changes

---
 .../keywordsearch/KeywordSearchModuleFactory.java  | 14 ++++++++++++--
 .../KwsAnalysisResultIngestModule.java             |  5 +++++
 .../keywordsearch/KwsDataArtifactIngestModule.java |  5 +++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java
index c6b2c39f88..43bbafaf06 100644
--- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java
+++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchModuleFactory.java
@@ -130,7 +130,12 @@ public boolean isDataArtifactIngestModuleFactory() {
 
     @Override
     public DataArtifactIngestModule createDataArtifactIngestModule(IngestModuleIngestJobSettings settings) {
-        return new KwsDataArtifactIngestModule();
+        if (!(settings instanceof KeywordSearchJobSettings)) {
+            throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
+                    "KeywordSearchModuleFactory.createFileIngestModule.exception.msg"));
+        }
+        
+        return new KwsDataArtifactIngestModule((KeywordSearchJobSettings) settings);
     }    
     
     @Override
@@ -140,7 +145,12 @@ public boolean isAnalysisResultIngestModuleFactory() {
  
     @Override
     public AnalysisResultIngestModule createAnalysisResultIngestModule(IngestModuleIngestJobSettings settings) {
-        return new KwsAnalysisResultIngestModule();
+        if (!(settings instanceof KeywordSearchJobSettings)) {
+            throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
+                    "KeywordSearchModuleFactory.createFileIngestModule.exception.msg"));
+        }
+        
+        return new KwsAnalysisResultIngestModule((KeywordSearchJobSettings) settings);
     }    
     
 }
diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsAnalysisResultIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsAnalysisResultIngestModule.java
index b82c4d91fe..26ac018067 100755
--- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsAnalysisResultIngestModule.java
+++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsAnalysisResultIngestModule.java
@@ -41,7 +41,12 @@ public class KwsAnalysisResultIngestModule implements AnalysisResultIngestModule
     private static final int TSK_KEYWORD_HIT_TYPE_ID = BlackboardArtifact.Type.TSK_KEYWORD_HIT.getTypeID();
     private IngestJobContext context;
     private KeywordSearchService searchService;
+    private final KeywordSearchJobSettings settings;
 
+    KwsAnalysisResultIngestModule(KeywordSearchJobSettings settings) {
+        this.settings = settings;
+    }
+    
     @Override
     public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException {
         this.context = context;
diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsDataArtifactIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsDataArtifactIngestModule.java
index fe4cac8b4f..74e81801f6 100755
--- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsDataArtifactIngestModule.java
+++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KwsDataArtifactIngestModule.java
@@ -40,7 +40,12 @@ public class KwsDataArtifactIngestModule implements DataArtifactIngestModule {
     private static final int TSK_ASSOCIATED_OBJECT_TYPE_ID = BlackboardArtifact.Type.TSK_ASSOCIATED_OBJECT.getTypeID();
     private IngestJobContext context;
     private KeywordSearchService searchService;
+    private final KeywordSearchJobSettings settings;
 
+    KwsDataArtifactIngestModule(KeywordSearchJobSettings settings) {
+        this.settings = settings;
+    }
+    
     @Override
     public void startUp(IngestJobContext context) throws IngestModuleException {
         this.context = context;
-- 
GitLab