Autopsy  4.8.0
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 
56  AbstractCommonAttributeInstance(Long abstractFileReference, String dataSource, String caseName) {
57  this.abstractFileObjectId = abstractFileReference;
58  this.caseName = caseName;
59  this.dataSource = dataSource;
60  }
61 
70  this.abstractFileObjectId = -1L;
71  this.caseName = "";
72  this.dataSource = "";
73  }
74 
79  public abstract CorrelationAttributeInstance.Type getCorrelationAttributeInstanceType();
80 
89  abstract AbstractFile getAbstractFile();
90 
97  abstract DisplayableItemNode[] generateNodes();
98 
104  String getCaseName() {
105  return this.caseName;
106  }
107 
113  public String getDataSource() {
114 
120  return this.dataSource;
121  }
122 
129  public Long getAbstractFileObjectId() {
130  return abstractFileObjectId;
131  }
132 
154  static DisplayableItemNode createNode(CorrelationAttributeInstance attribute, AbstractFile abstractFile, String currentCaseName) throws TskCoreException {
155 
156  DisplayableItemNode leafNode;
157 
158  if (abstractFile == null) {
159  leafNode = new CentralRepoCommonAttributeInstanceNode(attribute);
160  } else {
161  final String abstractFileDataSourceName = abstractFile.getDataSource().getName();
162  leafNode = new CaseDBCommonAttributeInstanceNode(abstractFile, currentCaseName, abstractFileDataSourceName);
163  }
164 
165  return leafNode;
166  }
167 }
abstract CorrelationAttributeInstance.Type getCorrelationAttributeInstanceType()

Copyright © 2012-2018 Basis Technology. Generated on: Thu Oct 4 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.