1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Fixed delete behavior on html reports.

This commit is contained in:
Oliver Spohngellert
2016-05-16 10:00:37 -04:00
parent 05f6cd44a7
commit d2dca5a855

View File

@@ -1640,9 +1640,12 @@ public class Case implements SleuthkitCase.ErrorObserver {
// delete from the disk.
File toDelete = new File(reportPath);
if (report.getReportName().equals("") && report.getSourceModuleName().equals("HTML Report")) {
toDelete = toDelete.getParentFile();
}
if (toDelete.isDirectory()) {
try {
FileUtils.deleteDirectory(new File(reportPath));
FileUtils.deleteDirectory(toDelete);
} catch (IOException | SecurityException ex) {
logger.log(Level.WARNING, NbBundle.getMessage(Case.class, "Case.deleteReports.deleteFromDiskException.log.msg"), ex);
JOptionPane.showMessageDialog(null, NbBundle.getMessage(Case.class, "Case.deleteReports.deleteFromDiskException.msg", report.getReportName(), reportPath));
@@ -1655,7 +1658,6 @@ public class Case implements SleuthkitCase.ErrorObserver {
}
}
}
eventPublisher.publish(new AutopsyEvent(Events.REPORT_DELETED.toString(), null, null));
}