Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataSourceModulesWrapper.java
Go to the documentation of this file.
1 /*
2  * Autopsy
3  *
4  * Copyright 2019 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.discovery.ui;
20 
21 import org.openide.util.NbBundle.Messages;
25 import org.sleuthkit.datamodel.IngestJobInfo;
26 import org.sleuthkit.datamodel.IngestModuleInfo;
27 
31 class DataSourceModulesWrapper {
32 
33  private boolean hashModuleRun = false;
34  private boolean fileTypeModuleRun = false;
35  private boolean exifModuleRun = false;
36  private final String dataSourceName;
37 
43  DataSourceModulesWrapper(String dsName) {
44  dataSourceName = dsName;
45  }
46 
47  @Messages({"# {0} - dataSourceName",
48  "DataSourceModuleWrapper.hashModule.text=Hash Lookup module was not run on data source: {0}\n",
49  "# {0} - dataSourceName",
50  "DataSourceModuleWrapper.fileTypeModule.text=File Type Identification module was not run on data source: {0}\n",
51  "# {0} - dataSourceName",
52  "DataSourceModuleWrapper.exifModule.text=Picture Analyzer module was not run on data source: {0}\n"
53  })
58  String getMessage() {
59  String message = "";
60  if (!hashModuleRun) {
61  message += Bundle.DataSourceModuleWrapper_hashModule_text(dataSourceName);
62  }
63  if (!fileTypeModuleRun) {
64  message += Bundle.DataSourceModuleWrapper_fileTypeModule_text(dataSourceName);
65  }
66  if (!exifModuleRun) {
67  message += Bundle.DataSourceModuleWrapper_exifModule_text(dataSourceName);
68  }
69  return message;
70  }
71 
79  void updateModulesRun(IngestJobInfo jobInfo) {
80  for (IngestModuleInfo moduleInfo : jobInfo.getIngestModuleInfo()) {
81  if (hashModuleRun && fileTypeModuleRun && exifModuleRun) {
82  return;
83  }
84  updateHashModuleStatus(moduleInfo);
85  updateFileTypeStatus(moduleInfo);
86  updateExifStatus(moduleInfo);
87  }
88  }
89 
96  private void updateHashModuleStatus(IngestModuleInfo moduleInfo) {
97  if (!hashModuleRun && moduleInfo.getDisplayName().equals(HashLookupModuleFactory.getModuleName())) {
98  hashModuleRun = true;
99  }
100  }
101 
108  private void updateFileTypeStatus(IngestModuleInfo moduleInfo) {
109  if (!fileTypeModuleRun && moduleInfo.getDisplayName().equals(FileTypeIdModuleFactory.getModuleName())) {
110  fileTypeModuleRun = true;
111  }
112  }
113 
120  private void updateExifStatus(IngestModuleInfo moduleInfo) {
121  if (!exifModuleRun && moduleInfo.getDisplayName().equals(PictureAnalyzerIngestModuleFactory.getModuleName())) {
122  exifModuleRun = true;
123  }
124  }
125 }

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