mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Merge branch 'master' of github.com:sleuthkit/autopsy
This commit is contained in:
commit
92fab86a45
@ -61,11 +61,14 @@ public class IngestImageThread extends SwingWorker<Object,Void> {
|
||||
|
||||
logger.log(Level.INFO, "Starting background processing");
|
||||
|
||||
progress = ProgressHandleFactory.createHandle(service.getName() + " image id:" + image.getId(), new Cancellable() {
|
||||
final String displayName = service.getName() + " image id:" + image.getId();
|
||||
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
logger.log(Level.INFO, "Image ingest service " + service.getName() + " cancelled by user.");
|
||||
if (progress != null)
|
||||
progress.setDisplayName(displayName + " (Cancelling...)");
|
||||
return IngestImageThread.this.cancel(true);
|
||||
}
|
||||
});
|
||||
|
@ -938,11 +938,14 @@ public class IngestManager {
|
||||
}
|
||||
});
|
||||
|
||||
progress = ProgressHandleFactory.createHandle("File Ingest", new Cancellable() {
|
||||
final String displayName = "File Ingest";
|
||||
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
logger.log(Level.INFO, "Filed ingest cancelled by user.");
|
||||
if (progress != null)
|
||||
progress.setDisplayName(displayName + " (Cancelling...)");
|
||||
return IngestFsContentThread.this.cancel(true);
|
||||
}
|
||||
});
|
||||
@ -1073,11 +1076,15 @@ public class IngestManager {
|
||||
|
||||
@Override
|
||||
protected Object doInBackground() throws Exception {
|
||||
progress = ProgressHandleFactory.createHandle("Queueing Ingest", new Cancellable() {
|
||||
|
||||
final String displayName = "Queueing Ingest";
|
||||
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
logger.log(Level.INFO, "Queueing ingest cancelled by user.");
|
||||
if (progress != null)
|
||||
progress.setDisplayName(displayName + " (Cancelling...)");
|
||||
return EnqueueWorker.this.cancel(true);
|
||||
}
|
||||
});
|
||||
|
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.keywordsearch;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.List;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.autopsy.keywordsearch.KeywordSearch.QueryType;
|
||||
import org.sleuthkit.autopsy.keywordsearch.KeywordSearchQueryManager.Presentation;
|
||||
|
||||
@ -77,6 +78,17 @@ abstract class AbstractKeywordSearchPerformer extends javax.swing.JPanel impleme
|
||||
KeywordSearchUtil.displayDialog("Keyword Search Error", "No files are indexed, please index an image before searching", KeywordSearchUtil.DIALOG_MESSAGE_TYPE.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
//check if keyword search service ingest is running (indexing, etc)
|
||||
if (IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault())) {
|
||||
if (KeywordSearchUtil.displayConfirmDialog("Keyword Search Ingest in Progress",
|
||||
"<html>Keyword Search Ingest is currently running.<br />"
|
||||
+ "Not all files have been indexed and this search might yield incomplete results.<br />"
|
||||
+ "Do you want to proceed with this search anyway?</html>"
|
||||
, KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN) == false)
|
||||
return;
|
||||
}
|
||||
|
||||
KeywordSearchQueryManager man = null;
|
||||
if (isMultiwordQuery()) {
|
||||
final List<Keyword> keywords = getQueryList();
|
||||
|
@ -48,3 +48,5 @@ ExtractedContentPanel.pageOfLabel.text=of
|
||||
ExtractedContentPanel.pageCurLabel.text=-
|
||||
ExtractedContentPanel.pageTotalLabel.text=-
|
||||
ExtractedContentPanel.hitLabel.toolTipText=
|
||||
KeywordSearchEditListPanel.ingestMessagesCheckbox.text=Send messages during triage / ingest
|
||||
KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText=Send messages during triage / ingest when hits on keyword from this list occur
|
||||
|
@ -111,12 +111,17 @@
|
||||
<Component id="addKeywordPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="ingestMessagesCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="131" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jScrollPane1" pref="263" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="242" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||
<Component id="addKeywordPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
@ -124,7 +129,9 @@
|
||||
<Component id="deleteWordButton" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="useForIngestCheckbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="ingestMessagesCheckbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -173,6 +180,9 @@
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="KeywordSearchEditListPanel.useForIngestCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="useForIngestCheckboxActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="addKeywordPanel">
|
||||
|
||||
@ -261,6 +271,16 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JCheckBox" name="ingestMessagesCheckbox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="KeywordSearchEditListPanel.ingestMessagesCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/keywordsearch/Bundle.properties" key="KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="saveListButton">
|
||||
|
@ -256,6 +256,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
chRegex.setEnabled(listSet && (!ingestOngoing || !inIngest) && !isLocked);
|
||||
selectorsCombo.setEnabled(listSet && (!ingestOngoing || !inIngest) && !isLocked && chRegex.isSelected());
|
||||
useForIngestCheckbox.setEnabled(listSet && (!ingestOngoing || !inIngest));
|
||||
ingestMessagesCheckbox.setEnabled(useForIngestCheckbox.isEnabled() && useForIngestCheckbox.isSelected());
|
||||
saveListButton.setEnabled(listSet);
|
||||
exportButton.setEnabled(listSet);
|
||||
deleteListButton.setEnabled(listSet && (!ingestOngoing || !inIngest) && !isLocked);
|
||||
@ -295,6 +296,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
addWordField = new javax.swing.JTextField();
|
||||
chRegex = new javax.swing.JCheckBox();
|
||||
selectorsCombo = new javax.swing.JComboBox();
|
||||
ingestMessagesCheckbox = new javax.swing.JCheckBox();
|
||||
saveListButton = new javax.swing.JButton();
|
||||
exportButton = new javax.swing.JButton();
|
||||
deleteListButton = new javax.swing.JButton();
|
||||
@ -332,6 +334,11 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
});
|
||||
|
||||
useForIngestCheckbox.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.useForIngestCheckbox.text")); // NOI18N
|
||||
useForIngestCheckbox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
useForIngestCheckboxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
addWordButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.addWordButton.text")); // NOI18N
|
||||
addWordButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
@ -389,6 +396,9 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
ingestMessagesCheckbox.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.ingestMessagesCheckbox.text")); // NOI18N
|
||||
ingestMessagesCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout listEditorPanelLayout = new javax.swing.GroupLayout(listEditorPanel);
|
||||
listEditorPanel.setLayout(listEditorPanelLayout);
|
||||
listEditorPanelLayout.setHorizontalGroup(
|
||||
@ -404,17 +414,23 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
.addContainerGap(34, Short.MAX_VALUE)
|
||||
.addComponent(addKeywordPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(19, 19, 19))
|
||||
.addGroup(listEditorPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(ingestMessagesCheckbox)
|
||||
.addContainerGap(131, Short.MAX_VALUE))
|
||||
);
|
||||
listEditorPanelLayout.setVerticalGroup(
|
||||
listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, listEditorPanelLayout.createSequentialGroup()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(addKeywordPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(listEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(deleteWordButton)
|
||||
.addComponent(useForIngestCheckbox))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(ingestMessagesCheckbox)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@ -629,6 +645,11 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
private void chRegexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chRegexActionPerformed
|
||||
selectorsCombo.setEnabled(chRegex.isEnabled() && chRegex.isSelected());
|
||||
}//GEN-LAST:event_chRegexActionPerformed
|
||||
|
||||
private void useForIngestCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useForIngestCheckboxActionPerformed
|
||||
ingestMessagesCheckbox.setEnabled(useForIngestCheckbox.isSelected());
|
||||
}//GEN-LAST:event_useForIngestCheckboxActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel addKeywordPanel;
|
||||
private javax.swing.JButton addWordButton;
|
||||
@ -639,6 +660,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
private javax.swing.JButton deleteListButton;
|
||||
private javax.swing.JButton deleteWordButton;
|
||||
private javax.swing.JButton exportButton;
|
||||
private javax.swing.JCheckBox ingestMessagesCheckbox;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
private javax.swing.JTable keywordTable;
|
||||
@ -695,16 +717,18 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
KeywordSearchList oldList = loader.getList(currentKeywordList);
|
||||
List<Keyword> oldKeywords = oldList.getKeywords();
|
||||
boolean oldIngest = oldList.getUseForIngest();
|
||||
boolean oldIngestMessages = oldList.getIngestMessages();
|
||||
List<Keyword> newKeywords = getAllKeywords();
|
||||
boolean newIngest = useForIngestCheckbox.isSelected();
|
||||
|
||||
if (!oldKeywords.equals(newKeywords) || oldIngest != newIngest) {
|
||||
boolean newIngestMessages = ingestMessagesCheckbox.isSelected();
|
||||
|
||||
if (!oldKeywords.equals(newKeywords) || oldIngest != newIngest || oldIngestMessages != newIngestMessages) {
|
||||
/*boolean save = KeywordSearchUtil.displayConfirmDialog("Save List Changes",
|
||||
"Do you want to save the changes you made to list " + currentKeywordList + "?",
|
||||
KeywordSearchUtil.DIALOG_MESSAGE_TYPE.WARN);*/
|
||||
boolean save = true;
|
||||
if (save) {
|
||||
loader.addList(currentKeywordList, newKeywords, newIngest, oldList.isLocked());
|
||||
loader.addList(currentKeywordList, newKeywords, newIngest, newIngestMessages, oldList.isLocked());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -825,7 +849,10 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
|
||||
deleteAll();
|
||||
addKeywords(keywords);
|
||||
useForIngestCheckbox.setSelected(list.getUseForIngest());
|
||||
boolean useForIngest = list.getUseForIngest();
|
||||
useForIngestCheckbox.setSelected(useForIngest);
|
||||
ingestMessagesCheckbox.setEnabled(useForIngest);
|
||||
ingestMessagesCheckbox.setSelected(list.getIngestMessages());
|
||||
}
|
||||
|
||||
void deleteAll() {
|
||||
|
@ -65,7 +65,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
private volatile boolean commitIndex = false; //whether to commit index next time
|
||||
private List<Keyword> keywords; //keywords to search
|
||||
private List<String> keywordLists; // lists currently being searched
|
||||
private Map<String, String> keywordToList; //keyword to list name mapping
|
||||
private Map<String, KeywordSearchList> keywordToList; //keyword to list name mapping
|
||||
//private final Object lock = new Object();
|
||||
private Timer commitTimer;
|
||||
private Indexer indexer;
|
||||
@ -219,7 +219,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
|
||||
keywords = new ArrayList<Keyword>();
|
||||
keywordLists = new ArrayList<String>();
|
||||
keywordToList = new HashMap<String, String>();
|
||||
keywordToList = new HashMap<String, KeywordSearchList>();
|
||||
|
||||
initKeywords();
|
||||
|
||||
@ -357,7 +357,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
}
|
||||
for (Keyword keyword : list.getKeywords()) {
|
||||
keywords.add(keyword);
|
||||
keywordToList.put(keyword.getQuery(), listName);
|
||||
keywordToList.put(keyword.getQuery(), list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -373,9 +373,10 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
keywordToList.clear();
|
||||
|
||||
for (String name : keywordLists) {
|
||||
for (Keyword k : loader.getList(name).getKeywords()) {
|
||||
KeywordSearchList list = loader.getList(name);
|
||||
for (Keyword k : list.getKeywords()) {
|
||||
keywords.add(k);
|
||||
keywordToList.put(k.getQuery(), name);
|
||||
keywordToList.put(k.getQuery(), list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -525,11 +526,15 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
protected Object doInBackground() throws Exception {
|
||||
logger.log(Level.INFO, "Pending start of new searcher");
|
||||
|
||||
progress = ProgressHandleFactory.createHandle("Keyword Search" + (finalRun ? " (Finalizing)" : ""), new Cancellable() {
|
||||
final String displayName = "Keyword Search" + (finalRun ? " (Finalizing)" : "");
|
||||
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
logger.log(Level.INFO, "Cancelling the searcher by user.");
|
||||
if (progress != null) {
|
||||
progress.setDisplayName(displayName + " (Cancelling...)");
|
||||
}
|
||||
return Searcher.this.cancel(true);
|
||||
}
|
||||
});
|
||||
@ -554,8 +559,9 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
return null;
|
||||
}
|
||||
final String queryStr = keywordQuery.getQuery();
|
||||
final String listName = keywordToList.get(queryStr);
|
||||
|
||||
final KeywordSearchList list = keywordToList.get(queryStr);
|
||||
final String listName = list.getName();
|
||||
|
||||
//DEBUG
|
||||
//logger.log(Level.INFO, "Searching: " + queryStr);
|
||||
|
||||
@ -624,7 +630,10 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
if (!newResults.isEmpty()) {
|
||||
|
||||
//write results to BB
|
||||
Collection<BlackboardArtifact> newArtifacts = new ArrayList<BlackboardArtifact>(); //new artifacts to report
|
||||
|
||||
//new artifacts created, to report to listeners
|
||||
Collection<BlackboardArtifact> newArtifacts = new ArrayList<BlackboardArtifact>();
|
||||
|
||||
for (final Keyword hitTerm : newResults.keySet()) {
|
||||
List<ContentHit> contentHitsAll = newResults.get(hitTerm);
|
||||
Map<FsContent, Integer> contentHitsFlattened = ContentHit.flattenResults(contentHitsAll);
|
||||
@ -720,7 +729,10 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
}
|
||||
detailsSb.append("</table>");
|
||||
|
||||
managerProxy.postMessage(IngestMessage.createDataMessage(++messageID, instance, subjectSb.toString(), detailsSb.toString(), uniqueKey, written.getArtifact()));
|
||||
//check if should send messages on hits on this list
|
||||
if (list.getIngestMessages())
|
||||
//post ingest inbox msg
|
||||
managerProxy.postMessage(IngestMessage.createDataMessage(++messageID, instance, subjectSb.toString(), detailsSb.toString(), uniqueKey, written.getArtifact()));
|
||||
|
||||
|
||||
} //for each term hit
|
||||
@ -756,9 +768,12 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
if (finalRun) {
|
||||
logger.log(Level.INFO, "The final searcher in this ingest done.");
|
||||
finalSearcherDone = true;
|
||||
//keywords.clear();
|
||||
//keywordLists.clear();
|
||||
//keywordToList.clear();
|
||||
keywords.clear();
|
||||
keywordLists.clear();
|
||||
keywordToList.clear();
|
||||
//reset current resuls earlier to potentially garbage collect sooner
|
||||
currentResults = new HashMap<Keyword, List<ContentHit>>();
|
||||
|
||||
managerProxy.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, KeywordSearchIngestService.instance, "Completed"));
|
||||
}
|
||||
}
|
||||
|
@ -450,10 +450,6 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
return getValueAt(0, c).getClass();
|
||||
}
|
||||
|
||||
private void updateUseForIngest(KeywordSearchList list, boolean selected) {
|
||||
// This causes an event to be fired which resyncs the list and makes user lose selection
|
||||
listsHandle.addList(list.getName(), list.getKeywords(), selected);
|
||||
}
|
||||
|
||||
List<String> getAllLists() {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
|
@ -67,6 +67,7 @@ public class KeywordSearchListsXML {
|
||||
private static final String LIST_CREATE_ATTR = "created";
|
||||
private static final String LIST_MOD_ATTR = "modified";
|
||||
private static final String LIST_USE_FOR_INGEST = "use_for_ingest";
|
||||
private static final String LIST_INGEST_MSGS = "ingest_messages";
|
||||
private static final String KEYWORD_EL = "keyword";
|
||||
private static final String KEYWORD_LITERAL_ATTR = "literal";
|
||||
private static final String KEYWORD_SELECTOR_ATTR = "selector";
|
||||
@ -118,10 +119,10 @@ public class KeywordSearchListsXML {
|
||||
|
||||
//urls.add(new Keyword("ssh://", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL));
|
||||
|
||||
addList("Phone Numbers", phones, true, true);
|
||||
addList("IP Addresses", ips, true, true);
|
||||
addList("Email Addresses", emails, true, true);
|
||||
addList("URLs", urls, true, true);
|
||||
addList("Phone Numbers", phones, true, true, true);
|
||||
addList("IP Addresses", ips, true, true, true);
|
||||
addList("Email Addresses", emails, true, true, true);
|
||||
addList("URLs", urls, true, false, true); //disable messages for URLs list by default
|
||||
}
|
||||
|
||||
/**
|
||||
@ -244,17 +245,17 @@ public class KeywordSearchListsXML {
|
||||
* @param useForIngest should this list be used for ingest
|
||||
* @return true if old list was replaced
|
||||
*/
|
||||
boolean addList(String name, List<Keyword> newList, boolean useForIngest, boolean locked) {
|
||||
boolean addList(String name, List<Keyword> newList, boolean useForIngest, boolean ingestMessages, boolean locked) {
|
||||
boolean replaced = false;
|
||||
KeywordSearchList curList = getList(name);
|
||||
final Date now = new Date();
|
||||
if (curList == null) {
|
||||
theLists.put(name, new KeywordSearchList(name, now, now, useForIngest, newList, locked));
|
||||
theLists.put(name, new KeywordSearchList(name, now, now, useForIngest, ingestMessages, newList, locked));
|
||||
if(!locked)
|
||||
save();
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_ADDED.toString(), null, name);
|
||||
} else {
|
||||
theLists.put(name, new KeywordSearchList(name, curList.getDateCreated(), now, useForIngest, newList, locked));
|
||||
theLists.put(name, new KeywordSearchList(name, curList.getDateCreated(), now, useForIngest, ingestMessages, newList, locked));
|
||||
if(!locked)
|
||||
save();
|
||||
replaced = true;
|
||||
@ -264,17 +265,17 @@ public class KeywordSearchListsXML {
|
||||
return replaced;
|
||||
}
|
||||
|
||||
boolean addList(String name, List<Keyword> newList, boolean useForIngest) {
|
||||
boolean addList(String name, List<Keyword> newList, boolean useForIngest, boolean ingestMessages) {
|
||||
KeywordSearchList curList = getList(name);
|
||||
if (curList == null) {
|
||||
return addList(name, newList, useForIngest, false);
|
||||
return addList(name, newList, useForIngest, ingestMessages, false);
|
||||
} else {
|
||||
return addList(name, newList, curList.getUseForIngest(), false);
|
||||
return addList(name, newList, curList.getUseForIngest(), ingestMessages, false);
|
||||
}
|
||||
}
|
||||
|
||||
boolean addList(String name, List<Keyword> newList) {
|
||||
return addList(name, newList, true);
|
||||
return addList(name, newList, true, true);
|
||||
}
|
||||
|
||||
|
||||
@ -347,6 +348,7 @@ public class KeywordSearchListsXML {
|
||||
String created = dateFormatter.format(list.getDateCreated());
|
||||
String modified = dateFormatter.format(list.getDateModified());
|
||||
String useForIngest = list.getUseForIngest().toString();
|
||||
String ingestMessages = list.getIngestMessages().toString();
|
||||
List<Keyword> keywords = list.getKeywords();
|
||||
|
||||
Element listEl = doc.createElement(LIST_EL);
|
||||
@ -354,6 +356,7 @@ public class KeywordSearchListsXML {
|
||||
listEl.setAttribute(LIST_CREATE_ATTR, created);
|
||||
listEl.setAttribute(LIST_MOD_ATTR, modified);
|
||||
listEl.setAttribute(LIST_USE_FOR_INGEST, useForIngest);
|
||||
listEl.setAttribute(LIST_INGEST_MSGS, ingestMessages);
|
||||
|
||||
for (Keyword keyword : keywords) {
|
||||
Element keywordEl = doc.createElement(KEYWORD_EL);
|
||||
@ -399,11 +402,14 @@ public class KeywordSearchListsXML {
|
||||
final String created = listEl.getAttribute(LIST_CREATE_ATTR);
|
||||
final String modified = listEl.getAttribute(LIST_MOD_ATTR);
|
||||
final String useForIngest = listEl.getAttribute(LIST_USE_FOR_INGEST);
|
||||
final String ingestMessages = listEl.getAttribute(LIST_INGEST_MSGS);
|
||||
|
||||
Date createdDate = dateFormatter.parse(created);
|
||||
Date modDate = dateFormatter.parse(modified);
|
||||
Boolean useForIngestBool = Boolean.parseBoolean(useForIngest);
|
||||
Boolean ingestMessagesBool = Boolean.parseBoolean(ingestMessages);
|
||||
List<Keyword> words = new ArrayList<Keyword>();
|
||||
KeywordSearchList list = new KeywordSearchList(name, createdDate, modDate, useForIngestBool, words);
|
||||
KeywordSearchList list = new KeywordSearchList(name, createdDate, modDate, useForIngestBool, ingestMessagesBool, words);
|
||||
|
||||
//parse all words
|
||||
NodeList wordsNList = listEl.getElementsByTagName(KEYWORD_EL);
|
||||
@ -506,20 +512,22 @@ class KeywordSearchList {
|
||||
private Date created;
|
||||
private Date modified;
|
||||
private Boolean useForIngest;
|
||||
private Boolean ingestMessages;
|
||||
private List<Keyword> keywords;
|
||||
private Boolean locked;
|
||||
|
||||
KeywordSearchList(String name, Date created, Date modified, Boolean useForIngest, List<Keyword> keywords, boolean locked) {
|
||||
KeywordSearchList(String name, Date created, Date modified, Boolean useForIngest, Boolean ingestMessages, List<Keyword> keywords, boolean locked) {
|
||||
this.name = name;
|
||||
this.created = created;
|
||||
this.modified = modified;
|
||||
this.useForIngest = useForIngest;
|
||||
this.ingestMessages = ingestMessages;
|
||||
this.keywords = keywords;
|
||||
this.locked = locked;
|
||||
}
|
||||
|
||||
KeywordSearchList(String name, Date created, Date modified, Boolean useForIngest, List<Keyword> keywords) {
|
||||
this(name, created, modified, useForIngest, keywords, false);
|
||||
KeywordSearchList(String name, Date created, Date modified, Boolean useForIngest, Boolean ingestMessages, List<Keyword> keywords) {
|
||||
this(name, created, modified, useForIngest, ingestMessages, keywords, false);
|
||||
}
|
||||
|
||||
|
||||
@ -563,6 +571,14 @@ class KeywordSearchList {
|
||||
void setUseForIngest(boolean use) {
|
||||
this.useForIngest = use;
|
||||
}
|
||||
|
||||
Boolean getIngestMessages() {
|
||||
return ingestMessages;
|
||||
}
|
||||
|
||||
void setIngestMessages(boolean ingestMessages) {
|
||||
this.ingestMessages = ingestMessages;
|
||||
}
|
||||
|
||||
List<Keyword> getKeywords() {
|
||||
return keywords;
|
||||
|
Loading…
x
Reference in New Issue
Block a user