Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
KeywordSearchModuleFactory.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2014-2021 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.keywordsearch;
20
21import java.util.ArrayList;
22import java.util.Arrays;
23import java.util.HashSet;
24import java.util.List;
25import org.openide.util.NbBundle;
26import org.openide.util.lookup.ServiceProvider;
27import org.sleuthkit.autopsy.coreutils.Version;
28import org.sleuthkit.autopsy.ingest.AnalysisResultIngestModule;
29import org.sleuthkit.autopsy.ingest.DataArtifactIngestModule;
30import org.sleuthkit.autopsy.ingest.FileIngestModule;
31import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
32import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
33import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel;
34import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
35
40@ServiceProvider(service = IngestModuleFactory.class)
42
43 private static final HashSet<String> defaultDisabledKeywordListNames = new HashSet<>(Arrays.asList("Phone Numbers", "IP Addresses", "URLs", "Credit Card Numbers")); //NON-NLS
45
46 @Override
47 public String getModuleDisplayName() {
48 return getModuleName();
49 }
50
51 static String getModuleName() {
52 return NbBundle.getMessage(KeywordSearchIngestModule.class, "KeywordSearchIngestModule.moduleName");
53 }
54
55 @Override
56 public String getModuleDescription() {
57 return NbBundle.getMessage(KeywordSearchIngestModule.class, "KeywordSearchIngestModule.moduleDescription");
58 }
59
60 @Override
61 public String getModuleVersionNumber() {
62 return Version.getVersion();
63 }
64
65 @Override
67 XmlKeywordSearchList listManager = XmlKeywordSearchList.getCurrent();
68 List<String> enabledKeywordLists = new ArrayList<>();
69 List<KeywordList> keywordLists = listManager.getListsL();
70 for (KeywordList keywordList : keywordLists) {
71 if (!defaultDisabledKeywordListNames.contains(keywordList.getName())) {
72 enabledKeywordLists.add(keywordList.getName());
73 }
74 }
75 return new KeywordSearchJobSettings(enabledKeywordLists);
76 }
77
78 @Override
79 public boolean hasIngestJobSettingsPanel() {
80 return true;
81 }
82
83 @Override
85 assert settings instanceof KeywordSearchJobSettings;
86 if (!(settings instanceof KeywordSearchJobSettings)) {
87 throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
88 "KeywordSearchModuleFactory.getIngestJobSettingsPanel.exception.msg"));
89 }
90
91 if (jobSettingsPanel == null) {
93 } else {
95 }
96 return jobSettingsPanel;
97 }
98
99 @Override
100 public boolean hasGlobalSettingsPanel() {
101 return true;
102 }
103
104 @Override
106 KeywordSearchGlobalSettingsPanel globalSettingsPanel = new KeywordSearchGlobalSettingsPanel();
107 globalSettingsPanel.load();
108 return globalSettingsPanel;
109 }
110
111 @Override
112 public boolean isFileIngestModuleFactory() {
113 return true;
114 }
115
116 @Override
118 assert settings instanceof KeywordSearchJobSettings;
119 if (!(settings instanceof KeywordSearchJobSettings)) {
120 throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
121 "KeywordSearchModuleFactory.createFileIngestModule.exception.msg"));
122 }
124 }
125
126 @Override
128 return true;
129 }
130
131 @Override
133 if (!(settings instanceof KeywordSearchJobSettings)) {
134 throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
135 "KeywordSearchModuleFactory.createFileIngestModule.exception.msg"));
136 }
137
139 }
140
141 @Override
143 return true;
144 }
145
146 @Override
148 if (!(settings instanceof KeywordSearchJobSettings)) {
149 throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
150 "KeywordSearchModuleFactory.createFileIngestModule.exception.msg"));
151 }
152
154 }
155
156}
AnalysisResultIngestModule createAnalysisResultIngestModule(IngestModuleIngestJobSettings settings)
IngestModuleIngestJobSettingsPanel getIngestJobSettingsPanel(IngestModuleIngestJobSettings settings)
DataArtifactIngestModule createDataArtifactIngestModule(IngestModuleIngestJobSettings settings)
FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.