Autopsy  4.6.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
HashLookupModuleFactory.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014-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.hashdatabase;
20 
21 import java.util.ArrayList;
22 import java.util.List;
23 import org.openide.util.NbBundle;
24 import org.openide.util.lookup.ServiceProvider;
33 
37 @ServiceProvider(service = IngestModuleFactory.class)
39 
40  private HashLookupModuleSettingsPanel moduleSettingsPanel = null;
41 
42  @Override
43  public String getModuleDisplayName() {
44  return getModuleName();
45  }
46 
47  static String getModuleName() {
48  return NbBundle.getMessage(HashLookupModuleFactory.class, "HashDbIngestModule.moduleName");
49  }
50 
51  @Override
52  public String getModuleDescription() {
53  return NbBundle.getMessage(HashLookupModuleFactory.class, "HashDbIngestModule.moduleDescription");
54  }
55 
56  @Override
57  public String getModuleVersionNumber() {
58  return Version.getVersion();
59  }
60 
61  @Override
63  // All available hash sets are enabled and always calculate hashes is true by default.
64  return new HashLookupModuleSettings(true, HashDbManager.getInstance().getAllHashSets());
65  }
66 
67  @Override
68  public boolean hasIngestJobSettingsPanel() {
69  return true;
70  }
71 
72  @Override
74  if (!(settings instanceof HashLookupModuleSettings)) {
75  throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(),
76  "HashLookupModuleFactory.getIngestJobSettingsPanel.exception.msg"));
77  }
78  if (moduleSettingsPanel == null) {
79  moduleSettingsPanel = new HashLookupModuleSettingsPanel((HashLookupModuleSettings) settings);
80  } else {
81  moduleSettingsPanel.reset((HashLookupModuleSettings) settings);
82  }
83  return moduleSettingsPanel;
84  }
85 
86  @Override
87  public boolean hasGlobalSettingsPanel() {
88  return true;
89  }
90 
91  @Override
93  HashLookupSettingsPanel globalSettingsPanel = new HashLookupSettingsPanel();
94  globalSettingsPanel.load();
95  return globalSettingsPanel;
96  }
97 
98  @Override
99  public boolean isFileIngestModuleFactory() {
100  return true;
101  }
102 
103  @Override
105  if (!(settings instanceof HashLookupModuleSettings)) {
106  throw new IllegalArgumentException(
107  NbBundle.getMessage(this.getClass(), "HashLookupModuleFactory.createFileIngestModule.exception.msg"));
108  }
109  try {
110  return new HashDbIngestModule((HashLookupModuleSettings) settings);
111  } catch (NoCurrentCaseException ex) {
112  throw new IllegalArgumentException("Exception while getting open case.", ex);
113  }
114  }
115 }
IngestModuleIngestJobSettingsPanel getIngestJobSettingsPanel(IngestModuleIngestJobSettings settings)
FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings)

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.