From 937abb24c4e17ef5613b004e333d4a2e031255e1 Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Tue, 15 Apr 2014 17:52:42 -0400 Subject: [PATCH] Pulled strings into Bundle. --- .../org/sleuthkit/autopsy/scalpel/Bundle.properties | 4 ++++ .../autopsy/scalpel/ScalpelCarverIngestModule.java | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/Bundle.properties b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/Bundle.properties index 2b5483a453..b00f23b0d9 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/Bundle.properties +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/Bundle.properties @@ -7,3 +7,7 @@ OpenIDE-Module-Short-Description=Carves files from unallocated space ScalpelCarverIngestModule.moduleName=Scalpel Carver ScalpelCarverIngestModule.moduleDesc.text=Carves files from unallocated space at ingest time.\ Carved files are reanalyzed and displayed in the directory tree. +ScalpelCarverIngestModule.startUp.exception.msg1=Scalpel carving module is not compatible with non-Windows OS's at this time. +ScalpelCarverIngestModule.startUp.exception.msg2=Error initializing scalpel carver. +ScalpelCarverIngestModule.startUp.exception.msg3=Could not create the output directory for the Scalpel module. +ScalpelCarverIngestModule.startUp.exception.msg4=Could not obtain the path to the Scalpel configuration file. diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java index 7db7b56701..af8de00f89 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; @@ -69,14 +71,14 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges // make sure this is Windows String os = System.getProperty("os.name"); if (!os.startsWith("Windows")) { - String message = "Scalpel carving module is not compatible with non-Windows OS's at this time."; + String message = NbBundle.getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg1"); logger.log(Level.SEVERE, message); throw new IngestModuleException(message); } carver = new ScalpelCarver(); if (!carver.isInitialized()) { - String message = "Error initializing scalpel carver."; + String message = NbBundle.getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg2"); logger.log(Level.SEVERE, message); throw new IngestModuleException(message); } @@ -87,7 +89,8 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges File moduleOutputDir = new File(moduleOutputDirPath); if (!moduleOutputDir.exists()) { if (!moduleOutputDir.mkdir()) { - String message = "Could not create the output directory for the Scalpel module."; + String message = NbBundle + .getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg3"); logger.log(Level.SEVERE, message); throw new IngestModuleException(message); } @@ -102,7 +105,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges try { PlatformUtil.extractResourceToUserConfigDir(this.getClass(), configFileName, false); } catch (IOException ex) { - String message = "Could not obtain the path to the Scalpel configuration file."; + String message = NbBundle.getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg4"); logger.log(Level.SEVERE, message, ex); throw new IngestModuleException(message); }