19 package org.sleuthkit.autopsy.test;
21 import java.util.logging.Level;
22 import org.openide.util.NbBundle;
35 "CustomArtifactsCreatorFileIngestModule.exceptionMessage.errorCreatingCustomType=Error creating custom artifact type."
37 final class CustomArtifactsCreatorFileIngestModule extends FileIngestModuleAdapter {
39 private static final Logger logger = Logger.getLogger(CustomArtifactsCreatorFileIngestModule.class.getName());
40 private IngestJobContext context;
53 public void startUp(IngestJobContext context)
throws IngestModuleException {
54 this.context = context;
56 CustomArtifactType.addToCaseDatabase();
57 }
catch (Blackboard.BlackboardException ex) {
58 throw new IngestModuleException(Bundle.CustomArtifactsCreatorFileIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
71 public ProcessResult process(AbstractFile file) {
72 if (file.isDir() || file.isVirtual()) {
73 return ProcessResult.OK;
76 CustomArtifactType.createAndPostInstance(file, context.getJobId());
77 }
catch (TskCoreException | Blackboard.BlackboardException ex) {
78 logger.log(Level.SEVERE, String.format(
"Failed to process file (obj_id = %d)", file.getId()), ex);
79 return ProcessResult.ERROR;
81 return ProcessResult.OK;