Merge remote-tracking branch 'origin/pr/524' into develop

This commit is contained in:
Jason Letourneau 2014-03-07 10:28:28 -05:00
commit 2667b6aaee
14 changed files with 270 additions and 108 deletions

View File

@ -1,21 +1,6 @@
OpenIDE-Module-Name=Ingest
CTL_IngestAction=Ingest
CTL_IngestMessagesAction=Ingest Messages
CTL_IngestMessageTopComponent=Messages
CTL_IngestTopComponent=Ingest
HINT_IngestMessageTopComponent=Messages windows
HINT_IngestTopComponent=Ingest window
IngestTopComponent.messageFrame.title=Messages
IngestTopComponent.ingestProgressLabel.text=File Ingest Progress
IngestControlPanel.topLable.text=Image ingest modules
IngestControlPanel.startButton.text=Start
IngestDialogPanel.ingestServicesLabel.text=Image Ingest Modules
IngestDialogForm2.okButton.text=OK
IngestDialogForm2.cancelButton.text=Cancel
IngestDialogForm.cancelButton.text=Cancel
IngestDialogForm.startButton.text=Start
IngestDialogForm.jLabel1.text=Ingest Modules
IngestTopComponent.refreshFreqLabel.text=Refresh frequency
IngestMessageDetailsPanel.backButton.text=
IngestMessageDetailsPanel.viewArtifactButton.text=Go to Result
IngestMessageDetailsPanel.viewContentButton.text=Go to Directory
@ -34,3 +19,86 @@ IngestMessagePanel.totalUniqueMessagesNameLabel.text=Unique:
IngestMessagePanel.totalUniqueMessagesNameVal.text=-
IngestDialogPanel.processUnallocCheckbox.text=Process Unallocated Space
IngestDialogPanel.processUnallocCheckbox.toolTipText=Processes unallocated space, such as deleted files. Produces more complete results, but it may take longer to process on large images.
DataSourceTask.toString.text=ScheduledTask'{'input\={0}, modules\={1}'}'
GeneralIngestConfigurator.modName.tbirdParser.text=Thunderbird Parser
GeneralIngestConfigurator.modName.mboxParser.text=MBox Parser
GeneralIngestConfigurator.modName.emailParser.text=Email Parser
GeneralIngestConfigurator.enabledMods.notFound.msg={0} was previously enabled, but could not be found
IngestDataSourceThread.displayName.text={0} dataSource id\:{1}
IngestDataSourceThread.progress.pending={0} (Pending...)
IngestDataSourceThread.progress.cancelling={0} (Cancelling...)
IngestDialog.title.text=Ingest Modules
IngestDialog.startButton.title=Start
IngestDialog.closeButton.title=Close
IngestManager.moduleProperties.text=ingest
IngestManager.moduleErr=Module Error
IngestManager.moduleErr.errListenToUpdates.msg=A module caused an error listening to Ingest Manager updates. See log to determine which module. Some data could be incomplete.
IngestManager.displayInitError.failedToLoad.msg=Failed to load {0} ingest module.\
\
No ingest modules will be run. Please disable the module or fix the error and restart ingest by right clicking on the data source and selecting Run Ingest Modules.\
\
Error\: {1}
IngestManager.getFileModStats.moduleInfo.text={0} took\: {1} secs. to process()\
IngestManager.toString.startTime.text=Start time\: {0}{1}
IngestManager.toString.endTime.text=End time\: {0}{1}
IngestManager.toString.totalIngestTime.text=Total ingest time\: {0}{1}
IngestManager.toString.totalErrs.text=Total errors\: {0}{1}
IngestManager.toString.errsPerMod.text=Errors per module\:
IngestManager.toHtmlStr.ingestTime.text=Ingest time\: {0}
IngestManager.toHtmlStr.totalErrs.text=Total errors\: {0}
IngestManager.toHtmlStr.module.text=Module
IngestManager.toHtmlStr.time.text=Time
IngestManager.toHtmlStr.errors.text=Errors
IngestManager.IngestAbstractFileProcessor.displayName=File Ingest
IngestManager.IngestAbstractFileProcessor.process.cancelling={0} (Cancelling...)
IngestManager.EnqueueWorker.displayName.text=Queueing Ingest
IngestManager.EnqueueWorker.process.cancelling={0} (Cancelling...)
IngestManager.datatSourceIngest.progress.text=DataSource Ingest {0}
IngestManager.fileIngest.progress.text=File Ingest {0}
IngestMessage.toString.type.text=type\: {0}
IngestMessage.toString.source.text=\ source\: {0}
IngestMessage.toString.date.text=\ date\: {0}
IngestMessage.toString.subject.text=\ subject\: {0}
IngestMessage.toString.details.text=\ details\: {0}
IngestMessage.toString.data.text=\ data\: {0}
IngestMessage.exception.typeSrcSubjNotNull.msg=message type, source and subject cannot be null
IngestMessage.exception.srcSubjNotNull.msg=source and subject cannot be null
IngestMessage.exception.srcSubjDetailsDataNotNull.msg=source, subject, details and data cannot be null
IngestMessagePanel.moduleErr=Module Error
IngestMessagePanel.moduleErr.errListenUpdates.text=A module caused an error listening to IngestMessagePanel updates. See log to determine which module. Some data could be incomplete.
IngestMessagePanel.MsgTableMod.colNames.module=Module
IngestMessagePanel.MsgTableMod.colNames.num=Num
IngestMessagePanel.MsgTableMod.colNames.new=New?
IngestMessagePanel.MsgTableMod.colNames.subject=Subject
IngestMessagePanel.MsgTableMod.colNames.timestamp=Timestamp
IngestMessagePanel.BooleanRenderer.exception.nonBoolVal.msg=Tried to use BooleanRenderer on non-boolean value.
IngestMessagePanel.DateRenderer.exception.nonDateVal.text=Tried to use DateRenderer on non-Date value.
IngestMessageTopComponent.displayReport.option.OK=OK
IngestMessageTopComponent.displayReport.option.GenRpt=Generate Report
IngestMessageTopComponent.msgDlg.ingestRpt.text=Ingest Report
IngestModuleLoader.moduleErr=Module Error
IngestModuleLoader.moduleErr.errListenUpdates.msg=A module caused an error listening to IngestModuleLoader updates. See log to determine which module. Some data could be incomplete.
IngestModuleLoader.exception.notImplemented.msg=Not yet implemented
IngestModuleLoader.exception.cantFindPipeline.msg=Could not find expected pipeline of type\: {0}, cannot add autodiscovered module\: {1}
IngestModuleLoader.save.comment.text=Saved by\: {0} on\: {1}
IngestModuleLoader.loadRawPipeline.exception.cantLoadXML.msg=Could not load pipeline config XML\: {0}
IngestModuleLoader.loadRawPipeline.exception.invalidFileFormat.msg=Error loading pipeline configuration\: invalid file format.
IngestModuleLoader.loadRawPipeline.exception.noPipelinesInConf.msg=No pipelines found in the pipeline configuration\: {0}
IngestModuleLoader.exception.noPipelineTypeForStr.msg=No PIPELINE_TYPE for string\: {0}
IngestMonitor.mgrErrMsg.lowDiskSpace.title=Ingest stopped - low disk space on {0}
IngestMonitor.mgrErrMsg.lowDiskSpace.msg=Stopping ingest due to low disk space on disk {0}. \
Ensure the Case drive has at least 1GB free space and restart ingest.
IngestScheduler.FileSched.toString.rootDirs.text=\
RootDirs(sorted), size\: {0}
IngestScheduler.FileSched.toString.curDirs.text=\
CurDirs(stack), size\: {0}
IngestScheduler.FileSched.toString.curFiles.text=\
CurFiles, size\: {0}
IngestScheduler.fileTask.toString.long=ProcessTask'{'file\={0}\: {1}'}'
IngestScheduler.fileTask.toString.short=ProcessTask'{'file\={0}\: {1}'}'
IngestScheduler.FileTask.next.exception.msg=No next ProcessTask, check hasNext() first\!
IngestScheduler.remove.exception.notSupported.msg=Not supported.
IngestScheduler.DataSourceScheduler.exception.next.msg=There is no data source tasks in the queue, check hasNext()
IngestScheduler.DataSourceScheduler.exception.remove.msg=Removing of scheduled data source ingest tasks is not supported.
IngestScheduler.DataSourceScheduler.toString.size=DataSourceQueue, size\: {0}
PipelineContext.toString.text=pipelineContext'{'task\={0}'}'

