Autopsy  4.19.3
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 final 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 
45  private boolean indexToSolr;
46 
52  KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists) {
53  this.namesOfEnabledKeywordLists = new HashSet<>(namesOfEnabledKeywordLists);
54  this.namesOfDisabledKeywordLists = new HashSet<>();
55 
56  // explicitly set to default value
57  this.ocrEnabled = null;
58  this.limitedOCREnabled = null;
59  this.ocrOnly = false;
60  this.indexToSolr = true;
61  }
62 
75  KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists, List<String> namesOfDisabledKeywordLists, boolean ocrEnabled, boolean limitedOCREnabled, boolean ocrOnly, boolean indexToSolr) {
76  this.namesOfEnabledKeywordLists = new HashSet<>(namesOfEnabledKeywordLists);
77  this.namesOfDisabledKeywordLists = new HashSet<>(namesOfDisabledKeywordLists);
78  this.ocrEnabled = ocrEnabled;
79  this.limitedOCREnabled = limitedOCREnabled;
80  this.ocrOnly = ocrOnly;
81  this.indexToSolr = indexToSolr;
82  }
83 
89  @SuppressWarnings("deprecation")
90  public boolean isOCREnabled() {
91  if (ocrEnabled == null) {
92  ocrEnabled = KeywordSearchSettings.getOcrOption();
93  }
94 
95  return ocrEnabled;
96  }
97 
103  public void setOCREnabled(boolean ocrEnabled) {
104  this.ocrEnabled = ocrEnabled;
105  }
106 
113  @SuppressWarnings("deprecation")
114  boolean isLimitedOCREnabled() {
115  if (limitedOCREnabled == null) {
116  limitedOCREnabled = KeywordSearchSettings.getLimitedOcrOption();
117  }
118 
119  return limitedOCREnabled;
120  }
121 
129  void setLimitedOCREnabled(boolean limitedOCREnabled) {
130  this.limitedOCREnabled = limitedOCREnabled;
131  }
132 
138  boolean isOCROnly() {
139  return ocrOnly;
140  }
141 
149  void setOCROnly(boolean ocrOnly) {
150  this.ocrOnly = ocrOnly;
151  }
152 
155  @Override
156  public long getVersionNumber() {
158  return serialVersionUID;
159  }
160 
169  boolean keywordListIsEnabled(String keywordListName) {
171  return namesOfEnabledKeywordLists.contains(keywordListName);
172  }
173 
179  List<String> getNamesOfEnabledKeyWordLists() {
181  return new ArrayList<>(namesOfEnabledKeywordLists);
182  }
183 
189  List<String> getNamesOfDisabledKeyWordLists() {
191  return new ArrayList<>(namesOfDisabledKeywordLists);
192  }
193 
198  private void upgradeFromOlderVersions() {
199  if (null == this.namesOfDisabledKeywordLists) {
200  this.namesOfDisabledKeywordLists = new HashSet<>();
201  }
202  }
203 
204  boolean isIndexToSolrEnabled() {
205  return indexToSolr;
206  }
207 
208  void setIndexToSolrEnabled(boolean enabled){
209  indexToSolr = enabled;
210  }
211 
212 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.