Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
AbstractCommonAttributeInstance.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 */
20package org.sleuthkit.autopsy.commonpropertiessearch;
21
22import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
23import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
24import org.sleuthkit.datamodel.AbstractFile;
25import org.sleuthkit.datamodel.TskCoreException;
26
40public abstract class AbstractCommonAttributeInstance {
41
42 private final Long abstractFileObjectId;
43 private final String caseName;
44 private final String dataSource;
45
46 // Reference to the AbstractFile instance in the current case
47 // that matched on one of the common properties.
48 protected AbstractFile abstractFile;
49
58 AbstractCommonAttributeInstance(Long abstractFileReference, String dataSource, String caseName) {
59 this.abstractFileObjectId = abstractFileReference;
60 this.caseName = caseName;
61 this.dataSource = dataSource;
62 this.abstractFile = null;
63 }
64
70 this(-1L, "", "");
71 }
72
79
88 abstract AbstractFile getAbstractFile();
89
96 abstract DisplayableItemNode[] generateNodes();
97
103 String getCaseName() {
104 return this.caseName;
105 }
106
112 public String getDataSource() {
113
119 return this.dataSource;
120 }
121
130 }
131
158 static DisplayableItemNode createNode(CorrelationAttributeInstance attribute, AbstractFile abstractFile, String currentCaseName, NODE_TYPE nodeType) throws TskCoreException {
159
160 DisplayableItemNode leafNode;
161
162 if (abstractFile == null) {
163 leafNode = new CentralRepoCommonAttributeInstanceNode(attribute, nodeType);
164 } else {
165 final String abstractFileDataSourceName = abstractFile.getDataSource().getName();
166 leafNode = new CaseDBCommonAttributeInstanceNode(abstractFile, currentCaseName, abstractFileDataSourceName, attribute.getCorrelationValue(), nodeType);
167 }
168 return leafNode;
169 }
170
174 public enum NODE_TYPE {
175 //depending on the type of results displayed different columns will be necessary to display complete information
178 }
179}
abstract CorrelationAttributeInstance.Type getCorrelationAttributeInstanceType()

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.