Go to the documentation of this file.
20package org.sleuthkit.autopsy.commonpropertiessearch;
22import java.util.ArrayList;
23import java.util.Collection;
24import java.util.Collections;
25import java.util.HashMap;
26import java.util.HashSet;
30import java.util.stream.Collectors;
31import org.sleuthkit.datamodel.AbstractFile;
37final public class CommonAttributeValue {
41 private final Map<String, Integer>
fileNames =
new HashMap<>();
43 CommonAttributeValue(String
value) {
45 this.fileInstances =
new ArrayList<>();
57 String getTokenFileName() {
58 String tokenFileName =
null;
75 return this.fileInstances.stream().map(AbstractCommonAttributeInstance::getCaseName).collect(Collectors.joining(
", "));
84 Set<String> sources =
new HashSet<>();
86 sources.add(data.getDataSource());
98 int getNumberOfDataSourcesInCurrentCase() {
99 Set<Long> dataSourceIds =
new HashSet<>();
101 AbstractFile file = data.getAbstractFile();
103 dataSourceIds.add(file.getDataSourceObjectId());
106 return dataSourceIds.size();
109 void addInstance(AbstractCommonAttributeInstance metadata) {
110 if (metadata.getAbstractFile() !=
null) {
111 Integer currentValue =
fileNames.get(metadata.getAbstractFile().getName());
112 currentValue = currentValue ==
null ? 1 : currentValue+1;
113 fileNames.put(metadata.getAbstractFile().getName(), currentValue);
115 this.fileInstances.add(metadata);
119 return Collections.unmodifiableCollection(this.fileInstances);
129 return this.fileInstances.size();
final Map< String, Integer > fileNames
final List< AbstractCommonAttributeInstance > fileInstances
Set< String > getDataSources()
Collection< AbstractCommonAttributeInstance > getInstances()
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.