From adfa7d30809ffdf73ad590f931ffedc313f708cf Mon Sep 17 00:00:00 2001 From: Nick Davis Date: Thu, 28 Jan 2016 21:03:05 -0500 Subject: [PATCH] Extracted strings. Commented strings with NON-NLS. --- .../sleuthkit/autopsy/ingest/Bundle.properties | 8 ++++++++ .../autopsy/ingest/DataSourceIngestJob.java | 18 +++++++++--------- .../ingest/DataSourceIngestPipeline.java | 6 +++--- .../autopsy/ingest/FileIngestPipeline.java | 6 ++++-- .../sleuthkit/autopsy/ingest/IngestJob.java | 16 +++++++++------- .../autopsy/ingest/IngestJobSettings.java | 6 +++--- .../autopsy/ingest/IngestManager.java | 4 ++-- .../autopsy/ingest/IngestMonitor.java | 2 +- .../autopsy/ingest/RunIngestSubMenu.java | 2 +- .../ingest/events/BlackboardPostEvent.java | 2 +- .../ingest/events/ContentChangedEvent.java | 2 +- .../ingest/events/DataSourceAnalysisEvent.java | 2 +- .../ingest/events/FileAnalyzedEvent.java | 2 +- 13 files changed, 44 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 309fbab41b..ba1e445d8a 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -109,3 +109,11 @@ IngestManager.cancellingIngest.msgDlg.text=Cancelling all currently running inge IngestManager.serviceIsDown.msgDlg.text={0} is down RunIngestSubMenu.menuItem.empty=-Empty- RunIngestModulesMenu.getName.text=Run Ingest Modules +DataSourceIngestPipeline.moduleError.title.text={0} Error +FileIngestPipeline.moduleError.title.text={0} Error +IngestJob.cancelReason.notCancelled.text=Not cancelled +IngestJob.cancelReason.cancelledByUser.text=Cancelled by user +IngestJob.cancelReason.ingestModStartFail.text=Ingest modules startup failed +IngestJob.cancelReason.outOfDiskSpace.text=Out of disk space +IngestJob.cancelReason.servicesDown.text=Not cancelled +IngestJob.cancelReason.caseClosed.text=Case closed diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java index a84f262988..2004674df7 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java @@ -360,10 +360,10 @@ final class DataSourceIngestJob { List errors = startUpIngestPipelines(); if (errors.isEmpty()) { if (this.hasFirstStageDataSourceIngestPipeline() || this.hasFileIngestPipeline()) { - logger.log(Level.INFO, "Starting first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Starting first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.startFirstStage(); } else if (this.hasSecondStageDataSourceIngestPipeline()) { - logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1}), no first stage configured", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1}), no first stage configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.startSecondStage(); } } @@ -450,13 +450,13 @@ final class DataSourceIngestJob { * Schedule the first stage tasks. */ if (this.hasFirstStageDataSourceIngestPipeline() && this.hasFileIngestPipeline()) { - logger.log(Level.INFO, "Scheduling first stage data source and file level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling first stage data source and file level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleIngestTasks(this); } else if (this.hasFirstStageDataSourceIngestPipeline()) { - logger.log(Level.INFO, "Scheduling first stage data source level analysis tasks for {0} (jobId={1}), no file level analysis configured", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling first stage data source level analysis tasks for {0} (jobId={1}), no file level analysis configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleDataSourceIngestTask(this); } else { - logger.log(Level.INFO, "Scheduling file level analysis tasks for {0} (jobId={1}), no first stage data source level analysis configured", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling file level analysis tasks for {0} (jobId={1}), no first stage data source level analysis configured", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleFileIngestTasks(this); /** @@ -475,7 +475,7 @@ final class DataSourceIngestJob { * Starts the second stage of this ingest job. */ private void startSecondStage() { - logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Starting second stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.stage = DataSourceIngestJob.Stages.SECOND; if (this.doUI) { this.startDataSourceIngestProgressBar(); @@ -483,7 +483,7 @@ final class DataSourceIngestJob { synchronized (this.dataSourceIngestPipelineLock) { this.currentDataSourceIngestPipeline = this.secondStageDataSourceIngestPipeline; } - logger.log(Level.INFO, "Scheduling second stage data source level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Scheduling second stage data source level analysis tasks for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS DataSourceIngestJob.taskScheduler.scheduleDataSourceIngestTask(this); } @@ -572,7 +572,7 @@ final class DataSourceIngestJob { * job and starts the second stage, if appropriate. */ private void finishFirstStage() { - logger.log(Level.INFO, "Finished first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Finished first stage analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS // Shut down the file ingest pipelines. Note that no shut down is // required for the data source ingest pipeline because data source @@ -622,7 +622,7 @@ final class DataSourceIngestJob { * Shuts down the ingest pipelines and progress bars for this job. */ private void finish() { - logger.log(Level.INFO, "Finished analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); + logger.log(Level.INFO, "Finished analysis for {0} (jobId={1})", new Object[]{dataSource.getName(), this.id}); //NON-NLS this.stage = DataSourceIngestJob.Stages.FINALIZATION; if (this.doUI) { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java index c10d1436d2..4c27c201d5 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java @@ -109,9 +109,9 @@ final class DataSourceIngestPipeline { this.job.updateDataSourceIngestProgressBarDisplayName(displayName); this.job.switchDataSourceIngestProgressBarToIndeterminate(); DataSourceIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName()); - logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) starting", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); + logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) starting", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); //NON-NLS module.process(dataSource, new DataSourceIngestModuleProgress(this.job)); - logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) finished", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); + logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) finished", new Object[]{module.getDisplayName(), this.job.getDataSource().getName(), this.job.getDataSource().getId()}); //NON-NLS } catch (Throwable ex) { // Catch-all exception firewall errors.add(new IngestModuleError(module.getDisplayName(), ex)); String msg = ex.getMessage(); @@ -119,7 +119,7 @@ final class DataSourceIngestPipeline { if (msg == null) { msg = ex.toString(); } - MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg); + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "DataSourceIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } if (this.job.isCancelled()) { break; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 251e0bbf08..9f1cc0aaa5 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -21,6 +21,8 @@ package org.sleuthkit.autopsy.ingest; import java.util.ArrayList; import java.util.Date; import java.util.List; + +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.datamodel.AbstractFile; @@ -128,7 +130,7 @@ final class FileIngestPipeline { if (msg == null) { msg = ex.toString(); } - MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg); + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "FileIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } if (this.job.isCancelled()) { break; @@ -161,7 +163,7 @@ final class FileIngestPipeline { if (msg == null) { msg = ex.toString(); } - MessageNotifyUtil.Notify.error(module.getDisplayName() + " Error", msg); + MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "FileIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java index 0958eb8d5f..14c0f12430 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java @@ -27,6 +27,8 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; + +import org.openide.util.NbBundle; import org.sleuthkit.datamodel.Content; /** @@ -42,12 +44,12 @@ public final class IngestJob { */ public enum CancellationReason { - NOT_CANCELLED("Not cancelled"), - USER_CANCELLED("Cancelled by user"), - INGEST_MODULES_STARTUP_FAILED("Ingest modules startup failed"), - OUT_OF_DISK_SPACE("Out of disk space"), - SERVICES_DOWN("Not cancelled"), - CASE_CLOSED("Case closed"); + NOT_CANCELLED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.notCancelled.text")), + USER_CANCELLED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.cancelledByUser.text")), + INGEST_MODULES_STARTUP_FAILED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.ingestModStartFail.text")), + OUT_OF_DISK_SPACE(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.outOfDiskSpace.text")), + SERVICES_DOWN(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.servicesDown.text")), + CASE_CLOSED(NbBundle.getMessage(IngestJob.class, "IngestJob.cancelReason.caseClosed.text")); private final String displayName; @@ -128,7 +130,7 @@ public final class IngestJob { synchronized List start() { List errors = new ArrayList<>(); if (started) { - errors.add(new IngestModuleError("IngestJob", new IllegalStateException("Job already started"))); + errors.add(new IngestModuleError("IngestJob", new IllegalStateException("Job already started"))); //NON-NLS return errors; } started = true; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java index 98a307d544..de15f82949 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java @@ -55,7 +55,7 @@ public class IngestJobSettings { private final String executionContext; private final IngestType ingestType; private String moduleSettingsFolderPath; - private static final CharSequence pythonModuleSettingsPrefixCS = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); + private static final CharSequence pythonModuleSettingsPrefixCS = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); //NON-NLS private final List moduleTemplates; private boolean processUnallocatedSpace; private final List warnings; @@ -337,7 +337,7 @@ public class IngestJobSettings { moduleNames.add("E01 Verifier"); //NON-NLS break; case "Archive Extractor": //NON-NLS - moduleNames.add("Embedded File Extractor"); + moduleNames.add("Embedded File Extractor"); //NON-NLS break; default: moduleNames.add(name); @@ -454,7 +454,7 @@ public class IngestJobSettings { if (isPythonModuleSettingsFile(moduleSettingsFilePath)) { // compiled python modules have variable instance number as a part of their file name. // This block of code gets rid of that variable instance number and helps maitains constant module name over multiple runs. - moduleSettingsFilePath = moduleSettingsFilePath.replaceAll("[$][\\d]+.settings$", "\\$.settings"); + moduleSettingsFilePath = moduleSettingsFilePath.replaceAll("[$][\\d]+.settings$", "\\$.settings"); //NON-NLS NON-NLS } try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(moduleSettingsFilePath))) { out.writeObject(settings); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 926ad71d78..f528cba6e6 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -106,8 +106,8 @@ public class IngestManager { private int numberOfFileIngestThreads; private final ExecutorService fileIngestThreadPool; - private static final String JOB_EVENT_CHANNEL_NAME = "%s-Ingest-Job-Events"; - private static final String MODULE_EVENT_CHANNEL_NAME = "%s-Ingest-Module-Events"; + private static final String JOB_EVENT_CHANNEL_NAME = "%s-Ingest-Job-Events"; //NON-NLS + private static final String MODULE_EVENT_CHANNEL_NAME = "%s-Ingest-Module-Events"; //NON-NLS private static final Set jobEventNames = Stream.of(IngestJobEvent.values()) .map(IngestJobEvent::toString) .collect(Collectors.toSet()); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index 1a895d9b92..f1cad5531c 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -64,7 +64,7 @@ public final class IngestMonitor { MONITOR_LOGGER.setUseParentHandlers(false); MONITOR_LOGGER.addHandler(monitorLogHandler); } catch (IOException | SecurityException ex) { - logger.log(Level.SEVERE, "Failed to create memory usage logger", ex); + logger.log(Level.SEVERE, "Failed to create memory usage logger", ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java index f4db5d47e8..a0472a8f7c 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java @@ -52,7 +52,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent { // No open Cases, create a disabled empty menu return getEmpty(); } catch (TskCoreException e) { - System.out.println("Exception getting images: " + e.getMessage()); + System.out.println("Exception getting images: " + e.getMessage()); //NON-NLS } JComponent[] comps = new JComponent[images.size()]; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java index a63b3893e9..f793e33e07 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java @@ -99,7 +99,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null); return eventData; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java index 3ff37f4be1..7370d90586 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java @@ -89,7 +89,7 @@ public final class ContentChangedEvent extends AutopsyEvent implements Serializa eventData = new ModuleContentEvent(data.moduleName, content); return eventData; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java index f401285044..c508d3e276 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java @@ -99,7 +99,7 @@ public abstract class DataSourceAnalysisEvent extends AutopsyEvent implements Se dataSource = Case.getCurrentCase().getSleuthkitCase().getContentById(id); return dataSource; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java index ca629bf261..afc8c0a996 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java @@ -79,7 +79,7 @@ public final class FileAnalyzedEvent extends AutopsyEvent implements Serializabl file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(id); return file; } catch (IllegalStateException | TskCoreException ex) { - logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); + logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS return null; } }