Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
PhotoRecCarverIngestJobSettings.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 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.modules.photoreccarver;
20 
21 import java.util.ArrayList;
22 import java.util.Collections;
24 import java.util.List;
25 
29 final class PhotoRecCarverIngestJobSettings implements IngestModuleIngestJobSettings {
30 
34  enum ExtensionFilterOption {
39  INCLUDE,
43  EXCLUDE,
47  NO_FILTER
48  };
49 
50  private static final long serialVersionUID = 1L;
51 
52  private boolean keepCorruptedFiles;
53  private List<String> extensions;
54  private ExtensionFilterOption extensionFilterOption;
55 
59  PhotoRecCarverIngestJobSettings() {
60  this(PhotoRecCarverFileIngestModule.DEFAULT_CONFIG_KEEP_CORRUPTED_FILES,
61  PhotoRecCarverFileIngestModule.DEFAULT_CONFIG_EXTENSION_FILTER,
62  null);
63  }
64 
75  PhotoRecCarverIngestJobSettings(boolean keepCorruptedFiles, ExtensionFilterOption extensionFilterOption, List<String> includeExcludeExtensions) {
76  this.keepCorruptedFiles = keepCorruptedFiles;
77  setExtensionFilterOption(extensionFilterOption);
78  setExtensions(includeExcludeExtensions);
79 
80  }
81 
82  @Override
83  public long getVersionNumber() {
84  return serialVersionUID;
85  }
86 
92  boolean isKeepCorruptedFiles() {
93  return keepCorruptedFiles;
94  }
95 
101  void setKeepCorruptedFiles(boolean keepCorruptedFiles) {
102  this.keepCorruptedFiles = keepCorruptedFiles;
103  }
104 
111  List<String> getExtensions() {
112  return extensions == null
113  ? Collections.emptyList()
114  : Collections.unmodifiableList(extensions);
115  }
116 
123  void setExtensions(List<String> includeExcludeExtensions) {
124  this.extensions = new ArrayList<>();
125  if (includeExcludeExtensions != null) {
126  this.extensions.addAll(includeExcludeExtensions);
127  }
128  }
129 
134  ExtensionFilterOption getExtensionFilterOption() {
135  return (this.extensionFilterOption == null) ?
136  ExtensionFilterOption.NO_FILTER :
137  extensionFilterOption;
138  }
139 
144  void setExtensionFilterOption(ExtensionFilterOption extensionFilterOption) {
145  this.extensionFilterOption = (extensionFilterOption == null) ?
146  ExtensionFilterOption.NO_FILTER :
147  extensionFilterOption;
148  }
149 }

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.