20 package org.sleuthkit.autopsy.commonfilesearch;
27 final class SingleDataSource
extends CommonFilesMetadataBuilder {
29 private static final String WHERE_CLAUSE =
"%s md5 in (select md5 from tsk_files where md5 in (select md5 from tsk_files where (known != 1 OR known IS NULL) and data_source_obj_id=%s%s) GROUP BY md5 HAVING COUNT(*) > 1) order by md5";
30 private final Long selectedDataSourceId;
31 private final String dataSourceName;
43 SingleDataSource(Long dataSourceId, Map<Long, String> dataSourceIdMap,
boolean filterByMediaMimeType,
boolean filterByDocMimeType) {
44 super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType);
45 this.selectedDataSourceId = dataSourceId;
46 this.dataSourceName = dataSourceIdMap.get(this.selectedDataSourceId);
50 protected String buildSqlSelectStatement() {
51 Object[] args =
new String[]{SELECT_PREFIX, Long.toString(this.selectedDataSourceId), determineMimeTypeFilter()};
52 return String.format(SingleDataSource.WHERE_CLAUSE, args);
56 protected String buildTabTitle() {
57 final String buildCategorySelectionString = this.buildCategorySelectionString();
58 final String titleTemplate = Bundle.CommonFilesMetadataBuilder_buildTabTitle_titleSingle();
59 return String.format(titleTemplate,
new Object[]{this.dataSourceName, buildCategorySelectionString});