removed a flag

This commit is contained in:
Eugene Livis 2021-03-03 13:44:59 -05:00
parent 3e6d6f35fa
commit f6d446d8c8
3 changed files with 142 additions and 164 deletions

View File

@ -51,8 +51,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* independently of the wizard. * independently of the wizard.
*/ */
@ServiceProviders(value = { @ServiceProviders(value = {
@ServiceProvider(service = DataSourceProcessor.class) @ServiceProvider(service = DataSourceProcessor.class),
,
@ServiceProvider(service = AutoIngestDataSourceProcessor.class)} @ServiceProvider(service = AutoIngestDataSourceProcessor.class)}
) )
public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSourceProcessor { public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSourceProcessor {
@ -83,7 +82,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
private String sha1; private String sha1;
private String sha256; private String sha256;
private Host host = null; private Host host = null;
private boolean setDataSourceOptionsCalled;
static { static {
filtersList.add(allFilter); filtersList.add(allFilter);
@ -223,19 +221,19 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
/** /**
* Adds a data source to the case database using a background task in a * Adds a data source to the case database using a background task in a
* separate thread and the settings provided by the selection and * separate thread and the settings provided by the selection and
* configuration panel. Files found during ingest will be sent directly to the * configuration panel. Files found during ingest will be sent directly to
* IngestStream provided. Returns as soon as the background task is started. * the IngestStream provided. Returns as soon as the background task is
* The background task uses a callback object to signal task completion and * started. The background task uses a callback object to signal task
* return results. * completion and return results.
* *
* This method should not be called unless isPanelValid returns true, and * This method should not be called unless isPanelValid returns true, and
* should only be called for DSPs that support ingest streams. * should only be called for DSPs that support ingest streams.
* *
* @param settings The ingest job settings. * @param settings The ingest job settings.
* @param progress Progress monitor that will be used by the * @param progress Progress monitor that will be used by the background task
* background task to report progress. * to report progress.
* @param callBack Callback that will be used by the background task * @param callBack Callback that will be used by the background task to
* to return results. * return results.
*/ */
@Override @Override
public void runWithIngestStream(IngestJobSettings settings, DataSourceProcessorProgressMonitor progress, public void runWithIngestStream(IngestJobSettings settings, DataSourceProcessorProgressMonitor progress,
@ -246,20 +244,20 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
/** /**
* Adds a data source to the case database using a background task in a * Adds a data source to the case database using a background task in a
* separate thread and the settings provided by the selection and * separate thread and the settings provided by the selection and
* configuration panel. Files found during ingest will be sent directly to the * configuration panel. Files found during ingest will be sent directly to
* IngestStream provided. Returns as soon as the background task is started. * the IngestStream provided. Returns as soon as the background task is
* The background task uses a callback object to signal task completion and * started. The background task uses a callback object to signal task
* return results. * completion and return results.
* *
* This method should not be called unless isPanelValid returns true, and * This method should not be called unless isPanelValid returns true, and
* should only be called for DSPs that support ingest streams. * should only be called for DSPs that support ingest streams.
* *
* @param host The host for this data source. * @param host The host for this data source.
* @param settings The ingest job settings. * @param settings The ingest job settings.
* @param progress Progress monitor that will be used by the * @param progress Progress monitor that will be used by the background task
* background task to report progress. * to report progress.
* @param callBack Callback that will be used by the background task * @param callBack Callback that will be used by the background task to
* to return results. * return results.
*/ */
@Override @Override
public void runWithIngestStream(Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progress, public void runWithIngestStream(Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progress,
@ -292,7 +290,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
return; return;
} }
doAddImageProcess(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, progress, callBack); doAddImageProcess(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, progress, callBack);
} }
@ -300,7 +297,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
* Store the options from the config panel. * Store the options from the config panel.
*/ */
private void readConfigSettings() { private void readConfigSettings() {
if (!setDataSourceOptionsCalled) {
configPanel.storeSettings(); configPanel.storeSettings();
deviceId = UUID.randomUUID().toString(); deviceId = UUID.randomUUID().toString();
imagePath = configPanel.getContentPaths(); imagePath = configPanel.getContentPaths();
@ -320,7 +316,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
sha256 = null; sha256 = null;
} }
} }
}
/** /**
* Check if this DSP supports ingest streams. * Check if this DSP supports ingest streams.
@ -376,8 +371,8 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
* is started and uses the callback object to signal task completion and * is started and uses the callback object to signal task completion and
* return results. * return results.
* *
* The image should be loaded in the database and stored in "image" * The image should be loaded in the database and stored in "image" before
* before calling this method. Additionally, an ingest stream should be initialized * calling this method. Additionally, an ingest stream should be initialized
* and stored in "ingestStream". * and stored in "ingestStream".
* *
* @param deviceId An ASCII-printable identifier for the device * @param deviceId An ASCII-printable identifier for the device
@ -455,7 +450,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
ignoreFatOrphanFiles = false; ignoreFatOrphanFiles = false;
host = null; host = null;
configPanel.reset(); configPanel.reset();
setDataSourceOptionsCalled = false;
} }
private static boolean isAcceptedByFiler(File file, List<FileFilter> filters) { private static boolean isAcceptedByFiler(File file, List<FileFilter> filters) {
@ -503,7 +497,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
this.timeZone = Calendar.getInstance().getTimeZone().getID(); this.timeZone = Calendar.getInstance().getTimeZone().getID();
this.host = host; this.host = host;
this.ignoreFatOrphanFiles = false; this.ignoreFatOrphanFiles = false;
setDataSourceOptionsCalled = true;
ingestStream = new DefaultIngestStream(); ingestStream = new DefaultIngestStream();
try { try {
@ -518,9 +511,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
} }
doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack); doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack);
// reset the settings so that by default the config panel is used next time (JIRA-7337).
reset();
} }
@Override @Override
@ -537,7 +527,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
this.timeZone = Calendar.getInstance().getTimeZone().getID(); this.timeZone = Calendar.getInstance().getTimeZone().getID();
this.host = host; this.host = host;
this.ignoreFatOrphanFiles = false; this.ignoreFatOrphanFiles = false;
setDataSourceOptionsCalled = true;
// Set up the data source before creating the ingest stream // Set up the data source before creating the ingest stream
try { try {
@ -564,9 +553,6 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack); doAddImageProcess(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack);
// reset the settings so that by default the config panel is used next time (JIRA-7337).
reset();
return ingestStream; return ingestStream;
} }
} }

View File

@ -59,7 +59,6 @@ public class LocalDiskDSProcessor implements DataSourceProcessor {
private Host host; private Host host;
private ImageWriterSettings imageWriterSettings; private ImageWriterSettings imageWriterSettings;
private boolean ignoreFatOrphanFiles; private boolean ignoreFatOrphanFiles;
private boolean setDataSourceOptionsCalled;
/** /**
* Constructs a local drive data source processor that implements the * Constructs a local drive data source processor that implements the
@ -156,7 +155,6 @@ public class LocalDiskDSProcessor implements DataSourceProcessor {
*/ */
@Override @Override
public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
if (!setDataSourceOptionsCalled) {
deviceId = UUID.randomUUID().toString(); deviceId = UUID.randomUUID().toString();
drivePath = configPanel.getContentPath(); drivePath = configPanel.getContentPath();
sectorSize = configPanel.getSectorSize(); sectorSize = configPanel.getSectorSize();
@ -167,7 +165,6 @@ public class LocalDiskDSProcessor implements DataSourceProcessor {
} else { } else {
imageWriterSettings = null; imageWriterSettings = null;
} }
}
this.host = host; this.host = host;
@ -284,6 +281,5 @@ public class LocalDiskDSProcessor implements DataSourceProcessor {
drivePath = null; drivePath = null;
timeZone = null; timeZone = null;
ignoreFatOrphanFiles = false; ignoreFatOrphanFiles = false;
setDataSourceOptionsCalled = false;
} }
} }

