mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Fixed delete behavior on html reports.
This commit is contained in:
parent
05f6cd44a7
commit
d2dca5a855
@ -1640,9 +1640,12 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
|
|
||||||
// delete from the disk.
|
// delete from the disk.
|
||||||
File toDelete = new File(reportPath);
|
File toDelete = new File(reportPath);
|
||||||
|
if (report.getReportName().equals("") && report.getSourceModuleName().equals("HTML Report")) {
|
||||||
|
toDelete = toDelete.getParentFile();
|
||||||
|
}
|
||||||
if (toDelete.isDirectory()) {
|
if (toDelete.isDirectory()) {
|
||||||
try {
|
try {
|
||||||
FileUtils.deleteDirectory(new File(reportPath));
|
FileUtils.deleteDirectory(toDelete);
|
||||||
} catch (IOException | SecurityException ex) {
|
} catch (IOException | SecurityException ex) {
|
||||||
logger.log(Level.WARNING, NbBundle.getMessage(Case.class, "Case.deleteReports.deleteFromDiskException.log.msg"), 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));
|
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));
|
eventPublisher.publish(new AutopsyEvent(Events.REPORT_DELETED.toString(), null, null));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user