From 28a011c3e9cc396340a3c4d3f68c09398fa04d6c Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 27 Jul 2021 13:04:00 -0400 Subject: [PATCH 1/3] 3849 - select data source automatically when performing search from context menu --- .../autopsy/datamodel/ImageNode.java | 2 +- .../datamodel/SpecialDirectoryNode.java | 2 +- .../directorytree/FileSearchAction.java | 22 ++++++++++++++----- .../directorytree/FileSearchProvider.java | 4 +++- .../autopsy/filesearch/DataSourceFilter.java | 18 ++++++++++----- .../autopsy/filesearch/DataSourcePanel.java | 15 ++++++++++++- .../autopsy/filesearch/FileSearchAction.java | 14 +++++++++++- .../autopsy/filesearch/FileSearchDialog.java | 4 ++++ .../autopsy/filesearch/FileSearchPanel.java | 7 +++++- 9 files changed, 71 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index 5df888052b..feada332a5 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -110,7 +110,7 @@ public class ImageNode extends AbstractContentNode { actionsList.add(a); } actionsList.addAll(ExplorerNodeActionVisitor.getActions(content)); - actionsList.add(new FileSearchAction(Bundle.ImageNode_getActions_openFileSearchByAttr_text())); + actionsList.add(new FileSearchAction(Bundle.ImageNode_getActions_openFileSearchByAttr_text(), content.getId())); actionsList.add(new ViewSummaryInformationAction(content.getId())); actionsList.add(new RunIngestModulesAction(Collections.singletonList(content))); actionsList.add(new NewWindowViewAction(NbBundle.getMessage(this.getClass(), "ImageNode.getActions.viewInNewWin.text"), this)); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java index a3c6691ba2..0cb1046d94 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java @@ -65,7 +65,7 @@ public abstract class SpecialDirectoryNode extends AbstractAbstractFileNodesingletonList(content))); diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java index 9ec86b7900..0cc0bf237d 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * + * * Copyright 2011 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,14 +28,26 @@ import org.openide.util.Lookup; */ public class FileSearchAction extends AbstractAction { + private final Long dataSourceId; + + public FileSearchAction(String title, long dataSourceID) { + super(title); + dataSourceId = dataSourceID; + } + public FileSearchAction(String title) { super(title); + dataSourceId = null; } @Override public void actionPerformed(ActionEvent e) { FileSearchProvider searcher = Lookup.getDefault().lookup(FileSearchProvider.class); - searcher.showDialog(); + if (dataSourceId == null) { + searcher.showDialog(); + } else { + searcher.showDialog(dataSourceId); + } } } diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java index 991126e2c5..7b2b0cbeed 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011 Basis Technology Corp. + * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,5 +23,7 @@ package org.sleuthkit.autopsy.directorytree; */ public interface FileSearchProvider { + public void showDialog(long dataSourceID); + public void showDialog(); } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java index 4ef41b78d8..80f26103fd 100755 --- a/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2018 Basis Technology Corp. + * Copyright 2018-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,16 +28,18 @@ class DataSourceFilter extends AbstractFileSearchFilter { /** * Construct DataSourceFilter with the DataSourcePanel + * * @param component A DataSourcePanel */ - public DataSourceFilter(DataSourcePanel component) { + DataSourceFilter(DataSourcePanel component) { super(component); } /** - * Default constructor to construct a new DataSourceFilter with a new DataSourcePanel + * Default constructor to construct a new DataSourceFilter with a new + * DataSourcePanel */ - public DataSourceFilter() { + DataSourceFilter() { this(new DataSourcePanel()); } @@ -46,6 +48,10 @@ class DataSourceFilter extends AbstractFileSearchFilter { return this.getComponent().isSelected(); } + void setSelectedDataSource(long dataSourceId) { + this.getComponent().setDataSourceSelected(dataSourceId); + } + @Override public String getPredicate() throws FilterValidationException { String predicate = ""; @@ -64,11 +70,11 @@ class DataSourceFilter extends AbstractFileSearchFilter { } @Override - @Messages ({ + @Messages({ "DataSourceFilter.errorMessage.emptyDataSource=At least one data source must be selected." }) public boolean isValid() { - if(this.getComponent().getDataSourcesSelected().isEmpty()){ + if (this.getComponent().getDataSourcesSelected().isEmpty()) { setLastError(Bundle.DataSourceFilter_errorMessage_emptyDataSource()); return false; } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DataSourcePanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/DataSourcePanel.java index 28fae71c5b..3bc4df940d 100755 --- a/Core/src/org/sleuthkit/autopsy/filesearch/DataSourcePanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/DataSourcePanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2018 Basis Technology Corp. + * Copyright 2018-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -128,6 +128,19 @@ public class DataSourcePanel extends javax.swing.JPanel { this.dataSourceNoteLabel.setEnabled(enabled); } + /** + * Set the data source initially selected in this filter. + * + * @param dataSourceId - The object ID of the data source which will be + * selected. + */ + void setDataSourceSelected(long dataSourceId) { + this.dataSourceCheckBox.setSelected(true); + setComponentsEnabled(); + String dataSourceName = dataSourceMap.get(dataSourceId); + dataSourceList.setSelectedValue(dataSourceName, true); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java index da89cea697..bdbcf8a919 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java @@ -32,6 +32,7 @@ final class FileSearchAction extends CallableSystemAction implements FileSearchP private static final long serialVersionUID = 1L; private static FileSearchAction instance = null; private static FileSearchDialog searchDialog; + private static Long selectedDataSourceId; FileSearchAction() { super(); @@ -54,8 +55,9 @@ final class FileSearchAction extends CallableSystemAction implements FileSearchP public void actionPerformed(ActionEvent e) { if (searchDialog == null) { searchDialog = new FileSearchDialog(); - } + //Preserve whatever the previously selected data source was + selectedDataSourceId = null; searchDialog.setVisible(true); } @@ -64,6 +66,8 @@ final class FileSearchAction extends CallableSystemAction implements FileSearchP if (searchDialog == null) { searchDialog = new FileSearchDialog(); } + // + searchDialog.setSelectedDataSourceFilter(selectedDataSourceId); searchDialog.setVisible(true); } @@ -82,8 +86,16 @@ final class FileSearchAction extends CallableSystemAction implements FileSearchP return false; } + @Override + public void showDialog(long dataSourceId) { + selectedDataSourceId = dataSourceId; + performAction(); + + } + @Override public void showDialog() { + selectedDataSourceId = null; performAction(); } } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java index de5642496e..5c5f4003f1 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java @@ -48,6 +48,10 @@ final class FileSearchDialog extends javax.swing.JDialog { }); } + void setSelectedDataSourceFilter(long dataSourceId){ + fileSearchPanel1.setDataSourceFilter(dataSourceId); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index 4801227416..c7d840ee7c 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -59,6 +59,7 @@ class FileSearchPanel extends javax.swing.JPanel { private final List filters = new ArrayList<>(); private static int resultWindowCount = 0; //keep track of result windows so they get unique names private static final String EMPTY_WHERE_CLAUSE = NbBundle.getMessage(DateSearchFilter.class, "FileSearchPanel.emptyWhereClause.text"); + private static DataSourceFilter dataSourceFilter; enum EVENT { CHECKED @@ -101,7 +102,7 @@ class FileSearchPanel extends javax.swing.JPanel { KnownStatusSearchFilter knowStatusFilter = new KnownStatusSearchFilter(); HashSearchFilter hashFilter = new HashSearchFilter(); MimeTypeFilter mimeTypeFilter = new MimeTypeFilter(); - DataSourceFilter dataSourceFilter = new DataSourceFilter(); + dataSourceFilter = new DataSourceFilter(); panel2.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.name"),nameFilter)); @@ -145,6 +146,10 @@ class FileSearchPanel extends javax.swing.JPanel { searchButton.setEnabled(isValidSearch()); } + void setDataSourceFilter(long dataSourceId){ + dataSourceFilter.setSelectedDataSource(dataSourceId); + } + /** * @return true if any of the filters in the panel are enabled (checked) */ From 8d70a5531506ac4d523011c7fc9ae56a274792e5 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 27 Jul 2021 13:09:42 -0400 Subject: [PATCH 2/3] 3849 update copyright and comments --- .../autopsy/datamodel/ImageNode.java | 2 +- .../datamodel/SpecialDirectoryNode.java | 2 +- .../directorytree/FileSearchAction.java | 2 +- .../autopsy/filesearch/DataSourceFilter.java | 5 ++ .../autopsy/filesearch/FileSearchDialog.java | 20 ++++--- .../autopsy/filesearch/FileSearchPanel.java | 59 ++++++++++--------- 6 files changed, 52 insertions(+), 38 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index feada332a5..f5eed043fa 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2012-2019 Basis Technology Corp. + * Copyright 2012-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java index 0cb1046d94..244f9ece70 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/SpecialDirectoryNode.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2017-2019 Basis Technology Corp. + * Copyright 2017-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java index 0cc0bf237d..a3f64f1e13 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011 Basis Technology Corp. + * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java index 80f26103fd..cb711ca1b0 100755 --- a/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/DataSourceFilter.java @@ -48,6 +48,11 @@ class DataSourceFilter extends AbstractFileSearchFilter { return this.getComponent().isSelected(); } + /** + * Set the data source filter to select the specified data source initially. + * + * @param dataSourceId - The data source to select. + */ void setSelectedDataSource(long dataSourceId) { this.getComponent().setDataSourceSelected(dataSourceId); } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java index 5c5f4003f1..eb77c7f245 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchDialog.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * - * Copyright 2011-2018 Basis Technology Corp. + * + * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -48,10 +48,15 @@ final class FileSearchDialog extends javax.swing.JDialog { }); } - void setSelectedDataSourceFilter(long dataSourceId){ + /** + * Set the data source filter to select the specified data source initially. + * + * @param dataSourceId - The data source to select. + */ + void setSelectedDataSourceFilter(long dataSourceId) { fileSearchPanel1.setDataSourceFilter(dataSourceId); } - + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -83,4 +88,3 @@ final class FileSearchDialog extends javax.swing.JDialog { private org.sleuthkit.autopsy.filesearch.FileSearchPanel fileSearchPanel1; // End of variables declaration//GEN-END:variables } - diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index c7d840ee7c..e1e716269a 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * - * Copyright 2011-2019 Basis Technology Corp. + * + * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -78,39 +78,39 @@ class FileSearchPanel extends javax.swing.JPanel { * This method is called from within the constructor to initialize the form. */ private void customizeComponents() { - + JLabel label = new JLabel(NbBundle.getMessage(this.getClass(), "FileSearchPanel.custComp.label.text")); label.setAlignmentX(Component.LEFT_ALIGNMENT); label.setBorder(new EmptyBorder(0, 0, 10, 0)); - + JPanel panel1 = new JPanel(); - panel1.setLayout(new GridLayout(1,2)); + panel1.setLayout(new GridLayout(1, 2)); panel1.add(new JLabel("")); JPanel panel2 = new JPanel(); - panel2.setLayout(new GridLayout(1,2, 20, 0)); + panel2.setLayout(new GridLayout(1, 2, 20, 0)); JPanel panel3 = new JPanel(); - panel3.setLayout(new GridLayout(1,2, 20, 0)); + panel3.setLayout(new GridLayout(1, 2, 20, 0)); JPanel panel4 = new JPanel(); - panel4.setLayout(new GridLayout(1,2, 20, 0)); + panel4.setLayout(new GridLayout(1, 2, 20, 0)); JPanel panel5 = new JPanel(); - panel5.setLayout(new GridLayout(1,2, 20, 0)); + panel5.setLayout(new GridLayout(1, 2, 20, 0)); // Create and add filter areas - NameSearchFilter nameFilter = new NameSearchFilter(); + NameSearchFilter nameFilter = new NameSearchFilter(); SizeSearchFilter sizeFilter = new SizeSearchFilter(); DateSearchFilter dateFilter = new DateSearchFilter(); KnownStatusSearchFilter knowStatusFilter = new KnownStatusSearchFilter(); HashSearchFilter hashFilter = new HashSearchFilter(); MimeTypeFilter mimeTypeFilter = new MimeTypeFilter(); dataSourceFilter = new DataSourceFilter(); - - panel2.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.name"),nameFilter)); - - panel3.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.metadata"),sizeFilter)); - - panel2.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.metadata"), dateFilter)); + + panel2.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.name"), nameFilter)); + + panel3.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.metadata"), sizeFilter)); + + panel2.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.metadata"), dateFilter)); panel3.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.knownStatus"), knowStatusFilter)); - + panel5.add(new FilterArea(NbBundle.getMessage(this.getClass(), "HashSearchPanel.md5CheckBox.text"), hashFilter)); panel5.add(new JLabel("")); panel4.add(new FilterArea(NbBundle.getMessage(this.getClass(), "FileSearchPanel.filterTitle.metadata"), mimeTypeFilter)); @@ -120,7 +120,7 @@ class FileSearchPanel extends javax.swing.JPanel { filterPanel.add(panel3); filterPanel.add(panel4); filterPanel.add(panel5); - + filters.add(nameFilter); filters.add(sizeFilter); filters.add(dateFilter); @@ -128,7 +128,7 @@ class FileSearchPanel extends javax.swing.JPanel { filters.add(hashFilter); filters.add(mimeTypeFilter); filters.add(dataSourceFilter); - + for (FileSearchFilter filter : this.getFilters()) { filter.addPropertyChangeListener(new PropertyChangeListener() { @Override @@ -142,14 +142,19 @@ class FileSearchPanel extends javax.swing.JPanel { public void actionPerformed(ActionEvent e) { search(); } - }); + }); searchButton.setEnabled(isValidSearch()); } - void setDataSourceFilter(long dataSourceId){ + /** + * Set the data source filter to select the specified data source initially. + * + * @param dataSourceId - The data source to select. + */ + void setDataSourceFilter(long dataSourceId) { dataSourceFilter.setSelectedDataSource(dataSourceId); } - + /** * @return true if any of the filters in the panel are enabled (checked) */ @@ -205,10 +210,10 @@ class FileSearchPanel extends javax.swing.JPanel { if (contentList.isEmpty()) { Node emptyNode = new TableFilterNode(new EmptyNode(Bundle.FileSearchPanel_emptyNode_display_text()), true); searchResultWin = DataResultTopComponent.createInstance(title, pathText, - emptyNode, 0); + emptyNode, 0); } else { searchResultWin = DataResultTopComponent.createInstance(title, pathText, - tableFilterNode, contentList.size()); + tableFilterNode, contentList.size()); } searchResultWin.requestActive(); // make it the active top component From 9b232ca9f9f0f9bb60eb90b916271c3d11b44e04 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 30 Jul 2021 15:33:00 -0400 Subject: [PATCH 3/3] 3849 address duplicate method comment on github --- .../autopsy/directorytree/FileSearchProvider.java | 13 +++++++------ .../autopsy/filesearch/FileSearchAction.java | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java index 7b2b0cbeed..523a4a69bd 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSearchProvider.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * + * * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,8 @@ package org.sleuthkit.autopsy.directorytree; */ public interface FileSearchProvider { - public void showDialog(long dataSourceID); - + public void showDialog(Long dataSourceID); + + @Deprecated public void showDialog(); } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java index d8ba8bdbc5..11d8f94561 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java @@ -90,15 +90,15 @@ final class FileSearchAction extends CallableSystemAction implements FileSearchP } @Override - public void showDialog(long dataSourceId) { + public void showDialog(Long dataSourceId) { selectedDataSourceId = dataSourceId; performAction(); } @Override + @Deprecated public void showDialog() { - selectedDataSourceId = null; - performAction(); + showDialog(null); } }