From a2616adb495e506ba60ea77822e6ee2c75501e80 Mon Sep 17 00:00:00 2001 From: 0xNF Date: Fri, 7 Dec 2012 11:25:40 -0500 Subject: [PATCH] Better cancel support --- .../autopsy/directorytree/ExtractUnallocAction.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java index f963cdf1ec..881c6aa476 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java @@ -129,7 +129,7 @@ public final class ExtractUnallocAction extends AbstractAction { uw.execute(); } } else { - logger.log(Level.WARNING, "Tried to get unallocated content from volume ID " + u.VolumeId + ", but its list of unallocated files was empty or null"); + logger.log(Level.WARNING, "Tried to get unallocated content from volume ID but " + u.VolumeId + u.llf == null ? "its list of unallocated files was null" : "the volume is locked" ); } } if (isImage && !copyList.isEmpty()) { @@ -250,7 +250,6 @@ public final class ExtractUnallocAction extends AbstractAction { } else { logger.log(Level.INFO, "Finished writing unalloc file " + u.getFile().getPath()); } - lockedVols.remove(u.FileName); } progress.finish(); @@ -270,10 +269,13 @@ public final class ExtractUnallocAction extends AbstractAction { if (isImage) { lockedImages.remove(currentImage); } - if (!canceled) { + for (UnallocStruct u : lus) { + lockedVols.remove(u.getFileName()); + } + if (!canceled && !lus.isEmpty()) { JOptionPane.showMessageDialog(new Frame(), "Completed extraction of unallocated space. Files were extracted to " + lus.get(0).getFile().getParent()); } - } + } } /**