Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
EamGlobalFileInstance.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.util.Objects;
22 import org.sleuthkit.datamodel.TskData;
23 
27 public class EamGlobalFileInstance {
28 
29  private int instanceID;
30  private int globalSetID;
31  private String MD5Hash;
32  private TskData.FileKnown knownStatus;
33  private String comment;
34 
36  int globalSetID,
37  String MD5Hash,
38  TskData.FileKnown knownStatus,
39  String comment) throws EamDbException {
41  }
42 
44  int instanceID,
45  int globalSetID,
46  String MD5Hash,
47  TskData.FileKnown knownStatus,
48  String comment) throws EamDbException {
49  if(MD5Hash == null){
50  throw new EamDbException("null MD5 hash");
51  }
52  if(knownStatus == null){
53  throw new EamDbException("null known status");
54  }
55  this.instanceID = instanceID;
56  this.globalSetID = globalSetID;
57  // Normalize hashes by lower casing
58  this.MD5Hash = MD5Hash.toLowerCase();
59  this.knownStatus = knownStatus;
60  this.comment = comment;
61  }
62 
63  @Override
64  public boolean equals(Object otherInstance) {
65  if (this == otherInstance) {
66  return true;
67  } else if (!(otherInstance instanceof EamGlobalFileInstance)) {
68  return false;
69  } else {
70  return (this.hashCode() == otherInstance.hashCode());
71  }
72  }
73 
74  @Override
75  public int hashCode() {
76  int hash = 5;
77  hash = 59 * hash + this.globalSetID;
78  hash = 59 * hash + Objects.hashCode(this.MD5Hash);
79  hash = 59 * hash + this.knownStatus.hashCode();
80  return hash;
81  }
85  public int getInstanceID() {
86  return instanceID;
87  }
88 
92  public void setInstanceID(int instanceID) {
93  this.instanceID = instanceID;
94  }
95 
99  public int getGlobalSetID() {
100  return globalSetID;
101  }
102 
106  public void setGlobalSetID(int globalSetID) {
107  this.globalSetID = globalSetID;
108  }
109 
113  public String getMD5Hash() {
114  return MD5Hash;
115  }
116 
120  public void setMD5Hash(String MD5Hash) throws EamDbException {
121  if(MD5Hash == null){
122  throw new EamDbException("null MD5 hash");
123  }
124  // Normalize hashes by lower casing
125  this.MD5Hash = MD5Hash.toLowerCase();
126  }
127 
131  public TskData.FileKnown getKnownStatus() {
132  return knownStatus;
133  }
134 
138  public void setKnownStatus(TskData.FileKnown knownStatus) {
139  this.knownStatus = knownStatus;
140  }
141 
145  public String getComment() {
146  return null == comment ? "" : comment;
147  }
148 
152  public void setComment(String comment) {
153  this.comment = comment;
154  }
155 }
EamGlobalFileInstance(int instanceID, int globalSetID, String MD5Hash, TskData.FileKnown knownStatus, String comment)
EamGlobalFileInstance(int globalSetID, String MD5Hash, TskData.FileKnown knownStatus, String comment)

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