mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
5673 combine known and occurrences filter
This commit is contained in:
parent
0500843c38
commit
043412804c
@ -61,5 +61,6 @@ FileSearchPanel.includeRadioButton.text=Include
|
||||
FileSearchPanel.excludeRadioButton.text=Exclude
|
||||
FileSearchPanel.knownFilesCheckbox.toolTipText=
|
||||
FileSearchPanel.knownFilesCheckbox.text=Hide known files
|
||||
FileSearchPanel.imagesButton.text=Images
|
||||
FileSearchPanel.videosButton.text=Videos
|
||||
GroupListPanel.groupKeyList.border.title=Groups
|
||||
DiscoveryTopComponent.imagesButton.text=Images
|
||||
DiscoveryTopComponent.videosButton.text=Videos
|
||||
|
@ -181,8 +181,9 @@ FileSearchPanel.includeRadioButton.text=Include
|
||||
FileSearchPanel.excludeRadioButton.text=Exclude
|
||||
FileSearchPanel.knownFilesCheckbox.toolTipText=
|
||||
FileSearchPanel.knownFilesCheckbox.text=Hide known files
|
||||
FileSearchPanel.imagesButton.text=Images
|
||||
FileSearchPanel.videosButton.text=Videos
|
||||
GroupListPanel.groupKeyList.border.title=Groups
|
||||
DiscoveryTopComponent.imagesButton.text=Images
|
||||
DiscoveryTopComponent.videosButton.text=Videos
|
||||
ResultsPanel.viewFileInDir.name=View File in Directory
|
||||
SearchNode.getName.text=Search Result
|
||||
# {0} - numberOfInstances
|
||||
|
@ -71,5 +71,60 @@
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="toolBarPanel">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="First"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="imagesButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="videosButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="954" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="imagesButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="videosButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="imagesButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="DiscoveryTopComponent.imagesButton.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="imagesButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="videosButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="DiscoveryTopComponent.videosButton.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="videosButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -61,18 +61,11 @@ public final class DiscoveryTopComponent extends TopComponent {
|
||||
DiscoveryTopComponent() {
|
||||
initComponents();
|
||||
// Load the central repository database.
|
||||
EamDb centralRepoDb = null;
|
||||
if (EamDb.isEnabled()) {
|
||||
try {
|
||||
centralRepoDb = EamDb.getInstance();
|
||||
} catch (EamDbException ex) {
|
||||
logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex);
|
||||
}
|
||||
}
|
||||
|
||||
setName(Bundle.DiscoveryTopComponent_name());
|
||||
fileSearchPanel = new FileSearchPanel(Case.getCurrentCase().getSleuthkitCase(), centralRepoDb);
|
||||
fileSearchPanel = new FileSearchPanel();
|
||||
dataContentPanel = DataContentPanel.createInstance();
|
||||
resultsPanel = new ResultsPanel(centralRepoDb);
|
||||
resultsPanel = new ResultsPanel();
|
||||
groupListPanel = new GroupListPanel();
|
||||
leftSplitPane.setLeftComponent(fileSearchPanel);
|
||||
leftSplitPane.setRightComponent(groupListPanel);
|
||||
@ -110,8 +103,10 @@ public final class DiscoveryTopComponent extends TopComponent {
|
||||
mode.dockInto(tc);
|
||||
}
|
||||
tc.open();
|
||||
tc.updateSearchSettings();
|
||||
}
|
||||
tc.toFront();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,6 +122,10 @@ public final class DiscoveryTopComponent extends TopComponent {
|
||||
groupListPanel.resetGroupList();
|
||||
}
|
||||
|
||||
void updateSearchSettings() {
|
||||
fileSearchPanel.resetPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentOpened() {
|
||||
super.componentOpened();
|
||||
@ -157,6 +156,9 @@ public final class DiscoveryTopComponent extends TopComponent {
|
||||
javax.swing.JSplitPane mainSplitPane = new javax.swing.JSplitPane();
|
||||
leftSplitPane = new javax.swing.JSplitPane();
|
||||
rightSplitPane = new javax.swing.JSplitPane();
|
||||
toolBarPanel = new javax.swing.JPanel();
|
||||
imagesButton = new javax.swing.JButton();
|
||||
videosButton = new javax.swing.JButton();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(1100, 700));
|
||||
setLayout(new java.awt.BorderLayout());
|
||||
@ -176,12 +178,60 @@ public final class DiscoveryTopComponent extends TopComponent {
|
||||
mainSplitPane.setRightComponent(rightSplitPane);
|
||||
|
||||
add(mainSplitPane, java.awt.BorderLayout.CENTER);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.imagesButton.text")); // NOI18N
|
||||
imagesButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
imagesButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(videosButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.videosButton.text")); // NOI18N
|
||||
videosButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
videosButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout toolBarPanelLayout = new javax.swing.GroupLayout(toolBarPanel);
|
||||
toolBarPanel.setLayout(toolBarPanelLayout);
|
||||
toolBarPanelLayout.setHorizontalGroup(
|
||||
toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(toolBarPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(imagesButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(videosButton)
|
||||
.addContainerGap(954, Short.MAX_VALUE))
|
||||
);
|
||||
toolBarPanelLayout.setVerticalGroup(
|
||||
toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(toolBarPanelLayout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(imagesButton)
|
||||
.addComponent(videosButton))
|
||||
.addGap(6, 6, 6))
|
||||
);
|
||||
|
||||
add(toolBarPanel, java.awt.BorderLayout.PAGE_START);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_imagesButtonActionPerformed
|
||||
|
||||
private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_videosButtonActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton imagesButton;
|
||||
private javax.swing.JSplitPane leftSplitPane;
|
||||
private javax.swing.JSplitPane rightSplitPane;
|
||||
private javax.swing.JPanel toolBarPanel;
|
||||
private javax.swing.JButton videosButton;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ import org.sleuthkit.datamodel.Content;
|
||||
import org.sleuthkit.datamodel.ContentTag;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
/**
|
||||
* Main class to perform the file search.
|
||||
@ -1029,22 +1030,28 @@ class FileSearch {
|
||||
@Override
|
||||
void addAttributeToResultFiles(List<ResultFile> files, SleuthkitCase caseDb,
|
||||
EamDb centralRepoDb) throws FileSearchException {
|
||||
|
||||
if (centralRepoDb == null) {
|
||||
throw new FileSearchException("Central Repository is not enabled - can not add frequency data"); // NON-NLS
|
||||
}
|
||||
|
||||
// Set frequency in batches
|
||||
Set<String> hashesToLookUp = new HashSet<>();
|
||||
List<ResultFile> currentFiles = new ArrayList<>();
|
||||
for (ResultFile file : files) {
|
||||
if (file.getFrequency() == Frequency.UNKNOWN) {
|
||||
if (file.getFirstInstance().getKnown() == TskData.FileKnown.KNOWN) {
|
||||
file.setFrequency(Frequency.KNOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Set frequency in batches
|
||||
List<ResultFile> currentFiles = new ArrayList<>();
|
||||
Set<String> hashesToLookUp = new HashSet<>();
|
||||
for (ResultFile file : files) {
|
||||
if (file.getFirstInstance().getKnown() == TskData.FileKnown.KNOWN) {
|
||||
file.setFrequency(Frequency.KNOWN);
|
||||
}
|
||||
if (file.getFrequency() == Frequency.UNKNOWN
|
||||
&& file.getFirstInstance().getMd5Hash() != null
|
||||
&& !file.getFirstInstance().getMd5Hash().isEmpty()) {
|
||||
hashesToLookUp.add(file.getFirstInstance().getMd5Hash());
|
||||
currentFiles.add(file);
|
||||
}
|
||||
|
||||
if (hashesToLookUp.size() >= BATCH_SIZE) {
|
||||
computeFrequency(hashesToLookUp, currentFiles, centralRepoDb);
|
||||
|
||||
@ -1055,6 +1062,7 @@ class FileSearch {
|
||||
computeFrequency(hashesToLookUp, currentFiles, centralRepoDb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to use with findInterCaseValuesByCount which generates a list of
|
||||
|
@ -53,7 +53,8 @@ class FileSearchData {
|
||||
COUNT_50(4, 50, Bundle.FileSearchData_Frequency_count_50_displayName()),
|
||||
COUNT_100(5, 100, Bundle.FileSearchData_Frequency_count_100_displayName()),
|
||||
COMMON(6, 0, Bundle.FileSearchData_Frequency_common_displayName()),
|
||||
UNKNOWN(7, 0, Bundle.FileSearchData_Frequency_unknown_displayName());
|
||||
KNOWN(7, 0, "Known (NSRL)"),
|
||||
UNKNOWN(8, 0, Bundle.FileSearchData_Frequency_unknown_displayName());
|
||||
|
||||
private final int ranking;
|
||||
private final String displayName;
|
||||
@ -99,12 +100,23 @@ class FileSearchData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of enums that are valid for filtering.
|
||||
* Get the list of enums that are valid for filtering when a CR is
|
||||
* enabled.
|
||||
*
|
||||
* @return enums that can be used to filter
|
||||
* @return enums that can be used to filter with a CR.
|
||||
*/
|
||||
static List<Frequency> getOptionsForFiltering() {
|
||||
return Arrays.asList(UNIQUE, RARE, COUNT_10, COUNT_20, COUNT_50, COUNT_100, COMMON);
|
||||
static List<Frequency> getOptionsForFilteringWithCr() {
|
||||
return Arrays.asList(UNIQUE, RARE, COUNT_10, COUNT_20, COUNT_50, COUNT_100, COMMON, KNOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of enums that are valid for filtering when no CR is
|
||||
* enabled.
|
||||
*
|
||||
* @return enums that can be used to filter without a CR.
|
||||
*/
|
||||
static List<Frequency> getOptionsForFilteringWithoutCr() {
|
||||
return Arrays.asList(KNOWN, UNKNOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -185,7 +185,7 @@ public class FileSearchDialog extends javax.swing.JDialog implements ActionListe
|
||||
} else {
|
||||
int count = 0;
|
||||
DefaultListModel<Frequency> frequencyListModel = (DefaultListModel<Frequency>)freqList.getModel();
|
||||
for (Frequency freq : Frequency.getOptionsForFiltering()) {
|
||||
for (Frequency freq : Frequency.getOptionsForFilteringWithCr()) {
|
||||
frequencyListModel.add(count, freq);
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +279,8 @@ class FileSearchFiltering {
|
||||
"FileSearchFiltering.ParentSearchTerm.fullString= (exact)",
|
||||
"FileSearchFiltering.ParentSearchTerm.subString= (substring)",
|
||||
"FileSearchFiltering.ParentSearchTerm.includeString= (include)",
|
||||
"FileSearchFiltering.ParentSearchTerm.excludeString= (exclude)",})
|
||||
"FileSearchFiltering.ParentSearchTerm.excludeString= (exclude)",}
|
||||
)
|
||||
@Override
|
||||
public String toString() {
|
||||
String returnString = searchStr;
|
||||
@ -308,6 +309,7 @@ class FileSearchFiltering {
|
||||
*/
|
||||
boolean isIncluded() {
|
||||
return isIncluded;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -559,10 +561,6 @@ class FileSearchFiltering {
|
||||
List<ResultFile> applyAlternateFilter(List<ResultFile> currentResults, SleuthkitCase caseDb,
|
||||
EamDb centralRepoDb) throws FileSearchException {
|
||||
|
||||
if (centralRepoDb == null) {
|
||||
throw new FileSearchException("Can not run Frequency filter with null Central Repository DB"); // NON-NLS
|
||||
}
|
||||
|
||||
// We have to have run some kind of SQL filter before getting to this point,
|
||||
// and should have checked afterward to see if the results were empty.
|
||||
if (currentResults.isEmpty()) {
|
||||
|
@ -34,18 +34,11 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="imagesButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="videosButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<Component id="errorLabel" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="errorLabel" pref="268" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cancelButton" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -67,21 +60,18 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="imagesButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="videosButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="filtersScrollPane" pref="307" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
<Component id="filtersScrollPane" pref="326" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="sortingPanel" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="searchButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="errorLabel" min="-2" pref="23" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="errorLabel" alignment="0" min="-2" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
@ -874,44 +864,5 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="imagesButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.imagesButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="typeButtonGroup"/>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[2, 8, 2, 8]"/>
|
||||
</Property>
|
||||
<Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/images/tick.png"/>
|
||||
</Property>
|
||||
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="imagesButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="videosButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.videosButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="typeButtonGroup"/>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
<Insets value="[2, 8, 2, 8]"/>
|
||||
</Property>
|
||||
<Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/images/tick.png"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="videosButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -36,7 +36,9 @@ import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.filequery.FileSearch.GroupingAttributeType;
|
||||
import org.sleuthkit.autopsy.filequery.FileSearchData.FileType;
|
||||
@ -61,30 +63,23 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
private final static Logger logger = Logger.getLogger(FileSearchPanel.class.getName());
|
||||
|
||||
private DefaultListModel<FileSearchFiltering.ParentSearchTerm> parentListModel;
|
||||
private final SleuthkitCase caseDb;
|
||||
private final EamDb centralRepoDb;
|
||||
private SearchWorker searchWorker = null;
|
||||
|
||||
/**
|
||||
* Creates new form FileSearchDialog
|
||||
*/
|
||||
@NbBundle.Messages({"FileSearchPanel.dialogTitle.text=Test file search"})
|
||||
FileSearchPanel(SleuthkitCase caseDb, EamDb centralRepoDb) {
|
||||
this.caseDb = caseDb;
|
||||
this.centralRepoDb = centralRepoDb;
|
||||
FileSearchPanel() {
|
||||
initComponents();
|
||||
customizeComponents();
|
||||
imagesSelected();
|
||||
|
||||
}
|
||||
|
||||
private void imagesSelected() {
|
||||
imagesButton.setSelected(true);
|
||||
imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/tick.png")));
|
||||
imagesButton.setBackground(Color.blue);
|
||||
videosButton.setIcon(null);
|
||||
videosButton.setSelected(false);
|
||||
videosButton.setBackground(new Color(240, 240, 240));
|
||||
// imagesButton.setSelected(true);
|
||||
// imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/tick.png")));
|
||||
// imagesButton.setBackground(Color.blue);
|
||||
// videosButton.setIcon(null);
|
||||
// videosButton.setSelected(false);
|
||||
// videosButton.setBackground(new Color(240, 240, 240));
|
||||
dataSourceCheckbox.setVisible(true);
|
||||
dataSourceScrollPane.setVisible(true);
|
||||
dataSourceList.setVisible(true);
|
||||
@ -127,12 +122,12 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
}
|
||||
|
||||
private void videosSelected() {
|
||||
imagesButton.setSelected(false);
|
||||
imagesButton.setIcon(null);
|
||||
imagesButton.setBackground(new Color(240, 240, 240));
|
||||
videosButton.setSelected(true);
|
||||
videosButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/tick.png")));
|
||||
videosButton.setBackground(Color.blue);
|
||||
// imagesButton.setSelected(false);
|
||||
// imagesButton.setIcon(null);
|
||||
// imagesButton.setBackground(new Color(240, 240, 240));
|
||||
// videosButton.setSelected(true);
|
||||
// videosButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/tick.png")));
|
||||
// videosButton.setBackground(Color.blue);
|
||||
dataSourceCheckbox.setVisible(true);
|
||||
dataSourceScrollPane.setVisible(true);
|
||||
dataSourceList.setVisible(true);
|
||||
@ -177,6 +172,10 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
notableCheckbox.setVisible(false);
|
||||
}
|
||||
|
||||
void resetPanel(){
|
||||
customizeComponents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up all the UI components
|
||||
*/
|
||||
@ -196,19 +195,21 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
setUpObjectFilter();
|
||||
setUpScoreFilter();
|
||||
|
||||
groupByCombobox.removeAllItems();
|
||||
// Set up the grouping attributes
|
||||
for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGroupingImages()) {
|
||||
if (type != GroupingAttributeType.FREQUENCY || EamDb.isEnabled()) {
|
||||
groupByCombobox.addItem(type);
|
||||
}
|
||||
}
|
||||
|
||||
orderByCombobox.removeAllItems();
|
||||
// Set up the file order list
|
||||
for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrderingImages()) {
|
||||
if (method != SortingMethod.BY_FREQUENCY || EamDb.isEnabled()) {
|
||||
orderByCombobox.addItem(method);
|
||||
}
|
||||
}
|
||||
imagesSelected();
|
||||
validateFields();
|
||||
}
|
||||
|
||||
@ -226,8 +227,10 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
list.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent evt) {
|
||||
if (!evt.getValueIsAdjusting()) {
|
||||
validateFields();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -239,7 +242,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
int count = 0;
|
||||
try {
|
||||
DefaultListModel<DataSourceItem> dsListModel = (DefaultListModel<DataSourceItem>) dataSourceList.getModel();
|
||||
for (DataSource ds : caseDb.getDataSources()) {
|
||||
dsListModel.removeAllElements();
|
||||
for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) {
|
||||
dsListModel.add(count, new DataSourceItem(ds));
|
||||
}
|
||||
} catch (TskCoreException ex) {
|
||||
@ -254,13 +258,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
* Initialize the frequency filter
|
||||
*/
|
||||
private void setUpFrequencyFilter() {
|
||||
if (centralRepoDb == null) {
|
||||
crFrequencyList.setEnabled(false);
|
||||
crFrequencyCheckbox.setEnabled(false);
|
||||
} else {
|
||||
int count = 0;
|
||||
DefaultListModel<FileSearchData.Frequency> frequencyListModel = (DefaultListModel<FileSearchData.Frequency>) crFrequencyList.getModel();
|
||||
for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFiltering()) {
|
||||
frequencyListModel.removeAllElements();
|
||||
if (!EamDb.isEnabled()) {
|
||||
for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithoutCr()) {
|
||||
frequencyListModel.add(count, freq);
|
||||
}
|
||||
} else {
|
||||
for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithCr()) {
|
||||
frequencyListModel.add(count, freq);
|
||||
}
|
||||
}
|
||||
@ -273,6 +279,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
private void setUpSizeFilter() {
|
||||
int count = 0;
|
||||
DefaultListModel<FileSearchData.FileSize> sizeListModel = (DefaultListModel<FileSearchData.FileSize>) sizeList.getModel();
|
||||
sizeListModel.removeAllElements();
|
||||
for (FileSearchData.FileSize size : FileSearchData.FileSize.values()) {
|
||||
sizeListModel.add(count, size);
|
||||
}
|
||||
@ -286,7 +293,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
int count = 0;
|
||||
try {
|
||||
DefaultListModel<String> kwListModel = (DefaultListModel<String>) keywordList.getModel();
|
||||
|
||||
kwListModel.removeAllElements();
|
||||
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT,
|
||||
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
|
||||
for (String name : setNames) {
|
||||
@ -307,7 +314,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
int count = 0;
|
||||
try {
|
||||
DefaultListModel<String> hashListModel = (DefaultListModel<String>) hashSetList.getModel();
|
||||
|
||||
hashListModel.removeAllElements();
|
||||
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT,
|
||||
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
|
||||
for (String name : setNames) {
|
||||
@ -329,7 +336,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
int count = 0;
|
||||
try {
|
||||
DefaultListModel<String> intListModel = (DefaultListModel<String>) interestingItemsList.getModel();
|
||||
|
||||
intListModel.removeAllElements();
|
||||
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT,
|
||||
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
|
||||
for (String name : setNames) {
|
||||
@ -351,8 +358,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
int count = 0;
|
||||
try {
|
||||
DefaultListModel<TagName> tagsListModel = (DefaultListModel<TagName>) tagsList.getModel();
|
||||
|
||||
List<TagName> tagNames = caseDb.getTagNamesInUse();
|
||||
tagsListModel.removeAllElements();
|
||||
List<TagName> tagNames = Case.getCurrentCase().getSleuthkitCase().getTagNamesInUse();
|
||||
for (TagName name : tagNames) {
|
||||
tagsListModel.add(count, name);
|
||||
count++;
|
||||
@ -396,7 +403,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
int count = 0;
|
||||
try {
|
||||
DefaultListModel<String> objListModel = (DefaultListModel<String>) objectsList.getModel();
|
||||
|
||||
objListModel.removeAllElements();
|
||||
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION);
|
||||
for (String name : setNames) {
|
||||
objListModel.add(count, name);
|
||||
@ -417,6 +424,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
|
||||
int count = 0;
|
||||
DefaultListModel<Score> scoreListModel = (DefaultListModel<Score>) scoreList.getModel();
|
||||
scoreListModel.removeAllElements();
|
||||
for (Score score : Score.getOptionsForFiltering()) {
|
||||
scoreListModel.add(count, score);
|
||||
}
|
||||
@ -436,7 +444,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
* @throws TskCoreException
|
||||
*/
|
||||
private List<String> getSetNames(BlackboardArtifact.ARTIFACT_TYPE artifactType, BlackboardAttribute.ATTRIBUTE_TYPE setNameAttribute) throws TskCoreException {
|
||||
List<BlackboardArtifact> arts = caseDb.getBlackboardArtifacts(artifactType);
|
||||
List<BlackboardArtifact> arts = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(artifactType);
|
||||
List<String> setNames = new ArrayList<>();
|
||||
for (BlackboardArtifact art : arts) {
|
||||
for (BlackboardAttribute attr : art.getAttributes()) {
|
||||
@ -456,8 +464,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
* Initialize the parent path filter
|
||||
*/
|
||||
private void setUpParentPathFilter() {
|
||||
parentPathButtonGroup.add(fullRadioButton);
|
||||
parentPathButtonGroup.add(substringRadioButton);
|
||||
fullRadioButton.setSelected(true);
|
||||
includeRadioButton.setSelected(true);
|
||||
parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel();
|
||||
@ -472,12 +478,12 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
List<FileSearchFiltering.FileFilter> getFilters() {
|
||||
List<FileSearchFiltering.FileFilter> filters = new ArrayList<>();
|
||||
|
||||
// There will always be a file type selected
|
||||
if (imagesButton.isSelected()) {
|
||||
// // There will always be a file type selected
|
||||
// if (imagesButton.isSelected()) {
|
||||
filters.add(new FileSearchFiltering.FileTypeFilter(FileType.IMAGE));
|
||||
} else if (videosButton.isSelected()) {
|
||||
filters.add(new FileSearchFiltering.FileTypeFilter(FileType.VIDEO));
|
||||
}
|
||||
// } else if (videosButton.isSelected()) {
|
||||
// filters.add(new FileSearchFiltering.FileTypeFilter(FileType.VIDEO));
|
||||
// }
|
||||
|
||||
if (parentCheckbox.isSelected()) {
|
||||
// For the parent paths, everything in the box is used (not just the selected entries)
|
||||
@ -612,11 +618,11 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
* use bundle messages.
|
||||
*/
|
||||
private void validateFields() {
|
||||
// There must be at least one file type selected
|
||||
if (imagesButton.isSelected() || videosButton.isSelected()) {
|
||||
setInvalid("At least one file type must be selected");
|
||||
return;
|
||||
}
|
||||
// // There must be at least one file type selected
|
||||
// if (imagesButton.isSelected() || videosButton.isSelected()) {
|
||||
// setInvalid("At least one file type must be selected");
|
||||
// return;
|
||||
// }
|
||||
// For most enabled filters, there should be something selected
|
||||
if (dataSourceCheckbox.isSelected() && dataSourceList.getSelectedValuesList().isEmpty()) {
|
||||
setInvalid("At least one data source must be selected");
|
||||
@ -755,8 +761,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
groupByLabel = new javax.swing.JLabel();
|
||||
errorLabel = new javax.swing.JLabel();
|
||||
cancelButton = new javax.swing.JButton();
|
||||
imagesButton = new javax.swing.JButton();
|
||||
videosButton = new javax.swing.JButton();
|
||||
|
||||
setMinimumSize(new java.awt.Dimension(424, 0));
|
||||
setPreferredSize(new java.awt.Dimension(424, 533));
|
||||
@ -1271,42 +1275,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.imagesButton.text")); // NOI18N
|
||||
typeButtonGroup.add(imagesButton);
|
||||
imagesButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
|
||||
imagesButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/tick.png"))); // NOI18N
|
||||
imagesButton.setVerifyInputWhenFocusTarget(false);
|
||||
imagesButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
imagesButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(videosButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.videosButton.text")); // NOI18N
|
||||
typeButtonGroup.add(videosButton);
|
||||
videosButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
|
||||
videosButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/tick.png"))); // NOI18N
|
||||
videosButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
videosButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(imagesButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(videosButton)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(4, 4, 4)
|
||||
.addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap()
|
||||
.addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@ -1325,19 +1302,17 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(8, 8, 8)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(imagesButton)
|
||||
.addComponent(videosButton))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
|
||||
.addGap(6, 6, 6)
|
||||
.addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(searchButton))
|
||||
.addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(searchButton)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(6, 6, 6))))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@ -1346,9 +1321,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
|
||||
FileType searchType = FileType.IMAGE; //default to images
|
||||
// There will always be a file type selected
|
||||
if (videosButton.isSelected()) {
|
||||
searchType = FileType.VIDEO;
|
||||
}
|
||||
// if (videosButton.isSelected()) {
|
||||
// searchType = FileType.VIDEO;
|
||||
// }
|
||||
DiscoveryEvents.getDiscoveryEventBus().post(new DiscoveryEvents.SearchStartedEvent(searchType));
|
||||
// For testing, allow the user to run different searches in loop
|
||||
|
||||
@ -1361,6 +1336,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
|
||||
// Get the file sorting method
|
||||
FileSorter.SortingMethod fileSort = getFileSortingMethod();
|
||||
EamDb centralRepoDb = null;
|
||||
if (EamDb.isEnabled()) {
|
||||
try {
|
||||
centralRepoDb = EamDb.getInstance();
|
||||
} catch (EamDbException ex) {
|
||||
centralRepoDb = null;
|
||||
logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex);
|
||||
}
|
||||
}
|
||||
searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort);
|
||||
searchWorker.execute();
|
||||
}//GEN-LAST:event_searchButtonActionPerformed
|
||||
@ -1380,8 +1364,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
}
|
||||
searchButton.setEnabled(enabled);
|
||||
cancelButton.setEnabled(!enabled);
|
||||
imagesButton.setEnabled(enabled);
|
||||
videosButton.setEnabled(enabled);
|
||||
orderByCombobox.setEnabled(enabled);
|
||||
groupByCombobox.setEnabled(enabled);
|
||||
attributeRadioButton.setEnabled(enabled);
|
||||
@ -1538,16 +1520,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
scoreList.setEnabled(scoreCheckbox.isSelected());
|
||||
}//GEN-LAST:event_scoreCheckboxActionPerformed
|
||||
|
||||
private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed
|
||||
imagesSelected();
|
||||
validateFields();
|
||||
}//GEN-LAST:event_imagesButtonActionPerformed
|
||||
|
||||
private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed
|
||||
videosSelected();
|
||||
validateFields();
|
||||
}//GEN-LAST:event_videosButtonActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton addButton;
|
||||
@ -1572,7 +1544,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
private javax.swing.JCheckBox hashSetCheckbox;
|
||||
private javax.swing.JList<String> hashSetList;
|
||||
private javax.swing.JScrollPane hashSetScrollPane;
|
||||
private javax.swing.JButton imagesButton;
|
||||
private javax.swing.JRadioButton includeRadioButton;
|
||||
private javax.swing.JCheckBox interestingItemsCheckbox;
|
||||
private javax.swing.JList<String> interestingItemsList;
|
||||
@ -1609,7 +1580,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
|
||||
private javax.swing.JList<TagName> tagsList;
|
||||
private javax.swing.JScrollPane tagsScrollPane;
|
||||
private javax.swing.ButtonGroup typeButtonGroup;
|
||||
private javax.swing.JButton videosButton;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,13 @@
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JList" name="groupKeyList">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Groups">
|
||||
<ResourceString PropertyName="titleX" bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="GroupListPanel.groupKeyList.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</TitledBorder>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new DefaultListModel<GroupKey>()" type="code"/>
|
||||
</Property>
|
||||
|
@ -90,6 +90,7 @@ class GroupListPanel extends javax.swing.JPanel {
|
||||
groupListScrollPane = new javax.swing.JScrollPane();
|
||||
groupKeyList = new javax.swing.JList<>();
|
||||
|
||||
groupKeyList.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(GroupListPanel.class, "GroupListPanel.groupKeyList.border.title"))); // NOI18N
|
||||
groupKeyList.setModel(new DefaultListModel<GroupKey>());
|
||||
groupKeyList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
groupKeyList.setCellRenderer(new GroupListRenderer());
|
||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.DefaultListModel;
|
||||
import javax.swing.JList;
|
||||
@ -40,7 +41,9 @@ import org.openide.util.NbBundle.Messages;
|
||||
import org.sleuthkit.autopsy.actions.AddContentTagAction;
|
||||
import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
|
||||
import org.sleuthkit.autopsy.directorytree.ViewContextAction;
|
||||
@ -57,6 +60,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
||||
public class ResultsPanel extends javax.swing.JPanel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final static Logger logger = Logger.getLogger(ResultsPanel.class.getName());
|
||||
private final VideoThumbnailViewer videoThumbnailViewer;
|
||||
private final ImageThumbnailViewer imageThumbnailViewer;
|
||||
private List<FileSearchFiltering.FileFilter> searchFilters;
|
||||
@ -67,7 +71,6 @@ public class ResultsPanel extends javax.swing.JPanel {
|
||||
private int currentPage = 0;
|
||||
private int previousPageSize = 10;
|
||||
private FileSearchData.FileType resultType;
|
||||
private final EamDb centralRepo;
|
||||
private int groupSize = 0;
|
||||
private PageWorker pageWorker;
|
||||
private final List<SwingWorker<Void, Void>> thumbnailWorkers = new ArrayList<>();
|
||||
@ -78,9 +81,8 @@ public class ResultsPanel extends javax.swing.JPanel {
|
||||
*/
|
||||
@Messages({"ResultsPanel.viewFileInDir.name=View File in Directory",
|
||||
"ResultsPanel.openInExternalViewer.name=Open in External Viewer"})
|
||||
public ResultsPanel(EamDb centralRepo) {
|
||||
public ResultsPanel() {
|
||||
initComponents();
|
||||
this.centralRepo = centralRepo;
|
||||
imageThumbnailViewer = new ImageThumbnailViewer();
|
||||
videoThumbnailViewer = new VideoThumbnailViewer();
|
||||
videoThumbnailViewer.addListSelectionListener((e) -> {
|
||||
@ -299,6 +301,15 @@ public class ResultsPanel extends javax.swing.JPanel {
|
||||
if (pageWorker != null && !pageWorker.isDone()) {
|
||||
pageWorker.cancel(true);
|
||||
}
|
||||
EamDb centralRepo = null;
|
||||
if (EamDb.isEnabled()) {
|
||||
try {
|
||||
centralRepo = EamDb.getInstance();
|
||||
} catch (EamDbException ex) {
|
||||
centralRepo = null;
|
||||
logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex);
|
||||
}
|
||||
}
|
||||
pageWorker = new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupKey, startingEntry, pageSize, resultType, centralRepo);
|
||||
pageWorker.execute();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user