Autopsy  4.9.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  */
20 package org.sleuthkit.autopsy.commonfilesearch;
21 
24 import org.sleuthkit.datamodel.AbstractFile;
25 import org.sleuthkit.datamodel.TskCoreException;
26 
40 public abstract class AbstractCommonAttributeInstance {
41 
42  private final Long abstractFileObjectId;
43  private final String caseName;
44  private final String dataSource;
45 
57  AbstractCommonAttributeInstance(Long abstractFileReference, String dataSource, String caseName) {
58  this.abstractFileObjectId = abstractFileReference;
59  this.caseName = caseName;
60  this.dataSource = dataSource;
61  }
62 
72  this.abstractFileObjectId = -1L;
73  this.caseName = "";
74  this.dataSource = "";
75  }
76 
82  public abstract CorrelationAttributeInstance.Type getCorrelationAttributeInstanceType();
83 
92  abstract AbstractFile getAbstractFile();
93 
100  abstract DisplayableItemNode[] generateNodes();
101 
107  String getCaseName() {
108  return this.caseName;
109  }
110 
116  public String getDataSource() {
117 
123  return this.dataSource;
124  }
125 
132  public Long getAbstractFileObjectId() {
133  return abstractFileObjectId;
134  }
135 
162  static DisplayableItemNode createNode(CorrelationAttributeInstance attribute, AbstractFile abstractFile, String currentCaseName, NODE_TYPE nodeType) throws TskCoreException {
163 
164  DisplayableItemNode leafNode;
165 
166  if (abstractFile == null) {
167  leafNode = new CentralRepoCommonAttributeInstanceNode(attribute, nodeType);
168  } else {
169  final String abstractFileDataSourceName = abstractFile.getDataSource().getName();
170  leafNode = new CaseDBCommonAttributeInstanceNode(abstractFile, currentCaseName, abstractFileDataSourceName, attribute.getCorrelationValue(), nodeType);
171  }
172  return leafNode;
173  }
174 
178  public enum NODE_TYPE {
179  //depending on the type of results displayed different columns will be necessary to display complete information
182  }
183 }
abstract CorrelationAttributeInstance.Type getCorrelationAttributeInstanceType()

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.