From 466fedd871dc1f3a6979003fa7600853848c10c3 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 22 Jan 2016 14:14:39 -0500 Subject: [PATCH 1/7] Add data source id to org.sleuthkit.autopsy.casemodule.AddImageTask --- .../sleuthkit/autopsy/casemodule/AddImageTask.java | 14 ++++++-------- .../autopsy/casemodule/ImageDSProcessor.java | 2 +- .../autopsy/casemodule/LocalDiskDSProcessor.java | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 8ce6634303..657a9b5807 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-2014 Basis Technology Corp. + * Copyright 2013-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,11 +30,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Image; -import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitJNI; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskDataException; -import org.sleuthkit.datamodel.TskException; /* * A background task that adds the given image to database using the Sleuthkit @@ -72,6 +70,8 @@ class AddImageTask implements Runnable { private final String imagePath; String timeZone; boolean noFatOrphans; + + private final String dataSourceId; /* * A thread that updates the progressMonitor with the name of the directory @@ -113,18 +113,16 @@ class AddImageTask implements Runnable { } } - public AddImageTask(String imgPath, String tz, boolean noOrphans, DataSourceProcessorProgressMonitor aProgressMonitor, DataSourceProcessorCallback cbObj) { - + AddImageTask(String dataSourceId, String imgPath, String tz, boolean noOrphans, DataSourceProcessorProgressMonitor aProgressMonitor, DataSourceProcessorCallback cbObj) { currentCase = Case.getCurrentCase(); - + this.dataSourceId = dataSourceId; this.imagePath = imgPath; this.timeZone = tz; this.noFatOrphans = noOrphans; - this.callbackObj = cbObj; this.progressMonitor = aProgressMonitor; } - + /** * Starts the addImage process, but does not commit the results. * diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index a0267d1b9f..577a8725f1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -139,7 +139,7 @@ public class ImageDSProcessor implements DataSourceProcessor { ignoreFatOrphanFiles = configPanel.getNoFatOrphans(); configured = true; } - addImageTask = new AddImageTask(imagePath, timeZone, ignoreFatOrphanFiles, monitor, cbObj); + addImageTask = new AddImageTask(dataSourceId, imagePath, timeZone, ignoreFatOrphanFiles, monitor, cbObj); new Thread(addImageTask).start(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java index cff54942d2..a7fd994d04 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java @@ -122,7 +122,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { ignoreFatOrphanFiles = configPanel.getNoFatOrphans(); configured = true; } - addDiskTask = new AddImageTask(drivePath, timeZone, ignoreFatOrphanFiles, progressMonitor, cbObj); + addDiskTask = new AddImageTask(dataSourceId, drivePath, timeZone, ignoreFatOrphanFiles, progressMonitor, cbObj); new Thread(addDiskTask).start(); } From bd52e3abc16e4f29097233dec3edfadb6d6c9068 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 22 Jan 2016 17:17:55 -0500 Subject: [PATCH 2/7] Add data source id to JNI bindings --- Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 657a9b5807..ac1ee1c00c 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -141,7 +141,7 @@ class AddImageTask implements Runnable { progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); dirFetcher.start(); - addImageProcess.run(new String[]{this.imagePath}); + addImageProcess.run(dataSourceId, imagePath); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Core errors occurred while running add image. ", ex); //NON-NLS hasCritError = true; From ca47a51150ba66f1a4cb5884440aadf2ce2878ab Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Sun, 24 Jan 2016 15:59:05 -0500 Subject: [PATCH 3/7] Add data source id support to Java bindings --- .../org/sleuthkit/autopsy/casemodule/AddImageTask.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index ac1ee1c00c..57d3e6efe0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -70,7 +70,7 @@ class AddImageTask implements Runnable { private final String imagePath; String timeZone; boolean noFatOrphans; - + private final String dataSourceId; /* @@ -102,12 +102,12 @@ class AddImageTask implements Runnable { currDir)); } } - // this sleep here prevents the UI from locking up + // this sleep here prevents the UI from locking up // due to too frequent updates to the progressMonitor above Thread.sleep(500); } } catch (InterruptedException ie) { - // nothing to do, thread was interrupted externally + // nothing to do, thread was interrupted externally // signaling the end of AddImageProcess } } @@ -122,7 +122,7 @@ class AddImageTask implements Runnable { this.callbackObj = cbObj; this.progressMonitor = aProgressMonitor; } - + /** * Starts the addImage process, but does not commit the results. * From 1ef268c25873acbc438626863b8294dc302086b7 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 25 Jan 2016 17:16:05 -0500 Subject: [PATCH 4/7] Repair setDataSourceOptions for ImageDSProcessor, LocalDiskDSProcessor --- .../org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java | 5 ++++- .../sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index 577a8725f1..8368d4352e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -197,13 +197,16 @@ public class ImageDSProcessor implements DataSourceProcessor { * when when processing dates and times for the image. * * @param imagePath Path to the image file. + * @param timeZone The time zone to use when processing dates + * and times for the image, obtained from + * java.util.TimeZone.getID. * @param ignoreFatOrphanFiles Whether to parse orphans if the image has a * FAT filesystem. * * @deprecated Use the run method instead. */ @Deprecated - public void setDataSourceOptions(String imagePath, boolean ignoreFatOrphanFiles) { + public void setDataSourceOptions(String imagePath, String timeZone, boolean ignoreFatOrphanFiles) { this.dataSourceId = UUID.randomUUID().toString(); this.imagePath = imagePath; this.timeZone = Calendar.getInstance().getTimeZone().getID(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java index a7fd994d04..1b2d2c1b4f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java @@ -180,13 +180,16 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { * when when processing dates and times for the image. * * @param drivePath Path to the local drive. + * @param timeZone The time zone to use when processing dates + * and times for the image, obtained from + * java.util.TimeZone.getID. * @param ignoreFatOrphanFiles Whether to parse orphans if the image has a * FAT filesystem. * * @deprecated Use the run method instead. */ @Deprecated - public void setDataSourceOptions(String drivePath, boolean ignoreFatOrphanFiles) { + public void setDataSourceOptions(String drivePath, String timeZone, boolean ignoreFatOrphanFiles) { this.dataSourceId = UUID.randomUUID().toString(); this.drivePath = drivePath; this.timeZone = Calendar.getInstance().getTimeZone().getID(); From 2bf0c91929d157c9c7b6b84196bfbbeca7651e9d Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 25 Jan 2016 18:08:27 -0500 Subject: [PATCH 5/7] Update documentation of data source id --- .../autopsy/casemodule/AddImageTask.java | 42 ++++++++++++++++--- .../autopsy/casemodule/ImageDSProcessor.java | 2 +- .../casemodule/LocalDiskDSProcessor.java | 5 ++- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 57d3e6efe0..b2a47b29f3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -113,14 +113,44 @@ class AddImageTask implements Runnable { } } - AddImageTask(String dataSourceId, String imgPath, String tz, boolean noOrphans, DataSourceProcessorProgressMonitor aProgressMonitor, DataSourceProcessorCallback cbObj) { + /** + * Runs the data source processor in a separate thread without requiring use + * the configuration panel. + * + * @param dataSourceId An ASCII-printable identifier for the data + * source that is unique across multiple cases + * (e.g., a UUID). + * @param imagePath Path to the image file. + * @param timeZone The time zone to use when processing dates + * and times for the image, obtained from + * java.util.TimeZone.getID. + * @param ignoreFatOrphanFiles Whether to parse orphans if the image has a + * FAT filesystem. + * @param monitor Progress monitor to report progress during + * processing. + * @param cbObj Callback to call when processing is done. + */ + /** + * Constructs a runnable task that adds an image to the case database. + * + * @param imagePath Path to the image file. + * @param timeZone The time zone to use when processing dates + * and times for the image, obtained from + * java.util.TimeZone.getID. + * @param ignoreFatOrphanFiles Whether to parse orphans if the image has a + * FAT filesystem. + * @param monitor Progress monitor to report progress during + * processing. + * @param cbObj Callback to call when processing is done. + */ + AddImageTask(String dataSourceId, String imagePath, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor monitor, DataSourceProcessorCallback cbObj) { currentCase = Case.getCurrentCase(); this.dataSourceId = dataSourceId; - this.imagePath = imgPath; - this.timeZone = tz; - this.noFatOrphans = noOrphans; + this.imagePath = imagePath; + this.timeZone = timeZone; + this.noFatOrphans = ignoreFatOrphanFiles; this.callbackObj = cbObj; - this.progressMonitor = aProgressMonitor; + this.progressMonitor = monitor; } /** @@ -141,7 +171,7 @@ class AddImageTask implements Runnable { progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); dirFetcher.start(); - addImageProcess.run(dataSourceId, imagePath); + addImageProcess.run(dataSourceId, new String[]{imagePath}); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Core errors occurred while running add image. ", ex); //NON-NLS hasCritError = true; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index 8368d4352e..963b572467 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -147,7 +147,7 @@ public class ImageDSProcessor implements DataSourceProcessor { * Runs the data source processor in a separate thread without requiring use * the configuration panel. * - * @param dataSourceId A identifier for the data source that is + * @param dataSourceId An ASCII-printable identifier for the data source that is * unique across multiple cases (e.g., a UUID). * @param imagePath Path to the image file. * @param timeZone The time zone to use when processing dates diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java index 1b2d2c1b4f..0e9203fceb 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java @@ -130,8 +130,9 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { * Runs the data source processor in a separate thread without requiring use * the configuration panel. * - * @param dataSourceId A identifier for the data source that is - * unique across multiple cases (e.g., a UUID). + * @param dataSourceId An ASCII-printable identifier for the data + * source that is unique across multiple cases + * (e.g., a UUID). * @param drivePath Path to the local drive. * @param timeZone The time zone to use when processing dates * and times for the image, obtained from From 50d08d3c3cdd3a9ead5639eefe6e186b4611e78c Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 26 Jan 2016 11:20:58 -0500 Subject: [PATCH 6/7] Docs fix for AddImageTask --- .../autopsy/casemodule/AddImageTask.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index b2a47b29f3..9c61a94006 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -114,8 +114,7 @@ class AddImageTask implements Runnable { } /** - * Runs the data source processor in a separate thread without requiring use - * the configuration panel. + * Constructs a runnable task that adds an image to the case database. * * @param dataSourceId An ASCII-printable identifier for the data * source that is unique across multiple cases @@ -130,19 +129,6 @@ class AddImageTask implements Runnable { * processing. * @param cbObj Callback to call when processing is done. */ - /** - * Constructs a runnable task that adds an image to the case database. - * - * @param imagePath Path to the image file. - * @param timeZone The time zone to use when processing dates - * and times for the image, obtained from - * java.util.TimeZone.getID. - * @param ignoreFatOrphanFiles Whether to parse orphans if the image has a - * FAT filesystem. - * @param monitor Progress monitor to report progress during - * processing. - * @param cbObj Callback to call when processing is done. - */ AddImageTask(String dataSourceId, String imagePath, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor monitor, DataSourceProcessorCallback cbObj) { currentCase = Case.getCurrentCase(); this.dataSourceId = dataSourceId; From d3d0812699b19b170f24ed5ba4aa6cd525931118 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 26 Jan 2016 13:00:00 -0500 Subject: [PATCH 7/7] Update data source id docs --- Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java | 4 ++-- .../org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java | 5 +++-- .../sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 9c61a94006..97eb342182 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -117,8 +117,8 @@ class AddImageTask implements Runnable { * Constructs a runnable task that adds an image to the case database. * * @param dataSourceId An ASCII-printable identifier for the data - * source that is unique across multiple cases - * (e.g., a UUID). + * source that is intended to be unique across + * multiple cases (e.g., a UUID). * @param imagePath Path to the image file. * @param timeZone The time zone to use when processing dates * and times for the image, obtained from diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index 963b572467..c351b2e3d1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -147,8 +147,9 @@ public class ImageDSProcessor implements DataSourceProcessor { * Runs the data source processor in a separate thread without requiring use * the configuration panel. * - * @param dataSourceId An ASCII-printable identifier for the data source that is - * unique across multiple cases (e.g., a UUID). + * @param dataSourceId An ASCII-printable identifier for the data + * source that is intended to be unique across + * multiple cases (e.g., a UUID). * @param imagePath Path to the image file. * @param timeZone The time zone to use when processing dates * and times for the image, obtained from diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java index 0e9203fceb..90fc238d32 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java @@ -131,8 +131,8 @@ public class LocalDiskDSProcessor implements DataSourceProcessor { * the configuration panel. * * @param dataSourceId An ASCII-printable identifier for the data - * source that is unique across multiple cases - * (e.g., a UUID). + * source that is intended to be unique across + * multiple cases (e.g., a UUID). * @param drivePath Path to the local drive. * @param timeZone The time zone to use when processing dates * and times for the image, obtained from