19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
33 class OtherOccurrenceNodeInstanceData
implements OtherOccurrenceNodeData {
37 private static final String FILE_TYPE_STR =
"Files";
39 private final String caseName;
40 private String deviceID;
41 private String dataSourceName;
42 private final String filePath;
43 private final String typeStr;
44 private final String value;
45 private TskData.FileKnown known;
46 private String comment;
48 private AbstractFile originalAbstractFile = null;
49 private CorrelationAttributeInstance originalCorrelationInstance = null;
57 OtherOccurrenceNodeInstanceData(CorrelationAttributeInstance instance, CorrelationAttributeInstance.Type type, String value) {
58 caseName = instance.getCorrelationCase().getDisplayName();
59 deviceID = instance.getCorrelationDataSource().getDeviceID();
60 dataSourceName = instance.getCorrelationDataSource().getName();
61 filePath = instance.getFilePath();
62 this.typeStr = type.getDisplayName();
64 known = instance.getKnownStatus();
65 comment = instance.getComment();
67 originalCorrelationInstance = instance;
76 OtherOccurrenceNodeInstanceData(AbstractFile newFile, Case autopsyCase)
throws EamDbException {
77 caseName = autopsyCase.getDisplayName();
79 DataSource dataSource = autopsyCase.getSleuthkitCase().getDataSource(newFile.getDataSource().getId());
80 deviceID = dataSource.getDeviceId();
81 dataSourceName = dataSource.getName();
82 }
catch (TskDataException | TskCoreException ex) {
83 throw new EamDbException(
"Error loading data source for abstract file ID " + newFile.getId(), ex);
86 filePath = newFile.getParentPath() + newFile.getName();
87 typeStr = FILE_TYPE_STR;
88 value = newFile.getMd5Hash();
89 known = newFile.getKnown();
92 originalAbstractFile = newFile;
99 boolean isFileType() {
100 return FILE_TYPE_STR.equals(typeStr);
107 void updateKnown(TskData.FileKnown newKnownStatus) {
108 known = newKnownStatus;
115 void updateComment(String newComment) {
116 comment = newComment;
123 boolean isCentralRepoNode() {
124 return (originalCorrelationInstance != null);
132 CorrelationAttributeInstance getCorrelationAttribute() throws EamDbException {
133 if (! isCentralRepoNode() ) {
134 throw new EamDbException(
"Can not create CorrelationAttribute for non central repo node");
136 return originalCorrelationInstance;
143 String getCaseName() {
151 String getDeviceID() {
159 String getDataSourceName() {
160 return dataSourceName;
167 String getFilePath() {
191 TskData.FileKnown getKnown() {
199 String getComment() {
208 AbstractFile getAbstractFile() throws EamDbException {
209 if (originalCorrelationInstance == null) {
210 throw new EamDbException(
"AbstractFile is null");
212 return originalAbstractFile;
221 CorrelationAttributeInstance getCorrelationAttributeInstance() throws EamDbException {
222 if (originalCorrelationInstance == null) {
223 throw new EamDbException(
"CorrelationAttributeInstance is null");
225 return originalCorrelationInstance;