Autopsy  4.14.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
SingleIntraCaseCommonAttributeSearcher.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2018 Basis Technology Corp.
6  * Contact: carrier <at> sleuthkit <dot> org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 package org.sleuthkit.autopsy.commonpropertiessearch;
21 
22 import java.util.Map;
23 import org.openide.util.NbBundle;
24 import org.sleuthkit.datamodel.TskData.FileKnown;
25 
30 
31  private static final String WHERE_CLAUSE = "%s md5 in (select md5 from tsk_files where md5 in (select md5 from tsk_files where (known != " + FileKnown.KNOWN.getFileKnownValue() + " OR known IS NULL) and data_source_obj_id=%s%s) GROUP BY md5 HAVING COUNT(DISTINCT data_source_obj_id) > 1) order by md5"; //NON-NLS
32  private final Long selectedDataSourceId;
33  private final String dataSourceName;
34 
48  public SingleIntraCaseCommonAttributeSearcher(Long dataSourceId, Map<Long, String> dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType, int percentageThreshold) {
49  super(dataSourceIdMap, filterByMediaMimeType, filterByDocMimeType, percentageThreshold);
50  this.selectedDataSourceId = dataSourceId;
51  this.dataSourceName = dataSourceIdMap.get(this.selectedDataSourceId);
52  }
53 
54  @Override
55  protected String buildSqlSelectStatement() {
56  Object[] args = new String[]{SELECT_PREFIX, Long.toString(this.selectedDataSourceId), determineMimeTypeFilter()};
57  return String.format(SingleIntraCaseCommonAttributeSearcher.WHERE_CLAUSE, args);
58  }
59 
60  @NbBundle.Messages({
61  "# {0} - data source name",
62  "# {1} - build category",
63  "# {2} - threshold string",
64  "SingleIntraCaseCommonAttributeSearcher.buildTabTitle.titleIntraSingle=Common Properties (Data Source: {0}, {1}{2})"})
65  @Override
66  String getTabTitle() {
67  return Bundle.SingleIntraCaseCommonAttributeSearcher_buildTabTitle_titleIntraSingle(this.dataSourceName, this.buildCategorySelectionString(), this.getPercentThresholdString());
68  }
69 }
SingleIntraCaseCommonAttributeSearcher(Long dataSourceId, Map< Long, String > dataSourceIdMap, boolean filterByMediaMimeType, boolean filterByDocMimeType, int percentageThreshold)

Copyright © 2012-2020 Basis Technology. Generated on: Wed Apr 8 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.