Autopsy  4.9.1
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 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.commonfilesearch;
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.commonfilesearch.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 EamDbException {
53  super(filterByMediaMimeType, filterByDocMimeType, corAttrType, percentageThreshold);
54  }
55 
56  @Override
58  InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(corAttrType);
59  Map<Integer, CommonAttributeValueList> interCaseCommonFiles = eamDbAttrInst.findInterCaseValuesByCount(Case.getCurrentCase());
60  Set<String> mimeTypesToFilterOn = new HashSet<>();
61  if (isFilterByMedia()) {
62  mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
63  }
64  if (isFilterByDoc()) {
65  mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
66  }
67  return new CommonAttributeCountSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType, mimeTypesToFilterOn);
68  }
69 
70  @Override
72  InterCaseSearchResultsProcessor eamDbAttrInst = new InterCaseSearchResultsProcessor(corAttrType);
73  Map<String, Map<String, CommonAttributeValueList>> interCaseCommonFiles = eamDbAttrInst.findInterCaseValuesByCase(Case.getCurrentCase());
74  Set<String> mimeTypesToFilterOn = new HashSet<>();
75  if (isFilterByMedia()) {
76  mimeTypesToFilterOn.addAll(MEDIA_PICS_VIDEO_MIME_TYPES);
77  }
78  if (isFilterByDoc()) {
79  mimeTypesToFilterOn.addAll(TEXT_FILES_MIME_TYPES);
80  }
81  return new CommonAttributeCaseSearchResults(interCaseCommonFiles, this.frequencyPercentageThreshold, this.corAttrType, mimeTypesToFilterOn);
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-2018 Basis Technology. Generated on: Tue Dec 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.