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());
52 public void startUp(IngestJobContext context)
throws IngestModuleException {
54 CustomArtifactType.addToCaseDatabase();
55 }
catch (Blackboard.BlackboardException ex) {
56 throw new IngestModuleException(Bundle.CustomArtifactsCreatorFileIngestModule_exceptionMessage_errorCreatingCustomType(), ex);
69 public ProcessResult process(AbstractFile file) {
70 if (file.isDir() || file.isVirtual()) {
71 return ProcessResult.OK;
74 CustomArtifactType.createAndPostInstance(file);
75 }
catch (TskCoreException | Blackboard.BlackboardException ex) {
76 logger.log(Level.SEVERE, String.format(
"Failed to process file (obj_id = %d)", file.getId()), ex);
77 return ProcessResult.ERROR;
79 return ProcessResult.OK;