View File

@ -20,6 +20,8 @@
package org.sleuthkit.autopsy.ingest;
import java.util.List;
import org.openide.util.NbBundle;
import org.sleuthkit.datamodel.Content;
/**
@ -72,7 +74,7 @@ class DataSourceTask<T extends IngestModuleAbstract> {
@Override
public String toString() {
return "ScheduledTask{" + "input=" + input + ", modules=" + modules + '}';
return NbBundle.getMessage(this.getClass(), "DataSourceTask.toString.text", input, modules);
}
/**

View File

@ -22,6 +22,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.datamodel.Content;
@ -104,9 +106,11 @@ public class GeneralIngestConfigurator implements IngestConfigurator {
// the UI component.
List<IngestModuleAbstract> enabledModules = new ArrayList<>();
for (String moduleName : enabledList) {
if (moduleName.equals("Thunderbird Parser")
|| moduleName.equals("MBox Parser")) {
moduleName = "Email Parser";
if (moduleName.equals(
NbBundle.getMessage(this.getClass(), "GeneralIngestConfigurator.modName.tbirdParser.text"))
|| moduleName.equals(
NbBundle.getMessage(this.getClass(), "GeneralIngestConfigurator.modName.mboxParser.text"))) {
moduleName = NbBundle.getMessage(this.getClass(), "GeneralIngestConfigurator.modName.emailParser.text");
}
IngestModuleAbstract moduleFound = null;
@ -120,7 +124,8 @@ public class GeneralIngestConfigurator implements IngestConfigurator {
enabledModules.add(moduleFound);
}
else {
messages.add(moduleName + " was previously enabled, but could not be found");
messages.add(NbBundle.getMessage(this.getClass(), "GeneralIngestConfigurator.enabledMods.notFound.msg",
moduleName));
}
}
ingestDialogPanel.setEnabledIngestModules(enabledModules);

View File

@ -23,6 +23,8 @@ import java.awt.EventQueue;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle;
@ -95,13 +97,17 @@ import org.sleuthkit.datamodel.Content;
logger.log(Level.INFO, "Pending module: " + module.getName());
final String displayName = module.getName() + " dataSource id:" + dataSource.getId();
progress = ProgressHandleFactory.createHandle(displayName + " (Pending...)", new Cancellable() {
final String displayName = NbBundle.getMessage(this.getClass(), "IngestDataSourceThread.displayName.text",
module.getName(),
dataSource.getId());
progress = ProgressHandleFactory.createHandle(
NbBundle.getMessage(this.getClass(), "IngestDataSourceThread.progress.pending", displayName), new Cancellable() {
@Override
public boolean cancel() {
logger.log(Level.INFO, "DataSource ingest module " + module.getName() + " cancelled by user.");
if (progress != null) {
progress.setDisplayName(displayName + " (Cancelling...)");
progress.setDisplayName(
NbBundle.getMessage(this.getClass(), "IngestDataSourceThread.progress.cancelling", displayName));
}
return IngestDataSourceThread.this.cancel(true);
}

View File

@ -32,6 +32,8 @@ import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.sleuthkit.datamodel.Content;
/**
@ -40,7 +42,7 @@ import org.sleuthkit.datamodel.Content;
*/
public class IngestDialog extends JDialog {
private static final String TITLE = "Ingest Modules";
private static final String TITLE = NbBundle.getMessage(IngestDialog.class, "IngestDialog.title.text");
private static Dimension DIMENSIONS = new Dimension(500, 300);
private IngestConfigurator ingestConfigurator;
@ -77,8 +79,8 @@ public class IngestDialog extends JDialog {
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
add(ingestConfigurator.getIngestConfigPanel(), BorderLayout.PAGE_START);
JButton startButton = new JButton("Start");
JButton closeButton = new JButton("Close");
JButton startButton = new JButton(NbBundle.getMessage(this.getClass(), "IngestDialog.startButton.title"));
JButton closeButton = new JButton(NbBundle.getMessage(this.getClass(), "IngestDialog.closeButton.title"));
startButton.addActionListener(new ActionListener() {
@Override

View File

@ -32,6 +32,8 @@ import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle;
@ -77,7 +79,8 @@ public class IngestManager {
//module loader
private IngestModuleLoader moduleLoader = null;
//property file name id for the module
public final static String MODULE_PROPERTIES = "ingest";
public final static String MODULE_PROPERTIES = NbBundle.getMessage(IngestManager.class,
"IngestManager.moduleProperties.text");
private volatile int messageID = 0;
/**
@ -212,7 +215,9 @@ public class IngestManager {
}
catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to Ingest Manager updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -227,7 +232,9 @@ public class IngestManager {
}
catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to Ingest Manager updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -242,7 +249,9 @@ public class IngestManager {
}
catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to Ingest Manager updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -256,7 +265,9 @@ public class IngestManager {
}
catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to Ingest Manager updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -495,11 +506,8 @@ public class IngestManager {
*/
private void displayInitError(String moduleName, String errorMessage) {
MessageNotifyUtil.Message.error(
"Failed to load " + moduleName + " ingest module.\n\n"
+ "No ingest modules will be run. Please disable the module "
+ "or fix the error and restart ingest by right clicking on "
+ "the data source and selecting Run Ingest Modules.\n\n"
+ "Error: " + errorMessage);
NbBundle.getMessage(this.getClass(), "IngestManager.displayInitError.failedToLoad.msg", moduleName,
errorMessage));
}
/**
@ -856,9 +864,9 @@ public class IngestManager {
String getFileModuleStats() {
StringBuilder sb = new StringBuilder();
for (final String moduleName : fileModuleTimers.keySet()) {
sb.append(moduleName).append(" took: ")
.append(fileModuleTimers.get(moduleName) / 1000)
.append(" secs. to process()").append('\n');
sb.append(NbBundle.getMessage(this.getClass(),
"IngestManager.getFileModStats.moduleInfo.text",
moduleName, fileModuleTimers.get(moduleName) / 1000));
}
return sb.toString();
}
@ -868,15 +876,18 @@ public class IngestManager {
final String EOL = System.getProperty("line.separator");
StringBuilder sb = new StringBuilder();
if (startTime != null) {
sb.append("Start time: ").append(dateFormatter.format(startTime)).append(EOL);
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toString.startTime.text",
dateFormatter.format(startTime), EOL));
}
if (endTime != null) {
sb.append("End time: ").append(dateFormatter.format(endTime)).append(EOL);
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toString.endTime.text",
dateFormatter.format(endTime), EOL));
}
sb.append("Total ingest time: ").append(getTotalTimeString()).append(EOL);
sb.append("Total errors: ").append(errorsTotal).append(EOL);
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toString.totalIngestTime.text",
getTotalTimeString(), EOL));
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toString.totalErrs.text", errorsTotal, EOL));
if (errorsTotal > 0) {
sb.append("Errors per module:");
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toString.errsPerMod.text"));
for (String moduleName : errors.keySet()) {
sb.append("\t").append(moduleName).append(": ").append(errors.get(moduleName)).append(EOL);
}
@ -887,9 +898,18 @@ public class IngestManager {
public String toHtmlString() {
StringBuilder sb = new StringBuilder();
sb.append("<html><body>");
sb.append("Ingest time: ").append(getTotalTimeString()).append("<br />");
sb.append("Total errors: ").append(errorsTotal).append("<br />");
sb.append("<table><tr><th>Module</th><th>Time</th><th>Errors</th></tr>\n");
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toHtmlStr.ingestTime.text",
getTotalTimeString()))
.append("<br />");
sb.append(NbBundle.getMessage(this.getClass(), "IngestManager.toHtmlStr.totalErrs.text", errorsTotal))
.append("<br />");
sb.append("<table><tr><th>")
.append(NbBundle.getMessage(this.getClass(), "IngestManager.toHtmlStr.module.text"))
.append("</th><th>")
.append(NbBundle.getMessage(this.getClass(), "IngestManager.toHtmlStr.time.text"))
.append("</th><th>")
.append(NbBundle.getMessage(this.getClass(), "IngestManager.toHtmlStr.errors.text"))
.append("</th></tr>\n");
for (final String moduleName : fileModuleTimers.keySet()) {
sb.append("<tr><td>").append(moduleName).append("</td><td>");
@ -993,13 +1013,16 @@ public class IngestManager {
IngestManager.fireModuleEvent(IngestModuleEvent.STARTED.toString(), s.getName());
}
final String displayName = "File Ingest";
final String displayName = NbBundle
.getMessage(this.getClass(), "IngestManager.IngestAbstractFileProcessor.displayName");
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
@Override
public boolean cancel() {
logger.log(Level.INFO, "Filed ingest cancelled by user.");
if (progress != null) {
progress.setDisplayName(displayName + " (Cancelling...)");
progress.setDisplayName(NbBundle.getMessage(this.getClass(),
"IngestManager.IngestAbstractFileProcessor.process.cancelling",
displayName));
}
return IngestAbstractFileProcessor.this.cancel(true);
}
@ -1169,13 +1192,16 @@ public class IngestManager {
@Override
protected Object doInBackground() throws Exception {
final String displayName = "Queueing Ingest";
final String displayName = NbBundle
.getMessage(this.getClass(), "IngestManager.EnqueueWorker.displayName.text");
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
@Override
public boolean cancel() {
logger.log(Level.INFO, "Queueing ingest cancelled by user.");
if (progress != null) {
progress.setDisplayName(displayName + " (Cancelling...)");
progress.setDisplayName(
NbBundle.getMessage(this.getClass(), "IngestManager.EnqueueWorker.process.cancelling",
displayName));
}
return EnqueueWorker.this.cancel(true);
}
@ -1274,10 +1300,12 @@ public class IngestManager {
logger.log(Level.INFO, "Queing data source ingest task: " + dataSourceTask);
progress.progress("DataSource Ingest" + " " + inputName, processed);
progress.progress(NbBundle.getMessage(this.getClass(), "IngestManager.datatSourceIngest.progress.text",
inputName), processed);
final IngestScheduler.DataSourceScheduler dataSourceScheduler = scheduler.getDataSourceScheduler();
dataSourceScheduler.schedule(dataSourceTask);
progress.progress("DataSource Ingest" + " " + inputName, ++processed);
progress.progress(NbBundle.getMessage(this.getClass(), "IngestManager.datatSourceIngest.progress.text",
inputName), ++processed);
/* Schedule the file-level ingest modules for the children of the data source */
@ -1285,10 +1313,12 @@ public class IngestManager {
new DataSourceTask(input, fileMods, getProcessUnallocSpace());
logger.log(Level.INFO, "Queing file ingest task: " + fTask);
progress.progress("File Ingest" + " " + inputName, processed);
progress.progress(
NbBundle.getMessage(this.getClass(), "IngestManager.fileIngest.progress.text", inputName), processed);
final IngestScheduler.FileScheduler fileScheduler = scheduler.getFileScheduler();
fileScheduler.schedule(fTask);
progress.progress("File Ingest" + " " + inputName, ++processed);
progress.progress(
NbBundle.getMessage(this.getClass(), "IngestManager.fileIngest.progress.text", inputName), ++processed);
} //for data sources
}

View File

@ -20,7 +20,8 @@ package org.sleuthkit.autopsy.ingest;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.sleuthkit.autopsy.datamodel.KeyValue;
import org.openide.util.NbBundle;
import org.sleuthkit.datamodel.BlackboardArtifact;
/**
@ -101,18 +102,19 @@ public class IngestMessage {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Long.toString(ID)).append(": ");
sb.append("type: ").append(messageType.name());
sb.append(NbBundle.getMessage(this.getClass(), "IngestMessage.toString.type.text", messageType.name()));
if (source != null) //can be null for manager messages
{
sb.append(" source: ").append(source.getName());
sb.append(NbBundle.getMessage(this.getClass(), "IngestMessage.toString.source.text", source.getName()));
}
sb.append(" date: ").append(dateFormat.format(datePosted));
sb.append(" subject: ").append(subject);
sb.append(
NbBundle.getMessage(this.getClass(), "IngestMessage.toString.date.text", dateFormat.format(datePosted)));
sb.append(NbBundle.getMessage(this.getClass(), "IngestMessage.toString.subject.text", subject));
if (detailsHtml != null) {
sb.append(" details: ").append(detailsHtml);
sb.append(NbBundle.getMessage(this.getClass(), "IngestMessage.toString.details.text", detailsHtml));
}
if (data != null) {
sb.append(" data: ").append(data.toString()).append(' ');
sb.append(NbBundle.getMessage(this.getClass(), "IngestMessage.toString.data.text", data.toString()));
}
return sb.toString();
}
@ -176,7 +178,8 @@ public class IngestMessage {
*/
public static IngestMessage createMessage(long ID, MessageType messageType, IngestModuleAbstract source, String subject, String detailsHtml) {
if (messageType == null || source == null || subject == null) {
throw new IllegalArgumentException("message type, source and subject cannot be null");
throw new IllegalArgumentException(
NbBundle.getMessage(IngestMessage.class, "IngestMessage.exception.typeSrcSubjNotNull.msg"));
}
return new IngestMessage(ID, messageType, source, subject, detailsHtml, null);
}
@ -204,7 +207,8 @@ public class IngestMessage {
*/
public static IngestMessage createErrorMessage(long ID, IngestModuleAbstract source, String subject, String detailsHtml) {
if (source == null || subject == null) {
throw new IllegalArgumentException("source and subject cannot be null");
throw new IllegalArgumentException(
NbBundle.getMessage(IngestMessage.class, "IngestMessage.exception.srcSubjNotNull.msg"));
}
return new IngestMessage(ID, MessageType.ERROR, source, subject, detailsHtml, null);
}
@ -219,7 +223,8 @@ public class IngestMessage {
*/
public static IngestMessage createWarningMessage(long ID, IngestModuleAbstract source, String subject, String detailsHtml) {
if (source == null || subject == null) {
throw new IllegalArgumentException("source and subject cannot be null");
throw new IllegalArgumentException(
NbBundle.getMessage(IngestMessage.class, "IngestMessage.exception.srcSubjNotNull.msg"));
}
return new IngestMessage(ID, MessageType.WARNING, source, subject, detailsHtml, null);
}
@ -236,7 +241,8 @@ public class IngestMessage {
*/
public static IngestMessage createDataMessage(long ID, IngestModuleAbstract source, String subject, String detailsHtml, String uniqueKey, BlackboardArtifact data) {
if (source == null || subject == null || detailsHtml == null || data == null) {
throw new IllegalArgumentException("source, subject, details and data cannot be null");
throw new IllegalArgumentException(
NbBundle.getMessage(IngestMessage.class, "IngestMessage.exception.srcSubjDetailsDataNotNull.msg"));
}
IngestMessage im = new IngestMessage(ID, MessageType.DATA, source, subject, detailsHtml, uniqueKey);

View File

@ -38,6 +38,8 @@ import java.util.Map;
import java.util.logging.Level;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
@ -52,8 +54,6 @@ import javax.swing.table.TableCellRenderer;
import org.sleuthkit.autopsy.ingest.IngestMessage.*;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Notification window showing messages from modules to user
@ -300,7 +300,10 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
}
catch (Exception e) {
logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to IngestMessagePanel updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"),
NbBundle.getMessage(this.getClass(),
"IngestMessagePanel.moduleErr.errListenUpdates.text"),
MessageNotifyUtil.MessageType.ERROR);
}
//update labels
@ -325,7 +328,10 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
}
catch (Exception e) {
logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to IngestMessagePanel updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"),
NbBundle.getMessage(this.getClass(),
"IngestMessagePanel.moduleErr.errListenUpdates.text"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -344,7 +350,10 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
}
catch (Exception e) {
logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to IngestMessagePanel updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"),
NbBundle.getMessage(this.getClass(),
"IngestMessagePanel.moduleErr.errListenUpdates.text"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -357,13 +366,21 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
}
catch (Exception ee) {
logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", ee);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to IngestMessagePanel updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"),
NbBundle.getMessage(this.getClass(),
"IngestMessagePanel.moduleErr.errListenUpdates.text"),
MessageNotifyUtil.MessageType.ERROR);
}
}
private class MessageTableModel extends AbstractTableModel {
private String[] columnNames = new String[]{"Module", "Num", "New?", "Subject", "Timestamp"};
private String[] columnNames = new String[]{
NbBundle.getMessage(this.getClass(), "IngestMessagePanel.MsgTableMod.colNames.module"),
NbBundle.getMessage(this.getClass(), "IngestMessagePanel.MsgTableMod.colNames.num"),
NbBundle.getMessage(this.getClass(), "IngestMessagePanel.MsgTableMod.colNames.new"),
NbBundle.getMessage(this.getClass(), "IngestMessagePanel.MsgTableMod.colNames.subject"),
NbBundle.getMessage(this.getClass(), "IngestMessagePanel.MsgTableMod.colNames.timestamp")};
private List<TableEntry> messageData = new ArrayList<TableEntry>();
//for keeping track of messages to group, per module, by uniqness
private Map<IngestModuleAbstract, Map<String, List<IngestMessageGroup>>> groupings = new HashMap<IngestModuleAbstract, Map<String, List<IngestMessageGroup>>>();
@ -845,7 +862,8 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
if (value instanceof Boolean) {
boolVal = ((Boolean)value).booleanValue();
} else {
throw new RuntimeException("Tried to use BooleanRenderer on non-boolean value.");
throw new RuntimeException(NbBundle.getMessage(this.getClass(),
"IngestMessagePanel.BooleanRenderer.exception.nonBoolVal.msg"));
}
String aValue = boolVal ? bulletChar : "";
@ -928,7 +946,8 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
DateFormat df = new SimpleDateFormat("HH:mm:ss");
aValue = df.format(date);
} else {
throw new RuntimeException("Tried to use DateRenderer on non-Date value.");
throw new RuntimeException(NbBundle.getMessage(this.getClass(),
"IngestMessagePanel.DateRenderer.exception.nonDateVal.text"));
}
Component cell = super.getTableCellRendererComponent(table, aValue, isSelected, hasFocus, row, column);

View File

@ -249,11 +249,12 @@ import org.sleuthkit.datamodel.Content;
@Override
public void displayReport(String ingestReport) {
Object[] options = {"OK",
"Generate Report"};
Object[] options = {NbBundle.getMessage(this.getClass(), "IngestMessageTopComponent.displayReport.option.OK"),
NbBundle.getMessage(this.getClass(),
"IngestMessageTopComponent.displayReport.option.GenRpt")};
final int choice = JOptionPane.showOptionDialog(null,
ingestReport,
"Ingest Report",
NbBundle.getMessage(this.getClass(), "IngestMessageTopComponent.msgDlg.ingestRpt.text"),
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,

View File

@ -48,10 +48,7 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.openide.modules.ModuleInfo;
import org.openide.util.Exceptions;
import org.openide.util.Lookup;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;
import org.openide.util.*;
import org.reflections.Reflections;
import org.reflections.scanners.ResourcesScanner;
import org.reflections.scanners.SubTypesScanner;
@ -611,7 +608,10 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
}
catch (Exception e) {
logger.log(Level.SEVERE, "IngestModuleLoader listener threw exception", e);
MessageNotifyUtil.Notify.show("Module Error", "A module caused an error listening to IngestModuleLoader updates. See log to determine which module. Some data could be incomplete.", MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestModuleLoader.moduleErr"),
NbBundle.getMessage(this.getClass(),
"IngestModuleLoader.moduleErr.errListenUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR);
}
}
@ -633,7 +633,8 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
* @param newOrder new order to set
*/
void setModuleOrder(IngestModuleLoader.XmlPipelineRaw.PIPELINE_TYPE pipeLineType, String moduleLocation, int newOrder) throws IngestModuleLoaderException {
throw new IngestModuleLoaderException("Not yet implemented");
throw new IngestModuleLoaderException(
NbBundle.getMessage(this.getClass(), "IngestModuleLoader.exception.notImplemented.msg"));
}
/**
@ -665,7 +666,9 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
}
}
if (pipeline == null) {
throw new IngestModuleLoaderException("Could not find expected pipeline of type: " + pipelineType.toString() + ", cannot add autodiscovered module: " + moduleLocation);
throw new IngestModuleLoaderException(
NbBundle.getMessage(this.getClass(), "IngestModuleLoader.exception.cantFindPipeline.msg",
pipelineType.toString(), moduleLocation));
} else {
pipeline.modules.add(modRaw);
logger.log(Level.INFO, "Added a new module " + moduleClass.getName() + " to pipeline " + pipelineType.toString());
@ -706,8 +709,9 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
Document doc = docBuilder.newDocument();
Comment comment = doc.createComment("Saved by: " + getClass().getName()
+ " on: " + dateFormatter.format(System.currentTimeMillis()));
Comment comment = doc.createComment(
NbBundle.getMessage(this.getClass(), "IngestModuleLoader.save.comment.text", getClass().getName(),
dateFormatter.format(System.currentTimeMillis())));
doc.appendChild(comment);
Element rootEl = doc.createElement(IngestModuleLoader.XmlPipelineRaw.XML_PIPELINE_ROOT);
doc.appendChild(rootEl);
@ -885,18 +889,23 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
private void loadRawPipeline() throws IngestModuleLoaderException {
final Document doc = XMLUtil.loadDoc(IngestModuleLoader.class, absFilePath, XSDFILE);
if (doc == null) {
throw new IngestModuleLoaderException("Could not load pipeline config XML: " + this.absFilePath);
throw new IngestModuleLoaderException(
NbBundle.getMessage(this.getClass(), "IngestModuleLoader.loadRawPipeline.exception.cantLoadXML.msg",
this.absFilePath));
}
Element root = doc.getDocumentElement();
if (root == null) {
String msg = "Error loading pipeline configuration: invalid file format.";
String msg = NbBundle
.getMessage(this.getClass(), "IngestModuleLoader.loadRawPipeline.exception.invalidFileFormat.msg");
logger.log(Level.SEVERE, msg);
throw new IngestModuleLoaderException(msg);
}
NodeList pipelineNodes = root.getElementsByTagName(IngestModuleLoader.XmlPipelineRaw.XML_PIPELINE_EL);
int numPipelines = pipelineNodes.getLength();
if (numPipelines == 0) {
throw new IngestModuleLoaderException("No pipelines found in the pipeline configuration: " + absFilePath);
throw new IngestModuleLoaderException(NbBundle.getMessage(this.getClass(),
"IngestModuleLoader.loadRawPipeline.exception.noPipelinesInConf.msg",
absFilePath));
}
for (int pipelineNum = 0; pipelineNum < numPipelines; ++pipelineNum) {
//process pipelines
@ -1026,7 +1035,8 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
return types[i];
}
}
throw new IllegalArgumentException("No PIPELINE_TYPE for string: " + s);
throw new IllegalArgumentException(
NbBundle.getMessage(IngestModuleLoader.class, "IngestModuleLoader.exception.noPipelineTypeForStr.msg", s));
}
private static final String XML_PIPELINE_ROOT = "PIPELINE_CONFIG";
private static final String XML_PIPELINE_EL = "PIPELINE";

View File

@ -27,6 +27,8 @@ import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.SimpleFormatter;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.Timer;
import org.openide.util.Exceptions;
@ -164,9 +166,9 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
MONITOR_LOGGER.log(Level.SEVERE, "Stopping ingest due to low disk space on disk " + diskPath);
logger.log(Level.SEVERE, "Stopping ingest due to low disk space on disk " + diskPath);
manager.stopAll();
manager.postMessage(IngestMessage.createManagerErrorMessage("Ingest stopped - low disk space on " + diskPath,
"Stopping ingest due to low disk space on disk " + diskPath
+ ". \nEnsure the Case drive has at least 1GB free space and restart ingest."));
manager.postMessage(IngestMessage.createManagerErrorMessage(
NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.title", diskPath),
NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.msg", diskPath)));
}
}

View File

@ -31,8 +31,9 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.ingest.IngestScheduler.FileScheduler.FileTask;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.ContentVisitor;
@ -134,15 +135,18 @@ class IngestScheduler {
@Override
public synchronized String toString() {
StringBuilder sb = new StringBuilder();
sb.append("\nRootDirs(sorted), size: ").append(rootProcessTasks.size());
sb.append(NbBundle.getMessage(this.getClass(), "IngestScheduler.FileSched.toString.rootDirs.text",
rootProcessTasks.size()));
for (FileTask task : rootProcessTasks) {
sb.append(task.toString()).append(" ");
}
sb.append("\nCurDirs(stack), size: ").append(curDirProcessTasks.size());
sb.append(NbBundle.getMessage(this.getClass(), "IngestScheduler.FileSched.toString.curDirs.text",
curDirProcessTasks.size()));
for (FileTask task : curDirProcessTasks) {
sb.append(task.toString()).append(" ");
}
sb.append("\nCurFiles, size: ").append(curFileProcessTasks.size());
sb.append(NbBundle.getMessage(this.getClass(), "IngestScheduler.FileSched.toString.curFiles.text",
curFileProcessTasks.size()));
for (FileTask task : curFileProcessTasks) {
sb.append(task.toString()).append(" ");
}
@ -224,13 +228,13 @@ class IngestScheduler {
@Override
public String toString() {
try {
return "ProcessTask{" + "file=" + file.getId() + ": "
+ file.getUniquePath() + "}"; // + ", dataSourceTask=" + dataSourceTask + '}';
return NbBundle.getMessage(this.getClass(), "IngestScheduler.fileTask.toString.long", file.getId(),
file.getUniquePath()); // + ", dataSourceTask=" + dataSourceTask + '}';
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Cound not get unique path of file in queue, ", ex);
}
return "ProcessTask{" + "file=" + file.getId() + ": "
+ file.getName() + '}';
return NbBundle.getMessage(this.getClass(), "IngestScheduler.fileTask.toString.short", file.getId(),
file.getName());
}
/**
@ -432,7 +436,8 @@ class IngestScheduler {
@Override
public synchronized FileTask next() {
if (!hasNext()) {
throw new IllegalStateException("No next ProcessTask, check hasNext() first!");
throw new IllegalStateException(
NbBundle.getMessage(this.getClass(), "IngestScheduler.FileTask.next.exception.msg"));
}
//dequeue the last in the list
@ -502,7 +507,8 @@ class IngestScheduler {
@Override
public void remove() {
throw new UnsupportedOperationException("Not supported.");
throw new UnsupportedOperationException(
NbBundle.getMessage(this.getClass(), "IngestScheduler.remove.exception.notSupported.msg"));
}
/**
@ -933,7 +939,8 @@ class IngestScheduler {
@Override
public synchronized DataSourceTask<IngestModuleDataSource> next() throws IllegalStateException {
if (!hasNext()) {
throw new IllegalStateException("There is no data source tasks in the queue, check hasNext()");
throw new IllegalStateException(
NbBundle.getMessage(this.getClass(), "IngestScheduler.DataSourceScheduler.exception.next.msg"));
}
final DataSourceTask<IngestModuleDataSource> ret = tasks.pollFirst();
@ -960,7 +967,8 @@ class IngestScheduler {
@Override
public void remove() {
throw new UnsupportedOperationException("Removing of scheduled data source ingest tasks is not supported. ");
throw new UnsupportedOperationException(
NbBundle.getMessage(this.getClass(), "IngestScheduler.DataSourceScheduler.exception.remove.msg"));
}
synchronized void empty() {
@ -974,7 +982,8 @@ class IngestScheduler {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("DataSourceQueue, size: ").append(getCount());
sb.append(NbBundle.getMessage(this.getClass(), "IngestScheduler.DataSourceScheduler.toString.size",
getCount()));
for (DataSourceTask<IngestModuleDataSource> task : tasks) {
sb.append(task.toString()).append(" ");
}

View File

@ -18,6 +18,8 @@
*/
package org.sleuthkit.autopsy.ingest;
import org.openide.util.NbBundle;
import java.util.Objects;
/**
@ -45,7 +47,7 @@ public class PipelineContext <T extends IngestModuleAbstract> {
@Override
public String toString() {
return "pipelineContext{" + "task=" + task + '}';
return NbBundle.getMessage(this.getClass(), "PipelineContext.toString.text", task);
}
@Override