19 package org.sleuthkit.autopsy.modules.fileextmismatch;
21 import java.io.IOException;
22 import java.io.ObjectInputStream;
24 import java.util.stream.Collectors;
25 import java.util.stream.Stream;
31 final class FileExtMismatchDetectorModuleSettings
implements IngestModuleIngestJobSettings {
33 private static final long serialVersionUID = 1L;
34 private long versionNumber;
35 private boolean skipFilesWithNoExtension;
37 private boolean skipFilesWithTextPlainMimeType;
38 private boolean skipKnownFiles;
39 private CHECK_TYPE checkType;
46 ALL, NO_TEXT_FILES, ONLY_MEDIA_AND_EXE
53 static final Set<String> MEDIA_AND_EXE_MIME_TYPES = Stream.of(
60 "application/dos-exe",
62 "application/x-dosexec",
64 "application/x-msdownload").collect(Collectors.toSet());
70 FileExtMismatchDetectorModuleSettings() {
71 this.versionNumber = 2;
72 this.skipFilesWithNoExtension =
true;
73 this.skipKnownFiles =
true;
74 this.checkType = CHECK_TYPE.ONLY_MEDIA_AND_EXE;
83 public long getVersionNumber() {
84 return serialVersionUID;
93 void setSkipFilesWithNoExtension(
boolean skipFilesWithNoExtension) {
94 this.skipFilesWithNoExtension = skipFilesWithNoExtension;
103 boolean skipFilesWithNoExtension() {
104 return skipFilesWithNoExtension;
113 void setSkipKnownFiles(
boolean skipKnownFiles) {
114 this.skipKnownFiles = skipKnownFiles;
123 boolean skipKnownFiles() {
124 return skipKnownFiles;
133 void setCheckType(CHECK_TYPE checkType) {
134 this.checkType = checkType;
143 CHECK_TYPE getCheckType() {
159 private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
160 in.defaultReadObject();
161 if (0L == versionNumber) {
167 skipKnownFiles =
true;
170 if (1 == versionNumber) {
175 checkType = CHECK_TYPE.ONLY_MEDIA_AND_EXE;