From 76ca1dc0d0f85f55b4325d3b98e879e886db0ee5 Mon Sep 17 00:00:00 2001 From: Tim McIver Date: Fri, 12 Apr 2013 15:23:46 -0400 Subject: [PATCH] Added 'getDefault' method to ScalpelCarverIngestModule. Added stub implementation of process method. --- .../scalpel/ScalpelCarverIngestModule.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java index 0df376783f..0d3cc67b7c 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java @@ -24,6 +24,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile; import org.sleuthkit.autopsy.ingest.IngestModuleInit; import org.sleuthkit.autopsy.ingest.PipelineContext; import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; /** * Scalpel carving ingest module @@ -31,13 +32,34 @@ import org.sleuthkit.datamodel.AbstractFile; public class ScalpelCarverIngestModule implements IngestModuleAbstractFile { private static final Logger logger = Logger.getLogger(ScalpelCarverIngestModule.class.getName()); + + private static IngestModuleAbstractFile instance; private final String MODULE_NAME = "Scalpel Carver"; - private final String MODULE_DESCRIPTION = "Carves a variety of file types from unallocated space."; - final public static String MODULE_VERSION = "1.0"; + private final String MODULE_DESCRIPTION = "Carves files from unallocated space at ingest time.\nCarved files are reanalyzed and displayed in the directory tree."; + final public String MODULE_VERSION = "1.0"; + private int runNumber = 0; @Override public ProcessResult process(PipelineContext pipelineContext, AbstractFile abstractFile) { - return null; + + // only process files whose type is TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS + TSK_DB_FILES_TYPE_ENUM type = abstractFile.getType(); + if (type != TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) { + return ProcessResult.OK; + } + + return ProcessResult.OK; + } + + public static IngestModuleAbstractFile getDefault() { + if (instance == null) { + synchronized (ScalpelCarverIngestModule.class) { + if (instance == null) { + instance = new ScalpelCarverIngestModule(); + } + } + } + return instance; } @Override