Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
InterestingItemsIngestModuleFactory.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.modules.interestingitems;
20 
21 import java.util.ArrayList;
22 import java.util.List;
23 import org.openide.util.Exceptions;
24 import org.openide.util.NbBundle;
25 import org.openide.util.NbBundle.Messages;
26 import org.openide.util.lookup.ServiceProvider;
35 
40 @ServiceProvider(service = IngestModuleFactory.class)
42 
43  @Messages({
44  "InterestingItemsIngestModuleFactory.defaultSettingsError=Error getting default interesting files settings from file."
45  })
46 
47  @Override
48  public String getModuleDisplayName() {
49  return getModuleName();
50  }
51 
52  static String getModuleName() {
53  return NbBundle.getMessage(InterestingItemsIngestModuleFactory.class, "InterestingItemsIdentifierIngestModule.moduleName");
54  }
55 
56  @Override
57  public String getModuleDescription() {
58  return NbBundle.getMessage(InterestingItemsIngestModuleFactory.class, "InterestingItemsIdentifierIngestModule.moduleDescription");
59  }
60 
61  @Override
62  public String getModuleVersionNumber() {
63  return Version.getVersion();
64  }
65 
66  @Override
67  public boolean hasGlobalSettingsPanel() {
68  return true;
69  }
70 
71  @Override
73  InterestingItemDefsPanel panel = new InterestingItemDefsPanel();
74  panel.load();
75  return panel;
76  }
77 
78  @Override
80  // All interesting files set definitions are enabled by default. The
81  // names of the set definitions are stored instead of the set
82  // definitions to make per ingest job enabling and disabling of the
83  // definitions independent of the rules that make up the defintions.
84  // Doing so also keeps the serialization simple.
85  List<String> enabledFilesSetNames = new ArrayList<>();
86  try {
87  for (String name : InterestingItemDefsManager.getInstance().getInterestingFilesSets().keySet()) {
88  enabledFilesSetNames.add(name);
89  }
90  } catch (InterestingItemDefsManager.InterestingItemDefsManagerException ex) {
91  MessageNotifyUtil.Message.error(Bundle.InterestingItemsIngestModuleFactory_defaultSettingsError());
92  }
93  return new FilesIdentifierIngestJobSettings(enabledFilesSetNames);
94  }
95 
96  @Override
97  public boolean hasIngestJobSettingsPanel() {
98  return true;
99  }
100 
101  @Override
103  if (!(settings instanceof FilesIdentifierIngestJobSettings)) {
104  throw new IllegalArgumentException("Settings not instanceof org.sleuthkit.autopsy.modules.interestingitems.InterestingItemsIngestJobSettings");
105  }
106  return FilesIdentifierIngestJobSettingsPanel.makePanel((FilesIdentifierIngestJobSettings) settings);
107  }
108 
109  @Override
110  public boolean isFileIngestModuleFactory() {
111  return true;
112  }
113 
114  @Override
116  if (!(settings instanceof FilesIdentifierIngestJobSettings)) {
117  throw new IllegalArgumentException("Settings not instanceof org.sleuthkit.autopsy.modules.interestingitems.InterestingItemsIngestJobSettings");
118  }
119  return new FilesIdentifierIngestModule((FilesIdentifierIngestJobSettings) settings);
120  }
121 }
IngestModuleIngestJobSettingsPanel getIngestJobSettingsPanel(IngestModuleIngestJobSettings settings)

Copyright © 2012-2015 Basis Technology. Generated on: Wed Apr 6 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.