diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index fa9f92188c..3c3ca411d1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -18,6 +18,9 @@ */ package org.sleuthkit.autopsy.casemodule; +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; import javax.swing.JPanel; import java.util.ArrayList; import java.util.Calendar; @@ -26,9 +29,12 @@ import java.util.UUID; import javax.swing.filechooser.FileFilter; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; +import org.openide.util.lookup.ServiceProviders; +import org.sleuthkit.autopsy.corecomponentinterfaces.AutomatedIngestDataSourceProcessor; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; +import org.sleuthkit.autopsy.coreutils.DataSourceUtils; /** * A image file data source processor that implements the DataSourceProcessor @@ -36,8 +42,11 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; * wizard. It also provides a run method overload to allow it to be used * independently of the wizard. */ -@ServiceProvider(service = DataSourceProcessor.class) -public class ImageDSProcessor implements DataSourceProcessor { +@ServiceProviders(value={ + @ServiceProvider(service=DataSourceProcessor.class), + @ServiceProvider(service=AutomatedIngestDataSourceProcessor.class)} +) +public class ImageDSProcessor implements DataSourceProcessor, AutomatedIngestDataSourceProcessor { private final static String DATA_SOURCE_TYPE = NbBundle.getMessage(ImageDSProcessor.class, "ImageDSProcessor.dsType.text"); private static final List allExt = new ArrayList<>(); @@ -229,4 +238,46 @@ public class ImageDSProcessor implements DataSourceProcessor { setDataSourceOptionsCalled = true; } + private static boolean isAcceptedByFiler(File file, List filters) { + for (FileFilter filter : filters) { + if (filter.accept(file)) { + return true; + } + } + return false; + } + + @Override + public int canProcess(Path dataSourcePath) { + + // check file extension for supported types + if (!isAcceptedByFiler(dataSourcePath.toFile(), filtersList)) { + return 0; + } + + try { + // verify that the image has a file system that TSK can process + Case currentCase = Case.getCurrentCase(); + if (!DataSourceUtils.imageHasFileSystem(Paths.get(currentCase.getTempDirectory()), dataSourcePath)) { + // image does not have a file system that TSK can process + return 0; + } + } catch (Exception ignore) { + return 0; + } + + // able to process the data source + return 100; + } + + @Override + public void process(String deviceId, Path dataSourcePath, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { + + this.deviceId = deviceId; + this.imagePath = dataSourcePath.toString(); + this.timeZone = Calendar.getInstance().getTimeZone().getID(); + this.ignoreFatOrphanFiles = false; + setDataSourceOptionsCalled = true; + run(deviceId, dataSourcePath.toString(), timeZone, ignoreFatOrphanFiles, progressMonitor, callBack); + } } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index 85f989ca9b..2efaf4de13 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -2007,11 +2007,11 @@ public final class AutoIngestManager extends Observable implements PropertyChang LOGGER.log(Level.INFO, "Identified data source type for {0} as {1} (VM)", new Object[]{manifestPath, DataSource.Type.DRIVE_IMAGE}); jobLogger.logDataSourceTypeId(DataSource.Type.DRIVE_IMAGE.toString()); return new DataSource(deviceId, dataSourcePath, DataSource.Type.DRIVE_IMAGE); - } else if (imageHasFileSystem(caseForJob, dataSourcePath)) { + } /*else if (imageHasFileSystem(caseForJob, dataSourcePath)) { LOGGER.log(Level.INFO, "Identified data source type for {0} as {1}", new Object[]{manifestPath, DataSource.Type.DRIVE_IMAGE}); jobLogger.logDataSourceTypeId(DataSource.Type.DRIVE_IMAGE.toString()); return new DataSource(deviceId, dataSourcePath, DataSource.Type.DRIVE_IMAGE); - } else { + } */ else { LOGGER.log(Level.INFO, "Identified data source type for {0} as {1}", new Object[]{manifestPath, DataSource.Type.PHONE_IMAGE}); jobLogger.logDataSourceTypeId(DataSource.Type.PHONE_IMAGE.toString()); return new DataSource(deviceId, dataSourcePath, DataSource.Type.PHONE_IMAGE); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/cellex/datasourceprocessors/CellebriteXMLProcessor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/cellex/datasourceprocessors/CellebriteXMLProcessor.java index 4cce165de3..82fd7b42f5 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/cellex/datasourceprocessors/CellebriteXMLProcessor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/cellex/datasourceprocessors/CellebriteXMLProcessor.java @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.experimental.cellex.datasourceprocessors; import java.io.File; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List;