Extracted strings. Commented strings with NON-NLS.

This commit is contained in:
Nick Davis 2016-01-28 21:03:05 -05:00
parent 23a6618bb2
commit adfa7d3080
13 changed files with 44 additions and 32 deletions

View File

@ -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

View File

@ -360,10 +360,10 @@ final class DataSourceIngestJob {
List<IngestModuleError> 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) {

View File

@ -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;

View File

@ -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);
}
}
}

View File

@ -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<IngestModuleError> start() {
List<IngestModuleError> 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;

View File

@ -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<IngestModuleTemplate> moduleTemplates;
private boolean processUnallocatedSpace;
private final List<String> 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);

View File

@ -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<String> jobEventNames = Stream.of(IngestJobEvent.values())
.map(IngestJobEvent::toString)
.collect(Collectors.toSet());

View File

@ -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
}
}

View File

@ -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()];

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}