Autopsy  4.7.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-2018 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  String filePath
50  ) throws EamDbException {
51  this(-1, eamCase, eamDataSource, filePath, null, TskData.FileKnown.UNKNOWN);
52  }
53 
54 
56  CorrelationCase eamCase,
57  CorrelationDataSource eamDataSource,
58  String filePath,
59  String comment,
60  TskData.FileKnown knownStatus
61  ) throws EamDbException {
62  this(-1, eamCase, eamDataSource, filePath, comment, knownStatus);
63  }
64 
66  int ID,
67  CorrelationCase eamCase,
68  CorrelationDataSource eamDataSource,
69  String filePath,
70  String comment,
71  TskData.FileKnown knownStatus
72  ) throws EamDbException {
73  if (filePath == null) {
74  throw new EamDbException("file path is null");
75  }
76 
77  this.ID = ID;
78  this.correlationCase = eamCase;
79  this.correlationDataSource = eamDataSource;
80  // Lower case paths to normalize paths and improve correlation results, if this causes significant issues on case-sensitive file systems, remove
81  this.filePath = filePath.toLowerCase();
82  this.comment = comment;
83  this.knownStatus = knownStatus;
84  }
85 
86  public Boolean equals(CorrelationAttributeInstance otherInstance) {
87  return ((this.getID() == otherInstance.getID())
88  && (this.getCorrelationCase().equals(otherInstance.getCorrelationCase()))
89  && (this.getCorrelationDataSource().equals(otherInstance.getCorrelationDataSource()))
90  && (this.getFilePath().equals(otherInstance.getFilePath()))
91  && (this.getKnownStatus().equals(otherInstance.getKnownStatus()))
92  && (this.getComment().equals(otherInstance.getComment())));
93  }
94 
95  @Override
96  public String toString() {
97  return this.getID()
98  + this.getCorrelationCase().getCaseUUID()
99  + this.getCorrelationDataSource().getDeviceID()
100  + this.getFilePath()
101  + this.getKnownStatus()
102  + this.getComment();
103  }
104 
111  public boolean isDatabaseInstance() {
112  return (ID >= 0);
113  }
114 
118  int getID() {
119  return ID;
120  }
121 
126  return correlationCase;
127  }
128 
133  return correlationDataSource;
134  }
135 
139  public String getFilePath() {
140  return filePath;
141  }
142 
146  public String getComment() {
147  return null == comment ? "" : comment;
148  }
149 
153  public void setComment(String comment) {
154  this.comment = comment;
155  }
156 
163  public TskData.FileKnown getKnownStatus() {
164  return knownStatus;
165  }
166 
174  public void setKnownStatus(TskData.FileKnown knownStatus) {
175  this.knownStatus = knownStatus;
176  }
177 }
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath, String comment, TskData.FileKnown knownStatus)

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