Autopsy  4.6.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CorrelationAttributeInstance.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2017 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.centralrepository.datamodel;
20 
21 import java.io.Serializable;
22 import org.openide.util.NbBundle.Messages;
23 import org.sleuthkit.datamodel.TskData;
24 
31 @Messages({
32  "EamArtifactInstances.knownStatus.bad=Bad",
33  "EamArtifactInstances.knownStatus.known=Known",
34  "EamArtifactInstances.knownStatus.unknown=Unknown"})
35 public class CorrelationAttributeInstance implements Serializable {
36 
37  private static final long serialVersionUID = 1L;
38 
39  private int ID;
42  private String filePath;
43  private String comment;
44  private TskData.FileKnown knownStatus;
45 
47  CorrelationCase eamCase,
48  CorrelationDataSource eamDataSource
49  ) throws EamDbException {
50  this(-1, eamCase, eamDataSource, "", null, TskData.FileKnown.UNKNOWN);
51  }
52 
54  CorrelationCase eamCase,
55  CorrelationDataSource eamDataSource,
56  String filePath
57  ) throws EamDbException {
58  this(-1, eamCase, eamDataSource, filePath, null, TskData.FileKnown.UNKNOWN);
59  }
60 
62  CorrelationCase eamCase,
63  CorrelationDataSource eamDataSource,
64  String filePath,
65  String comment
66  ) throws EamDbException {
67  this(-1, eamCase, eamDataSource, filePath, comment, TskData.FileKnown.UNKNOWN);
68  }
69 
71  CorrelationCase eamCase,
72  CorrelationDataSource eamDataSource,
73  String filePath,
74  String comment,
75  TskData.FileKnown knownStatus
76  ) throws EamDbException {
77  this(-1, eamCase, eamDataSource, filePath, comment, knownStatus);
78  }
79 
81  int ID,
82  CorrelationCase eamCase,
83  CorrelationDataSource eamDataSource,
84  String filePath,
85  String comment,
86  TskData.FileKnown knownStatus
87  ) throws EamDbException {
88  if(filePath == null) {
89  throw new EamDbException("file path is null");
90  }
91 
92  this.ID = ID;
93  this.correlationCase = eamCase;
94  this.correlationDataSource = eamDataSource;
95  // Lower case paths to normalize paths and improve correlation results, if this causes significant issues on case-sensitive file systems, remove
96  this.filePath = filePath.toLowerCase();
97  this.comment = comment;
98  this.knownStatus = knownStatus;
99  }
100 
101  public Boolean equals(CorrelationAttributeInstance otherInstance) {
102  return ((this.getID() == otherInstance.getID())
103  && (this.getCorrelationCase().equals(otherInstance.getCorrelationCase()))
104  && (this.getCorrelationDataSource().equals(otherInstance.getCorrelationDataSource()))
105  && (this.getFilePath().equals(otherInstance.getFilePath()))
106  && (this.getKnownStatus().equals(otherInstance.getKnownStatus()))
107  && (this.getComment().equals(otherInstance.getComment())));
108  }
109 
110  @Override
111  public String toString() {
112  return this.getID()
113  + this.getCorrelationCase().getCaseUUID()
114  + this.getCorrelationDataSource().getDeviceID()
115  + this.getFilePath()
116  + this.getKnownStatus()
117  + this.getComment();
118  }
119 
123  int getID() {
124  return ID;
125  }
126 
131  return correlationCase;
132  }
133 
138  return correlationDataSource;
139  }
140 
144  public String getFilePath() {
145  return filePath;
146  }
147 
151  public String getComment() {
152  return null == comment ? "" : comment;
153  }
154 
158  public void setComment(String comment) {
159  this.comment = comment;
160  }
161 
168  public TskData.FileKnown getKnownStatus() {
169  return knownStatus;
170  }
171 
178  public void setKnownStatus(TskData.FileKnown knownStatus) {
179  this.knownStatus = knownStatus;
180  }
181 }
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath, String comment)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath, String comment, TskData.FileKnown knownStatus)

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.