From 8f11dcffd31fb1e76e4e2cb4082de61616be4978 Mon Sep 17 00:00:00 2001 From: Andrew Ziehl Date: Wed, 11 Jul 2018 21:09:27 -0700 Subject: [PATCH] Cleanup --- .../AllCasesEamDbCommonFilesAlgorithm.java | 5 ++--- .../commonfilesearch/CommonFilesPanel.java | 16 ++++++++-------- .../EamDbCommonFilesAlgorithm.java | 6 ++---- .../SingleCaseEamDbCommonFilesAlgorithm.java | 7 +++---- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/AllCasesEamDbCommonFilesAlgorithm.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/AllCasesEamDbCommonFilesAlgorithm.java index 8aad1eb1bb..251ee3e454 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/AllCasesEamDbCommonFilesAlgorithm.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/AllCasesEamDbCommonFilesAlgorithm.java @@ -19,7 +19,6 @@ */ package org.sleuthkit.autopsy.commonfilesearch; -import java.util.Map; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; /** @@ -28,7 +27,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; */ public class AllCasesEamDbCommonFilesAlgorithm extends EamDbCommonFilesAlgorithm { - public AllCasesEamDbCommonFilesAlgorithm(Map dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException { - super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType); + public AllCasesEamDbCommonFilesAlgorithm(boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException { + super(filterByMediaMimeType, filterByDocMimeType); } } diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java index ce33631c16..92df647941 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesPanel.java @@ -126,7 +126,7 @@ public final class CommonFilesPanel extends javax.swing.JPanel { private void setTitleForSingleSource(Long dataSourceId) { final String CommonFilesPanel_search_results_titleSingle = Bundle.CommonFilesPanel_search_results_titleSingle(); - final Object[] dataSourceName = new Object[]{CommonFilesPanel.this.intraCasePanel.getDataSourceMap().get(dataSourceId)}; + final Object[] dataSourceName = new Object[]{intraCasePanel.getDataSourceMap().get(dataSourceId)}; this.tabTitle = String.format(CommonFilesPanel_search_results_titleSingle, dataSourceName); } @@ -138,8 +138,8 @@ public final class CommonFilesPanel extends javax.swing.JPanel { progress.start(); progress.switchToIndeterminate(); - Long dataSourceId = CommonFilesPanel.this.intraCasePanel.getSelectedDataSourceId(); - Integer caseId = CommonFilesPanel.this.interCasePanel.getSelectedCaseId(); + Long dataSourceId = intraCasePanel.getSelectedDataSourceId(); + Integer caseId = interCasePanel.getSelectedCaseId(); CommonFilesMetadataBuilder builder; CommonFilesMetadata metadata; @@ -158,23 +158,23 @@ public final class CommonFilesPanel extends javax.swing.JPanel { if (CommonFilesPanel.this.interCaseRadio.isSelected()) { if (caseId == InterCasePanel.NO_CASE_SELECTED) { - builder = new AllCasesEamDbCommonFilesAlgorithm(CommonFilesPanel.this.intraCasePanel.getDataSourceMap(), filterByMedia, filterByDocuments); + builder = new AllCasesEamDbCommonFilesAlgorithm(filterByMedia, filterByDocuments); } else { - builder = new SingleCaseEamDbCommonFilesAlgorithm(caseId, CommonFilesPanel.this.intraCasePanel.getDataSourceMap(), filterByMedia, filterByDocuments); + builder = new SingleCaseEamDbCommonFilesAlgorithm(caseId, filterByMedia, filterByDocuments); } } else { if (dataSourceId == CommonFilesPanel.NO_DATA_SOURCE_SELECTED) { - builder = new AllDataSourcesCommonFilesAlgorithm(CommonFilesPanel.this.intraCasePanel.getDataSourceMap(), filterByMedia, filterByDocuments); + builder = new AllDataSourcesCommonFilesAlgorithm(intraCasePanel.getDataSourceMap(), filterByMedia, filterByDocuments); setTitleForAllDataSources(); } else { - builder = new SingleDataSource(dataSourceId, CommonFilesPanel.this.intraCasePanel.getDataSourceMap(), filterByMedia, filterByDocuments); + builder = new SingleDataSource(dataSourceId, intraCasePanel.getDataSourceMap(), filterByMedia, filterByDocuments); setTitleForSingleSource(dataSourceId); } } - //TODO set title from one method rathe than two (or more) overloads + //TODO set title from one method rather than two (or more) overloads metadata = builder.findFiles(); this.tabTitle = builder.buildTabTitle(); diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/EamDbCommonFilesAlgorithm.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/EamDbCommonFilesAlgorithm.java index 8b34e6dfad..e292acb0b0 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/EamDbCommonFilesAlgorithm.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/EamDbCommonFilesAlgorithm.java @@ -48,7 +48,6 @@ public abstract class EamDbCommonFilesAlgorithm extends CommonFilesMetadataBuild * Implements the algorithm for getting common files across all data sources * and all cases. Can filter on mime types conjoined by logical AND. * - * @param dataSourceIdMap a map of obj_id to datasource name * @param filterByMediaMimeType match only on files whose mime types can be * broadly categorized as media types * @param filterByDocMimeType match only on files whose mime types can be @@ -56,9 +55,8 @@ public abstract class EamDbCommonFilesAlgorithm extends CommonFilesMetadataBuild * * @throws EamDbException */ - EamDbCommonFilesAlgorithm(Map dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException { - super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType); - + EamDbCommonFilesAlgorithm(boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException { + super(new HashMap(), filterByMediaMimeType, filterByDocMimeType); // Pass empty datasources. Unused for intercase matches. dbManager = EamDb.getInstance(); } diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleCaseEamDbCommonFilesAlgorithm.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleCaseEamDbCommonFilesAlgorithm.java index 339d0846a1..622057e06c 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleCaseEamDbCommonFilesAlgorithm.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleCaseEamDbCommonFilesAlgorithm.java @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.commonfilesearch; import java.sql.SQLException; -import java.util.Map; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; @@ -37,13 +36,12 @@ public class SingleCaseEamDbCommonFilesAlgorithm extends EamDbCommonFilesAlgorit /** * * @param correlationCaseId - * @param dataSourceIdMap * @param filterByMediaMimeType * @param filterByDocMimeType * @throws EamDbException */ - public SingleCaseEamDbCommonFilesAlgorithm(int correlationCaseId, Map dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException { - super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType); + public SingleCaseEamDbCommonFilesAlgorithm(int correlationCaseId, boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException { + super(filterByMediaMimeType, filterByDocMimeType); this.corrleationCaseId = correlationCaseId; } @@ -67,4 +65,5 @@ public class SingleCaseEamDbCommonFilesAlgorithm extends EamDbCommonFilesAlgorit return this.findFiles(cCase); } + }