Autopsy  4.9.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
SampleIngestModuleFactory.java
Go to the documentation of this file.
1 /*
2  * Sample ingest module factory in the public domain.
3  * Feel free to use this as a template for your inget module factories.
4  *
5  * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org]
6  *
7  * This is free and unencumbered software released into the public domain.
8  *
9  * Anyone is free to copy, modify, publish, use, compile, sell, or
10  * distribute this software, either in source code form or as a compiled
11  * binary, for any purpose, commercial or non-commercial, and by any
12  * means.
13  *
14  * In jurisdictions that recognize copyright laws, the author or authors
15  * of this software dedicate any and all copyright interest in the
16  * software to the public domain. We make this dedication for the benefit
17  * of the public at large and to the detriment of our heirs and
18  * successors. We intend this dedication to be an overt act of
19  * relinquishment in perpetuity of all present and future rights to this
20  * software under copyright law.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  */
30 package org.sleuthkit.autopsy.examples;
31 
32 // The following import is required for the ServiceProvider annotation (see
33 // below) used by the Autopsy ingest framework to locate ingest module
34 // factories. You will need to add a dependency on the Lookup API NetBeans
35 // module to your NetBeans module to use this import.
36 import org.openide.util.lookup.ServiceProvider;
37 
38 // The following import is required to participate in Autopsy
39 // internationalization and localization. Autopsy core is currently localized
40 // for Japan. Please consult the NetBeans documentation for details.
41 import org.openide.util.NbBundle;
42 
49 
90 @ServiceProvider(service = IngestModuleFactory.class) // Sample is discarded at runtime
92 
93  private static final String VERSION_NUMBER = "1.0.0";
94 
95  // This class method allows the ingest module instances created by this
96  // factory to use the same display name that is provided to the Autopsy
97  // ingest framework by the factory.
98  static String getModuleName() {
99  return NbBundle.getMessage(SampleIngestModuleFactory.class, "SampleIngestModuleFactory.moduleName");
100  }
101 
110  @Override
111  public String getModuleDisplayName() {
112  return getModuleName();
113  }
114 
122  @Override
123  public String getModuleDescription() {
124  return NbBundle.getMessage(SampleIngestModuleFactory.class, "SampleIngestModuleFactory.moduleDescription");
125  }
126 
133  @Override
134  public String getModuleVersionNumber() {
135  return VERSION_NUMBER;
136  }
137 
151  @Override
152  public boolean hasGlobalSettingsPanel() {
153  return false;
154  }
155 
169  @Override
171  throw new UnsupportedOperationException();
172  }
173 
186  @Override
188  return new SampleModuleIngestJobSettings();
189  }
190 
203  @Override
204  public boolean hasIngestJobSettingsPanel() {
205  return true;
206  }
207 
222  @Override
224  if (!(settings instanceof SampleModuleIngestJobSettings)) {
225  throw new IllegalArgumentException("Expected settings argument to be instanceof SampleModuleIngestJobSettings");
226  }
227  return new SampleIngestModuleIngestJobSettingsPanel((SampleModuleIngestJobSettings) settings);
228  }
229 
238  @Override
240  return true;
241  }
242 
272  @Override
274  if (!(settings instanceof SampleModuleIngestJobSettings)) {
275  throw new IllegalArgumentException("Expected settings argument to be instanceof SampleModuleIngestJobSettings");
276  }
277  return new SampleDataSourceIngestModule((SampleModuleIngestJobSettings) settings);
278  }
279 
288  @Override
289  public boolean isFileIngestModuleFactory() {
290  return true;
291  }
292 
322  @Override
324  if (!(settings instanceof SampleModuleIngestJobSettings)) {
325  throw new IllegalArgumentException("Expected settings argument to be instanceof SampleModuleIngestJobSettings");
326  }
327  return new SampleFileIngestModule((SampleModuleIngestJobSettings) settings);
328  }
329 }
FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings)
IngestModuleIngestJobSettingsPanel getIngestJobSettingsPanel(IngestModuleIngestJobSettings settings)
DataSourceIngestModule createDataSourceIngestModule(IngestModuleIngestJobSettings settings)

Copyright © 2012-2018 Basis Technology. Generated on: Tue Dec 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.