Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ExternalViewerRule.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 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.directorytree;
20 
21 import java.util.Objects;
22 
27 class ExternalViewerRule implements Comparable<ExternalViewerRule> {
28 
29  private final String name;
30  private final String exePath;
31  private final RuleType ruleType;
32 
33  enum RuleType {
34  MIME, EXT
35  }
36 
44  ExternalViewerRule(String name, String exePath, RuleType type) {
45  this.name = name;
46  this.exePath = exePath;
47  this.ruleType = type;
48  }
49 
50  String getName() {
51  return name;
52  }
53 
54  String getExePath() {
55  return exePath;
56  }
57 
58  RuleType getRuleType() {
59  return ruleType;
60  }
61 
62  @Override
63  public String toString() {
64  return name;
65  }
66 
71  @Override
72  public boolean equals(Object other) {
73  if (other != null && other instanceof ExternalViewerRule) {
74  ExternalViewerRule that = (ExternalViewerRule) other;
75  if (this.getName().equals(that.getName())) {
76  return true;
77  }
78  }
79  return false;
80  }
81 
82  @Override
83  public int hashCode() {
84  int hash = 7;
85  hash = 67 * hash + Objects.hashCode(this.name);
86  return hash;
87  }
88 
89  @Override
90  public int compareTo(ExternalViewerRule other) {
91  return this.getName().compareTo(other.getName());
92  }
93 }

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