1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-03 14:30:01 +00:00
This commit is contained in:
Andrew Ziehl
2018-07-11 21:09:27 -07:00
parent bea4199540
commit 8f11dcffd3
4 changed files with 15 additions and 19 deletions

View File

@@ -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<Long, String> dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException {
super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType);
public AllCasesEamDbCommonFilesAlgorithm(boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException {
super(filterByMediaMimeType, filterByDocMimeType);
}
}

View File

@@ -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();

View File

@@ -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<Long, String> dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException {
super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType);
EamDbCommonFilesAlgorithm(boolean filterByMediaMimeType, boolean filterByDocMimeType) throws EamDbException {
super(new HashMap<Long, String>(), filterByMediaMimeType, filterByDocMimeType); // Pass empty datasources. Unused for intercase matches.
dbManager = EamDb.getInstance();
}

View File

@@ -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<Long, String> 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);
}
}