mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
to be merged
This commit is contained in:
parent
5dc87cc906
commit
e52591abba
@ -80,7 +80,7 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel impleme
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final String FEATURE_NAME = "Save Keyword List";
|
||||
KeywordSearchListsXML writer = KeywordSearchListsXML.getCurrent();
|
||||
KeywordSearchList currentKeywordList = editListPanel.getCurrentKeywordList();
|
||||
KeywordSearchListsAbstract.KeywordSearchList currentKeywordList = editListPanel.getCurrentKeywordList();
|
||||
|
||||
List<Keyword> keywords = currentKeywordList.getKeywords();
|
||||
if (keywords.isEmpty()) {
|
||||
|
@ -57,7 +57,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
|
||||
private static Logger logger = Logger.getLogger(KeywordSearchEditListPanel.class.getName());
|
||||
private KeywordTableModel tableModel;
|
||||
private KeywordSearchList currentKeywordList;
|
||||
private KeywordSearchListsAbstract.KeywordSearchList currentKeywordList;
|
||||
|
||||
|
||||
private boolean ingestRunning;
|
||||
@ -608,7 +608,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
|
||||
KeywordSearchListsXML reader = KeywordSearchListsXML.getCurrent();
|
||||
|
||||
List<KeywordSearchList> toWrite = new ArrayList<KeywordSearchList>();
|
||||
List<KeywordSearchListsAbstract.KeywordSearchList> toWrite = new ArrayList<KeywordSearchListsAbstract.KeywordSearchList>();
|
||||
toWrite.add(reader.getList(currentKeywordList.getName()));
|
||||
final KeywordSearchListsXML exporter = new KeywordSearchListsXML(fileAbs);
|
||||
boolean written = exporter.saveLists(toWrite);
|
||||
@ -693,11 +693,11 @@ private void useForIngestCheckboxActionPerformed(java.awt.event.ActionEvent evt)
|
||||
// Implemented by parent panel
|
||||
}
|
||||
|
||||
KeywordSearchList getCurrentKeywordList() {
|
||||
KeywordSearchListsAbstract.KeywordSearchList getCurrentKeywordList() {
|
||||
return currentKeywordList;
|
||||
}
|
||||
|
||||
void setCurrentKeywordList(KeywordSearchList list) {
|
||||
void setCurrentKeywordList(KeywordSearchListsAbstract.KeywordSearchList list) {
|
||||
currentKeywordList = list;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
private volatile boolean runSearcher = false; //whether to run searcher next time
|
||||
private List<Keyword> keywords; //keywords to search
|
||||
private List<String> keywordLists; // lists currently being searched
|
||||
private Map<String, KeywordSearchList> keywordToList; //keyword to list name mapping
|
||||
private Map<String, KeywordSearchListsAbstract.KeywordSearchList> keywordToList; //keyword to list name mapping
|
||||
private Timer commitTimer;
|
||||
private Timer searchTimer;
|
||||
private Indexer indexer;
|
||||
@ -380,7 +380,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
|
||||
keywords = new ArrayList<Keyword>();
|
||||
keywordLists = new ArrayList<String>();
|
||||
keywordToList = new HashMap<String, KeywordSearchList>();
|
||||
keywordToList = new HashMap<String, KeywordSearchListsAbstract.KeywordSearchList>();
|
||||
|
||||
initKeywords();
|
||||
|
||||
@ -566,7 +566,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for (KeywordSearchList list : loader.getListsL()) {
|
||||
for (KeywordSearchListsAbstract.KeywordSearchList list : loader.getListsL()) {
|
||||
final String listName = list.getName();
|
||||
if (list.getUseForIngest() == true
|
||||
|| (listsToAdd != null && listsToAdd.contains(listName))) {
|
||||
@ -798,7 +798,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
*/
|
||||
private List<Keyword> keywords; //keywords to search
|
||||
private List<String> keywordLists; // lists currently being searched
|
||||
private Map<String, KeywordSearchList> keywordToList; //keyword to list name mapping
|
||||
private Map<String, KeywordSearchListsAbstract.KeywordSearchList> keywordToList; //keyword to list name mapping
|
||||
private AggregateProgressHandle progressGroup;
|
||||
private final Logger logger = Logger.getLogger(Searcher.class.getName());
|
||||
private boolean finalRun = false;
|
||||
@ -806,7 +806,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
Searcher(List<String> keywordLists) {
|
||||
this.keywordLists = new ArrayList<String>(keywordLists);
|
||||
this.keywords = new ArrayList<Keyword>();
|
||||
this.keywordToList = new HashMap<String, KeywordSearchList>();
|
||||
this.keywordToList = new HashMap<String, KeywordSearchListsAbstract.KeywordSearchList>();
|
||||
//keywords are populated as searcher runs
|
||||
}
|
||||
|
||||
@ -874,7 +874,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
}
|
||||
|
||||
final String queryStr = keywordQuery.getQuery();
|
||||
final KeywordSearchList list = keywordToList.get(queryStr);
|
||||
final KeywordSearchListsAbstract.KeywordSearchList list = keywordToList.get(queryStr);
|
||||
final String listName = list.getName();
|
||||
|
||||
//new subProgress will be active after the initial query
|
||||
@ -1110,7 +1110,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
this.keywordToList.clear();
|
||||
|
||||
for (String name : this.keywordLists) {
|
||||
KeywordSearchList list = loader.getList(name);
|
||||
KeywordSearchListsAbstract.KeywordSearchList list = loader.getList(name);
|
||||
for (Keyword k : list.getKeywords()) {
|
||||
this.keywords.add(k);
|
||||
this.keywordToList.put(k.getQuery(), list);
|
||||
|
@ -38,12 +38,12 @@ public class KeywordSearchIngestSimplePanel extends javax.swing.JPanel {
|
||||
private final static Logger logger = Logger.getLogger(KeywordSearchIngestSimplePanel.class.getName());
|
||||
public static final String PROP_OPTIONS = "Keyword Search_Options";
|
||||
private KeywordTableModel tableModel;
|
||||
private List<KeywordSearchList> lists;
|
||||
private List<KeywordSearchListsAbstract.KeywordSearchList> lists;
|
||||
|
||||
/** Creates new form KeywordSearchIngestSimplePanel */
|
||||
public KeywordSearchIngestSimplePanel() {
|
||||
tableModel = new KeywordTableModel();
|
||||
lists = new ArrayList<KeywordSearchList>();
|
||||
lists = new ArrayList<KeywordSearchListsAbstract.KeywordSearchList>();
|
||||
reloadLists();
|
||||
initComponents();
|
||||
customizeComponents();
|
||||
@ -222,7 +222,7 @@ public class KeywordSearchIngestSimplePanel extends javax.swing.JPanel {
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
KeywordSearchList list = KeywordSearchIngestSimplePanel.this.lists.get(rowIndex);
|
||||
KeywordSearchListsAbstract.KeywordSearchList list = KeywordSearchIngestSimplePanel.this.lists.get(rowIndex);
|
||||
if(columnIndex == 0) {
|
||||
return list.getUseForIngest();
|
||||
} else {
|
||||
@ -238,7 +238,7 @@ public class KeywordSearchIngestSimplePanel extends javax.swing.JPanel {
|
||||
@Override
|
||||
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
|
||||
|
||||
KeywordSearchList list = KeywordSearchIngestSimplePanel.this.lists.get(rowIndex);
|
||||
KeywordSearchListsAbstract.KeywordSearchList list = KeywordSearchIngestSimplePanel.this.lists.get(rowIndex);
|
||||
if(columnIndex == 0){
|
||||
KeywordSearchListsXML loader = KeywordSearchListsXML.getCurrent();
|
||||
loader.addList(list.getName(), list.getKeywords(), (Boolean) aValue, false);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@
|
||||
<Component id="importButton" min="-2" pref="126" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="4" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
|
@ -243,12 +243,12 @@ class KeywordSearchListsManagementPanel extends javax.swing.JPanel implements Op
|
||||
return;
|
||||
}
|
||||
|
||||
List<KeywordSearchList> toImport = reader.getListsL();
|
||||
List<KeywordSearchList> toImportConfirmed = new ArrayList<KeywordSearchList>();
|
||||
List<KeywordSearchListsAbstract.KeywordSearchList> toImport = reader.getListsL();
|
||||
List<KeywordSearchListsAbstract.KeywordSearchList> toImportConfirmed = new ArrayList<KeywordSearchListsAbstract.KeywordSearchList>();
|
||||
|
||||
final KeywordSearchListsXML writer = KeywordSearchListsXML.getCurrent();
|
||||
|
||||
for (KeywordSearchList list : toImport) {
|
||||
for (KeywordSearchListsAbstract.KeywordSearchList list : toImport) {
|
||||
//check name collisions
|
||||
if (writer.listExists(list.getName())) {
|
||||
Object[] options = {"Yes, overwrite",
|
||||
|
@ -105,7 +105,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource();
|
||||
if (!listSelectionModel.isSelectionEmpty()) {
|
||||
int index = listSelectionModel.getMinSelectionIndex();
|
||||
KeywordSearchList list = listsTableModel.getListAt(index);
|
||||
KeywordSearchListsAbstract.KeywordSearchList list = listsTableModel.getListAt(index);
|
||||
keywordsTableModel.resync(list);
|
||||
} else {
|
||||
keywordsTableModel.deleteAll();
|
||||
@ -307,13 +307,13 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
@Override
|
||||
public List<Keyword> getQueryList() {
|
||||
List<Keyword> ret = new ArrayList<Keyword>();
|
||||
for (KeywordSearchList list : getSelectedLists()) {
|
||||
for (KeywordSearchListsAbstract.KeywordSearchList list : getSelectedLists()) {
|
||||
ret.addAll(list.getKeywords());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<KeywordSearchList> getSelectedLists() {
|
||||
private List<KeywordSearchListsAbstract.KeywordSearchList> getSelectedLists() {
|
||||
return listsTableModel.getSelectedListsL();
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
return ret;
|
||||
}
|
||||
|
||||
KeywordSearchList getListAt(int rowIndex) {
|
||||
KeywordSearchListsAbstract.KeywordSearchList getListAt(int rowIndex) {
|
||||
return listsHandle.getList((String) getValueAt(rowIndex, 1));
|
||||
}
|
||||
|
||||
@ -441,8 +441,8 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<KeywordSearchList> getSelectedListsL() {
|
||||
List<KeywordSearchList> ret = new ArrayList<KeywordSearchList>();
|
||||
List<KeywordSearchListsAbstract.KeywordSearchList> getSelectedListsL() {
|
||||
List<KeywordSearchListsAbstract.KeywordSearchList> ret = new ArrayList<KeywordSearchListsAbstract.KeywordSearchList>();
|
||||
for (String s : getSelectedLists()) {
|
||||
ret.add(listsHandle.getList(s));
|
||||
}
|
||||
@ -462,8 +462,8 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
}
|
||||
|
||||
//add lists to the model
|
||||
private void addLists(List<KeywordSearchList> lists) {
|
||||
for (KeywordSearchList list : lists) {
|
||||
private void addLists(List<KeywordSearchListsAbstract.KeywordSearchList> lists) {
|
||||
for (KeywordSearchListsAbstract.KeywordSearchList list : lists) {
|
||||
if (!listExists(list.getName())) {
|
||||
listData.add(new ListTableEntry(list, ingestRunning));
|
||||
}
|
||||
@ -476,7 +476,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
String name;
|
||||
Boolean selected;
|
||||
|
||||
ListTableEntry(KeywordSearchList list, boolean ingestRunning) {
|
||||
ListTableEntry(KeywordSearchListsAbstract.KeywordSearchList list, boolean ingestRunning) {
|
||||
this.name = list.getName();
|
||||
if (ingestRunning) {
|
||||
this.selected = list.getUseForIngest();
|
||||
@ -558,7 +558,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
return getValueAt(0, c).getClass();
|
||||
}
|
||||
|
||||
void resync(KeywordSearchList list) {
|
||||
void resync(KeywordSearchListsAbstract.KeywordSearchList list) {
|
||||
listData.clear();
|
||||
for (Keyword k : list.getKeywords()) {
|
||||
listData.add(new KeywordTableEntry(k));
|
||||
|
@ -236,7 +236,7 @@ public class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
||||
|
||||
//get listname
|
||||
String listName = "";
|
||||
KeywordSearchList list = KeywordSearchListsXML.getCurrent().getListWithKeyword(tcq.getQueryString());
|
||||
KeywordSearchListsAbstract.KeywordSearchList list = KeywordSearchListsXML.getCurrent().getListWithKeyword(tcq.getQueryString());
|
||||
if (list != null) {
|
||||
listName = list.getName();
|
||||
}
|
||||
|
@ -15,6 +15,15 @@
|
||||
<specification-version>5.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.sleuthkit.autopsy.keywordsearch</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>5</release-version>
|
||||
<specification-version>3.0</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<test-dependencies>
|
||||
<test-type>
|
||||
|
@ -52,6 +52,7 @@ import org.netbeans.jemmy.operators.JTableOperator;
|
||||
import org.netbeans.jemmy.operators.JTextFieldOperator;
|
||||
import org.netbeans.junit.NbModuleSuite;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.autopsy.keywordsearch.*;
|
||||
/**
|
||||
* This test expects the following system properties to be set:
|
||||
* img_path: The fully qualified path to the image file (if split, the first file)
|
||||
@ -207,6 +208,8 @@ public class RegressionTest extends TestCase{
|
||||
logger.info("Search Configure");
|
||||
JDialog jd = JDialogOperator.waitJDialog("Advanced Keyword Search Configuration", false, false);
|
||||
JDialogOperator jdo = new JDialogOperator(jd);
|
||||
KeywordSearchListsXML curr = KeywordSearchListsXML.getCurrent();
|
||||
curr.theLists.get("URLs").setUseForIngest(true);
|
||||
String words = System.getProperty("keyword_path");
|
||||
JButtonOperator jbo0 = new JButtonOperator(jdo, "Import List", 0);
|
||||
jbo0.pushNoBlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user