From c63abe1daf1b2931d66dd20e4a6c22acae19f39c Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 2 Apr 2018 20:22:32 -0400 Subject: [PATCH] Decouple LocalFilesDSProcessor.process from canProcess side effect --- .../autopsy/casemodule/LocalFilesDSProcessor.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java index 63b255113b..1b80f316b1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java @@ -31,7 +31,6 @@ import javax.swing.JPanel; import javax.swing.filechooser.FileFilter; import org.apache.commons.io.FilenameUtils; import org.openide.modules.InstalledFileLocator; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.util.lookup.ServiceProvider; @@ -51,7 +50,8 @@ import org.sleuthkit.autopsy.datasourceprocessors.AutoIngestDataSourceProcessor; * method overload to allow it to be used independently of the wizard. */ @ServiceProviders(value = { - @ServiceProvider(service = DataSourceProcessor.class), + @ServiceProvider(service = DataSourceProcessor.class) + , @ServiceProvider(service = AutoIngestDataSourceProcessor.class)} ) @Messages({ @@ -344,15 +344,15 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat // It should return lowest possible non-zero confidence level and be treated // as the "option of last resort" for auto ingest purposes - this.localFilePaths = Arrays.asList(new String[]{dataSourcePath.toString()}); + List filePaths = Arrays.asList(new String[]{dataSourcePath.toString()}); //If there is only 1 file check if it is an L01 file and if it is extract the //contents and replace the paths, if the contents can't be extracted return 0 - if (localFilePaths.size() == 1) { - for (final String path : localFilePaths) { + if (filePaths.size() == 1) { + for (final String path : filePaths) { if (new File(path).isFile() && LOGICAL_EVIDENCE_FILTER.accept(new File(path))) { try { //if the L01 option was chosen - localFilePaths = extractLogicalEvidenceFileContents(localFilePaths); + filePaths = extractLogicalEvidenceFileContents(filePaths); } catch (L01Exception ex) { logger.log(Level.WARNING, "File extension was .l01 but contents of logical evidence file were unable to be extracted", ex); //contents of l01 could not be extracted don't add data source or run ingest @@ -369,7 +369,8 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat @Override public void process(String deviceId, Path dataSourcePath, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { - run(deviceId, deviceId, this.localFilePaths, progressMonitor, callBack); + List filePaths = Arrays.asList(new String[]{dataSourcePath.toString()}); + run(deviceId, deviceId, filePaths, progressMonitor, callBack); } /**