View File

@ -78,7 +78,6 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat
* when the deprecated method setDataSourceOptions is removed. * when the deprecated method setDataSourceOptions is removed.
*/ */
private List<String> localFilePaths; private List<String> localFilePaths;
private boolean setDataSourceOptionsCalled;
/** /**
* Constructs a local/logical files and/or directories data source processor * Constructs a local/logical files and/or directories data source processor
@ -175,7 +174,6 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat
*/ */
@Override @Override
public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { public void run(Host host, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
if (!setDataSourceOptionsCalled) {
localFilePaths = configPanel.getContentPaths(); localFilePaths = configPanel.getContentPaths();
if (configPanel.subTypeIsLogicalEvidencePanel()) { if (configPanel.subTypeIsLogicalEvidencePanel()) {
@ -193,7 +191,6 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat
return; return;
} }
} }
}
run(UUID.randomUUID().toString(), configPanel.getFileSetName(), localFilePaths, host, progressMonitor, callback); run(UUID.randomUUID().toString(), configPanel.getFileSetName(), localFilePaths, host, progressMonitor, callback);
} }
@ -385,7 +382,6 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat
public void reset() { public void reset() {
configPanel.select(); configPanel.select();
localFilePaths = null; localFilePaths = null;
setDataSourceOptionsCalled = false;
} }
@Override @Override