Merge pull request #1358 from karlmortensen/pr_fix

make photorec notify when it adds new files
This commit is contained in:
Richard Cordovano 2015-06-12 14:41:35 -04:00
commit 756c59d187

View File

@ -57,6 +57,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.ingest.ProcTerminationCode; import org.sleuthkit.autopsy.ingest.ProcTerminationCode;
import org.sleuthkit.autopsy.ingest.FileIngestModuleProcessTerminator; import org.sleuthkit.autopsy.ingest.FileIngestModuleProcessTerminator;
import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleContentEvent;
/** /**
* A file ingest module that runs the Unallocated Carver executable with unallocated space files as input. * A file ingest module that runs the Unallocated Carver executable with unallocated space files as input.
@ -76,6 +77,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
private IngestJobContext context; private IngestJobContext context;
private Path rootOutputDirPath; private Path rootOutputDirPath;
private File executableFile; private File executableFile;
private IngestServices services;
/** /**
* @inheritDoc * @inheritDoc
@ -83,6 +85,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
@Override @Override
public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException { public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException {
this.context = context; this.context = context;
this.services = IngestServices.getInstance();
// If the global unallocated space processing setting and the module // If the global unallocated space processing setting and the module
// process unallocated space only setting are not in sych, throw an // process unallocated space only setting are not in sych, throw an
@ -220,6 +223,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
List<LayoutFile> theList = parser.parse(newAuditFile, id, file); List<LayoutFile> theList = parser.parse(newAuditFile, id, file);
if (theList != null) { // if there were any results from carving, add the unallocated carving event to the reports list. if (theList != null) { // if there were any results from carving, add the unallocated carving event to the reports list.
context.addFilesToJob(new ArrayList<>(theList)); context.addFilesToJob(new ArrayList<>(theList));
services.fireModuleContentEvent(new ModuleContentEvent(theList.get(0))); // fire an event to update the tree
} }
} }
catch (IOException ex) { catch (IOException ex) {