From f18420aa113a25f05d2e73de7d1b085f7f229f55 Mon Sep 17 00:00:00 2001 From: sidheshenator Date: Wed, 25 Mar 2015 16:04:58 -0400 Subject: [PATCH 1/3] used non deprecated complete(ReportStatus) --- .../sleuthkit/autopsy/casemodule/StartupWindow.java | 2 +- .../autopsy/modules/stix/STIXReportModule.java | 13 ++++++++----- .../sleuthkit/autopsy/report/ReportGenerator.java | 4 ++-- .../src/org/sleuthkit/autopsy/report/ReportKML.java | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java index b274c851a1..bd9e3d3d23 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java @@ -63,7 +63,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); CueBannerPanel welcomeWindow = new CueBannerPanel(); - welcomeWindow.refresh(); + CueBannerPanel.refresh(); // add the command to close the window to the button on the Volume Detail Panel welcomeWindow.setCloseButtonActionListener(new ActionListener() { diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java index ee1021944b..6431f4ab87 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java @@ -59,6 +59,7 @@ import org.mitre.cybox.objects.DomainName; import org.mitre.cybox.objects.WindowsRegistryKey; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.ModuleSettings; +import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; /** * @@ -120,7 +121,7 @@ public class STIXReportModule implements GeneralReportModule { "STIXReportModule.notifyMsg.unableToOpenReportFile", reportPath), MessageNotifyUtil.MessageType.ERROR); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors")); return; @@ -135,7 +136,7 @@ public class STIXReportModule implements GeneralReportModule { logger.log(Level.SEVERE, "STIXReportModuleConfigPanel.stixFile not initialized "); //NON-NLS MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided")); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided")); return; @@ -144,7 +145,7 @@ public class STIXReportModule implements GeneralReportModule { logger.log(Level.SEVERE, "No STIX file/directory provided "); //NON-NLS MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided")); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided")); return; @@ -156,7 +157,7 @@ public class STIXReportModule implements GeneralReportModule { MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyMsg.unableToOpenFileDir", stixFileName)); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.couldNotOpenFileDir", stixFileName)); return; @@ -201,10 +202,12 @@ public class STIXReportModule implements GeneralReportModule { // Set the progress bar to done. If any errors occurred along the way, modify // the "complete" message to indicate this. - progressPanel.complete(); if (hadErrors) { + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors")); + } else { + progressPanel.complete(ReportStatus.COMPLETE); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index dfa627fa91..40801f4ab2 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -358,7 +358,7 @@ import org.sleuthkit.datamodel.TskData; for (FileReportModule module : fileModules) { module.endTable(); module.endReport(); - fileProgress.get(module).complete(); + fileProgress.get(module).complete(ReportStatus.COMPLETE); } return 0; @@ -463,7 +463,7 @@ import org.sleuthkit.datamodel.TskData; // finish progress, wrap up for (TableReportModule module : tableModules) { - tableProgress.get(module).complete(); + tableProgress.get(module).complete(ReportStatus.COMPLETE); module.endReport(); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index 4b03caf8f6..1f6c5a665b 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -339,12 +339,12 @@ class ReportKML implements GeneralReportModule { } catch (IOException ex) { logger.log(Level.WARNING, "Could not write the KML report.", ex); //NON-NLS } - progressPanel.complete(); + progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR); } catch (TskCoreException ex) { logger.log(Level.WARNING, "Failed to get the unique path.", ex); //NON-NLS } progressPanel.increment(); - progressPanel.complete(); + progressPanel.complete(ReportProgressPanel.ReportStatus.COMPLETE); } public static void copyFileUsingStream(AbstractFile file, File jFile) throws IOException { From dca20e80cd49fdf9f53aa0dbc4ac7da5fff66c8c Mon Sep 17 00:00:00 2001 From: sidheshenator Date: Thu, 26 Mar 2015 14:11:40 -0400 Subject: [PATCH 2/3] python report module shows up in the tree --- pythonExamples/reportmodule.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pythonExamples/reportmodule.py b/pythonExamples/reportmodule.py index 0b0ee8c8f7..566ad0f1c3 100755 --- a/pythonExamples/reportmodule.py +++ b/pythonExamples/reportmodule.py @@ -64,6 +64,7 @@ class SampleGeneralReportModule(GeneralReportModuleAdapter): # Write the result to the report file. report = open(reportPath + '\\' + self.getRelativeFilePath(), 'w') report.write("file count = %d" % fileCount) + Case.getCurrentCase().addReport(report.name, "SampleGeneralReportModule", "Sample Python Report"); report.close() progressBar.increment() progressBar.complete() \ No newline at end of file From b1284625d220c203467112afe26441aeba941fdc Mon Sep 17 00:00:00 2001 From: sidheshenator Date: Thu, 26 Mar 2015 16:28:37 -0400 Subject: [PATCH 3/3] Revert "used non deprecated complete(ReportStatus)" This reverts commit f18420aa113a25f05d2e73de7d1b085f7f229f55. --- .../sleuthkit/autopsy/casemodule/StartupWindow.java | 2 +- .../autopsy/modules/stix/STIXReportModule.java | 13 +++++-------- .../sleuthkit/autopsy/report/ReportGenerator.java | 4 ++-- .../src/org/sleuthkit/autopsy/report/ReportKML.java | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java index bd9e3d3d23..b274c851a1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java @@ -63,7 +63,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); CueBannerPanel welcomeWindow = new CueBannerPanel(); - CueBannerPanel.refresh(); + welcomeWindow.refresh(); // add the command to close the window to the button on the Volume Detail Panel welcomeWindow.setCloseButtonActionListener(new ActionListener() { diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java index 6431f4ab87..ee1021944b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java @@ -59,7 +59,6 @@ import org.mitre.cybox.objects.DomainName; import org.mitre.cybox.objects.WindowsRegistryKey; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.ModuleSettings; -import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; /** * @@ -121,7 +120,7 @@ public class STIXReportModule implements GeneralReportModule { "STIXReportModule.notifyMsg.unableToOpenReportFile", reportPath), MessageNotifyUtil.MessageType.ERROR); - progressPanel.complete(ReportStatus.ERROR); + progressPanel.complete(); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors")); return; @@ -136,7 +135,7 @@ public class STIXReportModule implements GeneralReportModule { logger.log(Level.SEVERE, "STIXReportModuleConfigPanel.stixFile not initialized "); //NON-NLS MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided")); - progressPanel.complete(ReportStatus.ERROR); + progressPanel.complete(); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided")); return; @@ -145,7 +144,7 @@ public class STIXReportModule implements GeneralReportModule { logger.log(Level.SEVERE, "No STIX file/directory provided "); //NON-NLS MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided")); - progressPanel.complete(ReportStatus.ERROR); + progressPanel.complete(); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided")); return; @@ -157,7 +156,7 @@ public class STIXReportModule implements GeneralReportModule { MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyMsg.unableToOpenFileDir", stixFileName)); - progressPanel.complete(ReportStatus.ERROR); + progressPanel.complete(); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.couldNotOpenFileDir", stixFileName)); return; @@ -202,12 +201,10 @@ public class STIXReportModule implements GeneralReportModule { // Set the progress bar to done. If any errors occurred along the way, modify // the "complete" message to indicate this. + progressPanel.complete(); if (hadErrors) { - progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors")); - } else { - progressPanel.complete(ReportStatus.COMPLETE); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 40801f4ab2..dfa627fa91 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -358,7 +358,7 @@ import org.sleuthkit.datamodel.TskData; for (FileReportModule module : fileModules) { module.endTable(); module.endReport(); - fileProgress.get(module).complete(ReportStatus.COMPLETE); + fileProgress.get(module).complete(); } return 0; @@ -463,7 +463,7 @@ import org.sleuthkit.datamodel.TskData; // finish progress, wrap up for (TableReportModule module : tableModules) { - tableProgress.get(module).complete(ReportStatus.COMPLETE); + tableProgress.get(module).complete(); module.endReport(); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index 1f6c5a665b..4b03caf8f6 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -339,12 +339,12 @@ class ReportKML implements GeneralReportModule { } catch (IOException ex) { logger.log(Level.WARNING, "Could not write the KML report.", ex); //NON-NLS } - progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR); + progressPanel.complete(); } catch (TskCoreException ex) { logger.log(Level.WARNING, "Failed to get the unique path.", ex); //NON-NLS } progressPanel.increment(); - progressPanel.complete(ReportProgressPanel.ReportStatus.COMPLETE); + progressPanel.complete(); } public static void copyFileUsingStream(AbstractFile file, File jFile) throws IOException {