mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Made updates to data source ingest job, waiting for jython stripping code.
This commit is contained in:
parent
e4850e4212
commit
dcd23b96b7
@ -31,10 +31,19 @@ import java.util.logging.Level;
|
|||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import org.netbeans.api.progress.ProgressHandle;
|
import org.netbeans.api.progress.ProgressHandle;
|
||||||
import org.openide.util.Cancellable;
|
import org.openide.util.Cancellable;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.NetworkUtils;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
|
import org.sleuthkit.datamodel.IngestJobInfo;
|
||||||
|
import org.sleuthkit.datamodel.IngestModuleInfo;
|
||||||
|
import org.sleuthkit.datamodel.IngestModuleType;
|
||||||
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
import org.sleuthkit.datamodel.TskDataException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulates a data source and the ingest module pipelines used to process
|
* Encapsulates a data source and the ingest module pipelines used to process
|
||||||
@ -151,6 +160,8 @@ final class DataSourceIngestJob {
|
|||||||
private ProgressHandle fileIngestProgress;
|
private ProgressHandle fileIngestProgress;
|
||||||
private String currentFileIngestModule = "";
|
private String currentFileIngestModule = "";
|
||||||
private String currentFileIngestTask = "";
|
private String currentFileIngestTask = "";
|
||||||
|
private List<IngestModuleInfo> ingestModules = new ArrayList<>();
|
||||||
|
private IngestJobInfo ingestJob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A data source ingest job uses this field to report its creation time.
|
* A data source ingest job uses this field to report its creation time.
|
||||||
@ -243,6 +254,23 @@ final class DataSourceIngestJob {
|
|||||||
*/
|
*/
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
|
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
|
||||||
|
try {
|
||||||
|
for (IngestModuleTemplate module : firstStageDataSourceModuleTemplates) {
|
||||||
|
IngestModuleType type = module.isDataSourceIngestModuleTemplate() ? IngestModuleType.DATA_SOURCE_LEVEL : IngestModuleType.FILE_LEVEL;
|
||||||
|
ingestModules.add(skCase.addIngestModule(module.getModuleName(), currentFileIngestTask, type, module.getModuleFactory().getModuleVersionNumber()));
|
||||||
|
}
|
||||||
|
for (IngestModuleTemplate module : fileIngestModuleTemplates) {
|
||||||
|
IngestModuleType type = module.isDataSourceIngestModuleTemplate() ? IngestModuleType.DATA_SOURCE_LEVEL : IngestModuleType.FILE_LEVEL;
|
||||||
|
ingestModules.add(skCase.addIngestModule(module.getModuleName(), currentFileIngestTask, type, module.getModuleFactory().getModuleVersionNumber()));
|
||||||
|
}
|
||||||
|
for (IngestModuleTemplate module : secondStageDataSourceModuleTemplates) {
|
||||||
|
IngestModuleType type = module.isDataSourceIngestModuleTemplate() ? IngestModuleType.DATA_SOURCE_LEVEL : IngestModuleType.FILE_LEVEL;
|
||||||
|
ingestModules.add(skCase.addIngestModule(module.getModuleName(), currentFileIngestTask, type, module.getModuleFactory().getModuleVersionNumber()));
|
||||||
|
}
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Failed to add ingest modules to database.", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -365,6 +393,11 @@ final class DataSourceIngestJob {
|
|||||||
logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1}), no first stage configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS
|
logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1}), no first stage configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS
|
||||||
this.startSecondStage();
|
this.startSecondStage();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
this.ingestJob = Case.getCurrentCase().getSleuthkitCase().addIngestJob(dataSource, NetworkUtils.getLocalHostName(), ingestModules, this.createTime);
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Failed to add ingest job to database.", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
@ -641,7 +674,13 @@ final class DataSourceIngestJob {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
this.ingestJob.setEndDate(new Date().toInstant().toEpochMilli());
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Failed to set end date for ingest job in database.", ex);
|
||||||
|
} catch (TskDataException ex) {
|
||||||
|
Exceptions.printStackTrace(ex);
|
||||||
|
}
|
||||||
this.parentJob.dataSourceJobFinished(this);
|
this.parentJob.dataSourceJobFinished(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user