ingest progress bar: show more accurately which file is being ingested now

This commit is contained in:
adam-m 2012-04-09 17:03:45 -04:00
parent 58ded3afa2
commit c266b4fd41

View File

@ -554,8 +554,6 @@ public class IngestManager {
return ret; return ret;
} }
//image worker to remove itself when complete or interrupted //image worker to remove itself when complete or interrupted
void removeImageIngestWorker(IngestImageThread worker) { void removeImageIngestWorker(IngestImageThread worker) {
//remove worker //remove worker
@ -692,9 +690,10 @@ public class IngestManager {
*/ */
boolean hasServiceEnqueued(IngestServiceFsContent service) { boolean hasServiceEnqueued(IngestServiceFsContent service) {
for (List<IngestServiceFsContent> list : fsContentUnits.values()) { for (List<IngestServiceFsContent> list : fsContentUnits.values()) {
if(list.contains(service)) if (list.contains(service)) {
return true; return true;
} }
}
return false; return false;
} }
@ -927,12 +926,15 @@ public class IngestManager {
fsContentServiceResults.clear(); fsContentServiceResults.clear();
} }
final FsContent fileToProcess = unit.getKey();
for (IngestServiceFsContent service : unit.getValue()) { for (IngestServiceFsContent service : unit.getValue()) {
if (isCancelled()) { if (isCancelled()) {
return null; return null;
} }
final FsContent fileToProcess = unit.getKey(); progress.progress(fileToProcess.getName(), processedFiles);
if ((fileToProcess.getMeta_flags() & TskData.TSK_FS_META_FLAG_ENUM.UNALLOC.getMetaFlag()) != 0) { if ((fileToProcess.getMeta_flags() & TskData.TSK_FS_META_FLAG_ENUM.UNALLOC.getMetaFlag()) != 0) {
//skip unallocated files, processing certain unalloc files may cause some modules to hang //skip unallocated files, processing certain unalloc files may cause some modules to hang
//TODO unallocated space and files are a future feature //TODO unallocated space and files are a future feature
@ -966,7 +968,7 @@ public class IngestManager {
progress.switchToIndeterminate(); progress.switchToIndeterminate();
progress.switchToDeterminate(numFsContents); progress.switchToDeterminate(numFsContents);
} }
progress.progress(unit.getKey().getName(), ++processedFiles); progress.progress(fileToProcess.getName(), ++processedFiles);
--numFsContents; --numFsContents;
} //end of this fsContent } //end of this fsContent
logger.log(Level.INFO, "Done background processing"); logger.log(Level.INFO, "Done background processing");
@ -1011,7 +1013,6 @@ public class IngestManager {
} }
private void handleInterruption() { private void handleInterruption() {
for (IngestServiceFsContent s : fsContentServices) { for (IngestServiceFsContent s : fsContentServices) {
s.stop(); s.stop();
@ -1123,9 +1124,10 @@ public class IngestManager {
} }
progress.progress(serviceName + " " + imageName, ++processed); progress.progress(serviceName + " " + imageName, ++processed);
} }
if(fsContents != null) if (fsContents != null) {
fsContents.clear(); fsContents.clear();
} }
}
//logger.log(Level.INFO, fsContentQueue.printQueue()); //logger.log(Level.INFO, fsContentQueue.printQueue());