Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
KeywordSearchJobSettings.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014 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.keywordsearch;
20 
21 import java.util.ArrayList;
22 import java.util.HashSet;
23 import java.util.List;
25 
30 
31  private static final long serialVersionUID = 1L;
32 
33  private HashSet<String> namesOfEnabledKeywordLists;
34  private HashSet<String> namesOfDisabledKeywordLists; // Added in version 1.1
35 
40  private Boolean ocrEnabled;
41  private Boolean limitedOCREnabled;
42 
43  private boolean ocrOnly;
44 
50  KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists) {
51  this.namesOfEnabledKeywordLists = new HashSet<>(namesOfEnabledKeywordLists);
52  this.namesOfDisabledKeywordLists = new HashSet<>();
53 
54  // explicitly set to default value
55  this.ocrEnabled = null;
56  this.limitedOCREnabled = null;
57  this.ocrOnly = false;
58  }
59 
72  KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists, List<String> namesOfDisabledKeywordLists, boolean ocrEnabled, boolean limitedOCREnabled, boolean ocrOnly) {
73  this.namesOfEnabledKeywordLists = new HashSet<>(namesOfEnabledKeywordLists);
74  this.namesOfDisabledKeywordLists = new HashSet<>(namesOfDisabledKeywordLists);
75  this.ocrEnabled = ocrEnabled;
76  this.limitedOCREnabled = limitedOCREnabled;
77  this.ocrOnly = ocrOnly;
78  }
79 
85  @SuppressWarnings("deprecation")
86  public boolean isOCREnabled() {
87  if (ocrEnabled == null) {
88  ocrEnabled = KeywordSearchSettings.getOcrOption();
89  }
90 
91  return ocrEnabled;
92  }
93 
99  public void setOCREnabled(boolean ocrEnabled) {
100  this.ocrEnabled = ocrEnabled;
101  }
102 
109  @SuppressWarnings("deprecation")
110  boolean isLimitedOCREnabled() {
111  if (limitedOCREnabled == null) {
112  limitedOCREnabled = KeywordSearchSettings.getLimitedOcrOption();
113  }
114 
115  return limitedOCREnabled;
116  }
117 
125  void setLimitedOCREnabled(boolean limitedOCREnabled) {
126  this.limitedOCREnabled = limitedOCREnabled;
127  }
128 
134  boolean isOCROnly() {
135  return ocrOnly;
136  }
137 
145  void setOCROnly(boolean ocrOnly) {
146  this.ocrOnly = ocrOnly;
147  }
148 
151  @Override
152  public long getVersionNumber() {
154  return serialVersionUID;
155  }
156 
165  boolean keywordListIsEnabled(String keywordListName) {
167  return namesOfEnabledKeywordLists.contains(keywordListName);
168  }
169 
175  List<String> getNamesOfEnabledKeyWordLists() {
177  return new ArrayList<>(namesOfEnabledKeywordLists);
178  }
179 
185  List<String> getNamesOfDisabledKeyWordLists() {
187  return new ArrayList<>(namesOfDisabledKeywordLists);
188  }
189 
194  private void upgradeFromOlderVersions() {
195  if (null == this.namesOfDisabledKeywordLists) {
196  this.namesOfDisabledKeywordLists = new HashSet<>();
197  }
198  }
199 
200 }

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.