From e52fc36d6a3c94bc0fdb87612c09828be37827fc Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 14 Jun 2016 10:41:19 -0400 Subject: [PATCH] Made changes as per PR notes. --- .../autopsy/modules/stix/Bundle.properties | 2 +- .../autopsy/modules/stix/Bundle_ja.properties | 25 +++++++++---------- .../modules/stix/STIXReportModule.java | 19 +++----------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle.properties b/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle.properties index 10a5c0c593..cb44363a4a 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle.properties @@ -6,7 +6,7 @@ STIXReportModuleConfigPanel.jLabel2.text=Select a STIX file or directory of STIX STIXReportModuleConfigPanel.jTextField1.text= STIXReportModuleConfigPanel.jButton1.text=Choose file STIXReportModuleConfigPanel.jCheckBox1.text=Include results for false indicators in output file -STIXReportModule.notifyMsg.unableToOpenReportFile=Unable to open STIX report file {0} +STIXReportModule.notifyMsg.unableToOpenReportFile=Unable to complete STIX report. STIXReportModule.progress.completedWithErrors=Completed with errors STIXReportModule.notifyMsg.unableToOpenFileDir=Unable to open STIX file/directory {0} STIXReportModule.progress.couldNotOpenFileDir=Could not open file/directory {0} diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle_ja.properties index 242f9b6b5c..5dfc25469b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/Bundle_ja.properties @@ -1,14 +1,13 @@ -OpenIDE-Module-Name=stix\u30E2\u30B8\u30E5\u30FC\u30EB -STIXReportModule.getDesc.text=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306B\u5BFE\u3057\u3066\u5E7E\u3064\u304B\u306ESTIX\uFF08Structured Threat Information eXpression\uFF1B\u8105\u5A01\u60C5\u5831\u69CB\u9020\u5316\u8A18\u8FF0\u5F62\u5F0F\uFF09\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3057\u3001\u30EC\u30DD\u30FC\u30C8\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u307E\u305F\u3001\u7591\u308F\u3057\u3044\u30D5\u30A1\u30A4\u30EB\u5185\u306B\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u3092\u4F5C\u6210\u3002 +OpenIDE-Module-Name=stix\u30e2\u30b8\u30e5\u30fc\u30eb +STIXReportModule.getDesc.text=\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306b\u5bfe\u3057\u3066\u5e7e\u3064\u304b\u306eSTIX\uff08Structured Threat Information eXpression\uff1b\u8105\u5a01\u60c5\u5831\u69cb\u9020\u5316\u8a18\u8ff0\u5f62\u5f0f\uff09\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u3001\u30ec\u30dd\u30fc\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u7591\u308f\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u3092\u4f5c\u6210\u3002 STIXReportModule.getName.text=STIX -STIXReportModule.notifyMsg.tooManyArtifactsgt1000="{0}"\u7528\u306B\u751F\u6210\u3055\u308C\u305FSTIX\u95A2\u9023\u306E\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u304C\u591A\u3059\u304E\u307E\u3059\u3002\u6700\u521D\u306E1000\u306E\u307F\u4FDD\u5B58\u3055\u308C\u307E\u3059\u3002 -STIXReportModule.notifyMsg.unableToOpenFileDir=STIX\u30D5\u30A1\u30A4\u30EB\uFF0F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F -STIXReportModule.notifyMsg.unableToOpenReportFile=STIX\u30EC\u30DD\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB{0}\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F -STIXReportModule.progress.completedWithErrors=\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u304C\u3001\u5B8C\u4E86\u3057\u307E\u3057\u305F -STIXReportModule.progress.couldNotOpenFileDir=\u30D5\u30A1\u30A4\u30EB\uFF0F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F -STIXReportModule.progress.readSTIX=STIX\u30D5\u30A1\u30A4\u30EB\u3092\u30D1\u30FC\u30B9\u4E2D -STIXReportModuleConfigPanel.jButton1.text=\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E -STIXReportModuleConfigPanel.jCheckBox1.text=\u30A2\u30A6\u30C8\u30D7\u30C3\u30C8\u30D5\u30A1\u30A4\u30EB\u306E\u8AA4\u3063\u305F\u30A4\u30F3\u30B8\u30B1\u30FC\u30BF\u30FC\u306E\u7D50\u679C\u3082\u542B\u3080 -STIXReportModuleConfigPanel.jLabel2.text=STIX\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306FSTIX\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u9078\u629E -STIXReportModule.notifyErr.noFildDirProvided=STIX\u30D5\u30A1\u30A4\u30EB\uFF0F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093 -STIXReportModule.progress.noFildDirProvided=STIX\u30D5\u30A1\u30A4\u30EB\uFF0F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093 \ No newline at end of file +STIXReportModule.notifyMsg.tooManyArtifactsgt1000="{0}"\u7528\u306b\u751f\u6210\u3055\u308c\u305fSTIX\u95a2\u9023\u306e\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u304c\u591a\u3059\u304e\u307e\u3059\u3002\u6700\u521d\u306e1000\u306e\u307f\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002 +STIXReportModule.notifyMsg.unableToOpenFileDir=STIX\u30d5\u30a1\u30a4\u30eb\uff0f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea{0}\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f +STIXReportModule.progress.completedWithErrors=\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u304c\u3001\u5b8c\u4e86\u3057\u307e\u3057\u305f +STIXReportModule.progress.couldNotOpenFileDir=\u30d5\u30a1\u30a4\u30eb\uff0f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea{0}\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f +STIXReportModule.progress.readSTIX=STIX\u30d5\u30a1\u30a4\u30eb\u3092\u30d1\u30fc\u30b9\u4e2d +STIXReportModuleConfigPanel.jButton1.text=\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e +STIXReportModuleConfigPanel.jCheckBox1.text=\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u8aa4\u3063\u305f\u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u30fc\u306e\u7d50\u679c\u3082\u542b\u3080 +STIXReportModuleConfigPanel.jLabel2.text=STIX\u30d5\u30a1\u30a4\u30eb\u307e\u305f\u306fSTIX\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u9078\u629e +STIXReportModule.notifyErr.noFildDirProvided=STIX\u30d5\u30a1\u30a4\u30eb\uff0f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093 +STIXReportModule.progress.noFildDirProvided=STIX\u30d5\u30a1\u30a4\u30eb\uff0f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093 \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java index a3366d73b6..3cc97c3e10 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java @@ -104,17 +104,16 @@ public class STIXReportModule implements GeneralReportModule { progressPanel.start(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.readSTIX")); reportPath = baseReportDir + getRelativeFilePath(); - + File reportFile = new File(reportPath); // Check if the user wants to display all output or just hits reportAllResults = configPanel.getShowAllResults(); - // Set up the output file // Keep track of whether any errors occur during processing boolean hadErrors = false; // Process the file/directory name entry String stixFileName = configPanel.getStixFile(); - File reportFile = new File(reportPath); + if (stixFileName == null) { logger.log(Level.SEVERE, "STIXReportModuleConfigPanel.stixFile not initialized "); //NON-NLS MessageNotifyUtil.Message.error( @@ -184,15 +183,6 @@ public class STIXReportModule implements GeneralReportModule { idToResult = new HashMap(); } - // Close the output file - if (output != null) { - try { - output.close(); - } catch (IOException ex) { - logger.log(Level.SEVERE, String.format("Error closing STIX report file %s", reportPath), ex); //NON-NLS - } - } - // Set the progress bar to done. If any errors occurred along the way, modify // the "complete" message to indicate this. Case.getCurrentCase().addReport(reportPath, Bundle.STIXReportModule_srcModuleName_text(), ""); @@ -204,11 +194,10 @@ public class STIXReportModule implements GeneralReportModule { progressPanel.complete(ReportStatus.COMPLETE); } } catch (IOException ex) { - logger.log(Level.SEVERE, String.format("Unable to open STIX report file %s", reportPath), ex); //NON-NLS + logger.log(Level.SEVERE, "Unable to complete STIX report.", ex); //NON-NLS MessageNotifyUtil.Notify.show("STIXReportModule", //NON-NLS NbBundle.getMessage(this.getClass(), - "STIXReportModule.notifyMsg.unableToOpenReportFile", - reportPath), + "STIXReportModule.notifyMsg.unableToOpenReportFile"), MessageNotifyUtil.MessageType.ERROR); progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel(