19 package org.sleuthkit.autopsy.discovery.search;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26 import java.util.logging.Level;
27 import org.openide.util.NbBundle;
51 private final List<AbstractFile>
instances =
new ArrayList<>();
65 abstractFile.getUniquePath();
66 }
catch (TskCoreException ignored) {
70 instances.add(abstractFile);
71 if (abstractFile.isDirNameFlagSet(TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
75 keywordListNames =
new ArrayList<>();
76 hashSetNames =
new ArrayList<>();
77 interestingSetNames =
new ArrayList<>();
78 objectDetectedNames =
new ArrayList<>();
89 if (deleted && !duplicate.isDirNameFlagSet(TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
98 duplicate.getUniquePath();
99 }
catch (TskCoreException ignored) {
102 instances.add(duplicate);
142 return Collections.unmodifiableList(instances);
160 if (!keywordListNames.contains(keywordListName)) {
161 keywordListNames.add(keywordListName);
165 Collections.sort(keywordListNames);
174 return Collections.unmodifiableList(keywordListNames);
183 if (!hashSetNames.contains(hashSetName)) {
184 hashSetNames.add(hashSetName);
188 Collections.sort(hashSetNames);
197 return Collections.unmodifiableList(hashSetNames);
206 if (!interestingSetNames.contains(interestingSetName)) {
207 interestingSetNames.add(interestingSetName);
211 Collections.sort(interestingSetNames);
220 return Collections.unmodifiableList(interestingSetNames);
229 if (!objectDetectedNames.contains(objectDetectedName)) {
230 objectDetectedNames.add(objectDetectedName);
234 Collections.sort(objectDetectedNames);
243 return Collections.unmodifiableList(objectDetectedNames);
252 return instances.get(0);
260 + String.join(
",", keywordListNames) +
", " +
getFirstInstance().getMIMEType();
266 || HashUtility.isNoDataMd5(
this.getFirstInstance().getMd5Hash())
267 || !HashUtility.isValidMd5Hash(
this.getFirstInstance().getMd5Hash())) {
268 return super.hashCode();
280 || HashUtility.isNoDataMd5(
this.getFirstInstance().getMd5Hash())
281 || !HashUtility.isValidMd5Hash(
this.getFirstInstance().getMd5Hash())) {
282 return super.equals(obj);
295 List<ContentTag> tags =
new ArrayList<>();
299 logger.log(Level.SEVERE,
"Failed to get tags for file " + file.getName(), ex);
305 "ResultFile.score.notableFile.description=At least one instance of the file was recognized as notable.",
306 "ResultFile.score.interestingResult.description=At least one instance of the file has an interesting result associated with it.",
307 "ResultFile.score.taggedFile.description=At least one instance of the file has been tagged.",
308 "ResultFile.score.notableTaggedFile.description=At least one instance of the file is tagged with a notable tag."})
314 if (file.getKnown() == TskData.FileKnown.BAD) {
316 scoreDescription = Bundle.ResultFile_score_notableFile_description();
322 scoreDescription = Bundle.ResultFile_score_interestingResult_description();
324 }
catch (TskCoreException ex) {
325 logger.log(Level.WARNING,
"Error getting artifacts for file: " + file.getName(), ex);
328 if (!tags.isEmpty()) {
330 scoreDescription = Bundle.ResultFile_score_taggedFile_description();
331 for (Tag tag : tags) {
332 if (tag.getName().getKnownStatus() == TskData.FileKnown.BAD) {
334 scoreDescription = Bundle.ResultFile_score_notableTaggedFile_description();
350 if (type.getMediaTypes().contains(mimeType)) {
final List< AbstractFile > instances
DataResultViewerTable.Score currentScore
String getScoreDescription()
void addDuplicate(AbstractFile duplicate)
SearchData.Frequency getFrequency()
ResultFile(AbstractFile abstractFile)
TskData.FileKnown getKnown()
List< String > getKeywordListNames()
List< String > getObjectDetectedNames()
List< String > getInterestingSetNames()
List< AbstractFile > getAllInstances()
void addHashSetName(String hashSetName)
TagsManager getTagsManager()
List< String > getHashSetNames()
final List< String > interestingSetNames
AbstractFile getFirstInstance()
List< ContentTag > getContentTagsFromDatabase(AbstractFile file)
static final Logger logger
void addKeywordListName(String keywordListName)
DataResultViewerTable.Score getScore()
final List< String > objectDetectedNames
synchronized static Logger getLogger(String name)
static Type fromMIMEtype(String mimeType)
static Case getCurrentCaseThrows()
final List< String > keywordListNames
long getDataSourceObjectId()
void addInterestingSetName(String interestingSetName)
void updateScoreAndDescription(AbstractFile file)
boolean equals(Object obj)
final List< String > hashSetNames
void addObjectDetectedName(String objectDetectedName)