Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
AllInterCaseCommonAttributeSearcher.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2018-2019 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.sql.SQLException;
23 import java.util.HashSet;
24 import java.util.Map;
25 import java.util.Set;
26 import org.openide.util.NbBundle;
30 import org.sleuthkit.datamodel.TskCoreException;
32 import static org.sleuthkit.autopsy.commonpropertiessearch.AbstractCommonAttributeSearcher.MEDIA_PICS_VIDEO_MIME_TYPES;
33 
38 public class AllInterCaseCommonAttributeSearcher extends InterCaseCommonAttributeSearcher {
39 
52  public AllInterCaseCommonAttributeSearcher(boolean filterByMediaMimeType, boolean filterByDocMimeType, Type corAttrType, int percentageThreshold) throws CentralRepoException {
53  super(filterByMediaMimeType, filterByDocMimeType, corAttrType, percentageThreshold);
54  }
55 
56  @Override
58  InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(corAttrType);
59  Set<String> mimeTypesToFilterOn = new HashSet<>();
60  if (isFilterByMedia()) {
61  mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
62  }
63  if (isFilterByDoc()) {
64  mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
65  }
66  Map<Integer, CommonAttributeValueList> interCaseCommonFiles = eamDbAttrInst.findInterCaseValuesByCount(Case.getCurrentCase(), mimeTypesToFilterOn);
67  return new CommonAttributeCountSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType);
68  }
69 
70  @Override
72  InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(corAttrType);
73  Set<String> mimeTypesToFilterOn = new HashSet<>();
74  if (isFilterByMedia()) {
75  mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
76  }
77  if (isFilterByDoc()) {
78  mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
79  }
80  Map<String, Map<String, CommonAttributeValueList>> interCaseCommonFiles = eamDbAttrInst.findInterCaseValuesByCase(Case.getCurrentCase(), mimeTypesToFilterOn);
81  return new CommonAttributeCaseSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType);
82  }
83 
84  @NbBundle.Messages({
85  "# {0} - attr type",
86  "# {1} - threshold string",
87  "AllInterCaseCommonAttributeSearcher.buildTabTitle.titleInterAll=Common Properties (All Central Repository Cases, {0}{1})"})
88  @Override
89  String getTabTitle() {
90  String typeString = this.corAttrType.getDisplayName();
91  if (typeString.equals("Files")) {
92  typeString = this.buildCategorySelectionString();
93  }
94  return Bundle.AllInterCaseCommonAttributeSearcher_buildTabTitle_titleInterAll(typeString, this.getPercentThresholdString());
95  }
96 }
AllInterCaseCommonAttributeSearcher(boolean filterByMediaMimeType, boolean filterByDocMimeType, Type corAttrType, int percentageThreshold)

Copyright © 2012-2022 Basis Technology. Generated on: Tue Aug 1 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.