Did additional work on new ingest framework

This commit is contained in:
Richard Cordovano 2014-03-24 21:17:41 -04:00
parent 87bb0211f2
commit edc9c68186
30 changed files with 277 additions and 267 deletions

View File

@ -74,7 +74,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
this.dataSourcePanel = dsPanel;
ingestConfig = new IngestJobLauncher(AddImageWizardIngestConfigPanel.class.getCanonicalName());
List<String> messages = ingestConfig.getContextSettingsWarnings();
List<String> messages = ingestConfig.getIngestJobConfigWarnings();
if (messages.isEmpty() == false) {
StringBuilder warning = new StringBuilder();
for (String message : messages) {
@ -201,8 +201,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
private void startIngest() {
if (!newContents.isEmpty() && readyToIngest && !ingested) {
ingested = true;
ingestConfig.setDataSourcesToIngest(newContents);
ingestConfig.startIngestJobs();
ingestConfig.startIngestJobs(newContents);
progressPanel.setStateFinished();
}

View File

@ -64,7 +64,7 @@ import org.sleuthkit.autopsy.datamodel.RootContentChildren;
import org.sleuthkit.autopsy.datamodel.Views;
import org.sleuthkit.autopsy.datamodel.ViewsNode;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestModuleEvent;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestEvent;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
@ -587,7 +587,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
// change in node selection
else if (changed.equals(ExplorerManager.PROP_SELECTED_NODES)) {
respondSelection((Node[]) oldValue, (Node[]) newValue);
} else if (changed.equals(IngestModuleEvent.DATA.toString())) {
} else if (changed.equals(IngestEvent.DATA.toString())) {
final ModuleDataEvent event = (ModuleDataEvent) oldValue;
if (event.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO) {
return;
@ -598,7 +598,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
refreshTree(event.getArtifactType());
}
});
} else if (changed.equals(IngestModuleEvent.COMPLETED.toString())) {
} else if (changed.equals(IngestEvent.COMPLETED.toString())) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
@ -606,7 +606,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
refreshTree();
}
});
} else if (changed.equals(IngestModuleEvent.CONTENT_CHANGED.toString())) {
} else if (changed.equals(IngestEvent.CONTENT_CHANGED.toString())) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {

View File

@ -49,9 +49,8 @@ import org.sleuthkit.datamodel.TskCoreException;
* IngestModuleAdapter abstract class could have been used as a base class to
* obtain default implementations of many of the DataSourceIngestModule methods.
*/
// RJCTODO: Add factory with service provider annotation (commend out)
// RJCTODO: Remove inheritance from IngestModuleAdapter to show full implementation
// and provide better documentation, and more extensive demonstration of how to
// RJCTODO: Remove inheritance from IngestModuleAdapter to show full implementation of interface
// provide better documentation, and provide more extensive demonstration of how to
// use various ingest services.
class SampleDataSourceIngestModule extends IngestModuleAdapter implements DataSourceIngestModule {

View File

@ -54,9 +54,8 @@ import org.sleuthkit.datamodel.TskData;
* org.sleuthkit.autopsy.examples package. Either change the package or the
* loading code to make this module actually run.
*/
// RJCTODO: Add factory with service provider annotation (commend out)
// RJCTODO: Remove inheritance from IngestModuleAdapter to show full implementation
// and provide better documentation, and more extensive demonstration of how to
// RJCTODO: Remove inheritance from IngestModuleAdapter to show full implementation of interface
// provide better documentation, and provide more extensive demonstration of how to
// use various ingest services.
class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestModule {
@ -134,5 +133,5 @@ class SampleFileIngestModule extends IngestModuleAdapter implements FileIngestMo
}
}
// RJCTODO: Add a module factory
// RJCTODO: Add a module factory with service provider annotation (commented out)
}

View File

@ -50,11 +50,11 @@ IngestManager.FileTaskWorker.displayName=File Ingest
IngestManager.FileTaskWorker.process.cancelling={0} (Cancelling...)
IngestManager.EnqueueWorker.displayName.text=Queueing Ingest
IngestManager.EnqueueWorker.process.cancelling={0} (Cancelling...)
IngestManager.DataSourceTaskWorker.displayName.text={0} dataSource id\:{1}
IngestManager.DataSourceTaskWorker.progress.pending={0} (Pending...)
IngestManager.DataSourceTaskWorker.progress.cancelling={0} (Cancelling...)
IngestManager.datatSourceIngest.progress.text=DataSource Ingest {0}
IngestManager.fileIngest.progress.text=File Ingest {0}
IngestJob.DataSourceIngestPipeline.displayName.text={0} processing {1}
IngestMessage.toString.type.text=type\: {0}
IngestMessage.toString.source.text=\ source\: {0}
IngestMessage.toString.date.text=\ date\: {0}

View File

@ -21,19 +21,16 @@ package org.sleuthkit.autopsy.ingest;
import org.sleuthkit.datamodel.Content;
/**
* Interface that must be implemented by all data source ingest modules. Data
* source ingest modules work at the granularity of data sources, while file
* ingest modules work at the granularity of individual files from a data
* source.
* Interface that must be implemented by all data source ingest modules.
*/
public interface DataSourceIngestModule extends IngestModule {
/**
* Process a data source.
* Processes a data source.
*
* @param dataSource The data source to process.
* @param statusHelper A status helper to be used to report progress and
* detect cancellation.
* detect ingest job cancellation.
* @return A result code indicating success or failure of the processing.
*/
ProcessResult process(Content dataSource, DataSourceIngestModuleStatusHelper statusHelper);

View File

@ -23,8 +23,8 @@ import org.netbeans.api.progress.ProgressHandle;
import org.sleuthkit.datamodel.Content;
/**
* Used by data source ingest modules to report progress and check for data
* source ingest task cancellation.
* Used by data source ingest modules to report progress and detect data source
* ingest job cancellation.
*/
public class DataSourceIngestModuleStatusHelper {
@ -43,7 +43,7 @@ public class DataSourceIngestModuleStatusHelper {
* in its process() method. If the ingest task is canceled, the module
* should return from its process() method as quickly as possible.
*
* @return True if the task has been canceled, false otherwise
* @return True if the task has been canceled, false otherwise.
*/
public boolean isCancelled() {
return worker.isCancelled();

View File

@ -21,17 +21,15 @@ package org.sleuthkit.autopsy.ingest;
import org.sleuthkit.datamodel.AbstractFile;
/**
* Interface that must be implemented by all file ingest modules. File ingest
* modules work at the granularity of individual files from a data source, while
* data source ingest modules work at the granularity of data sources.
* Interface that must be implemented by all file ingest modules.
*/
public interface FileIngestModule extends IngestModule {
/**
* Process a file.
* Processes a file.
*
* @param file The file
* @return A result code indicating success or failure.
* @param file The file.
* @return A result code indicating success or failure of the processing.
*/
ProcessResult process(AbstractFile file);
}

View File

@ -65,10 +65,11 @@ abstract class GetFilesContentVisitor implements ContentVisitor<Collection<Abstr
}
/**
* Aggregate all the matches from visiting the children Content objects of the
* one passed
* @param parent
* @return
* Aggregate all the matches from visiting the children Content objects of
* a parent Content object.
*
* @param parent A content object.
* @return The child files of the content.
*/
protected Collection<AbstractFile> getAllFromChildren(Content parent) {
Collection<AbstractFile> all = new ArrayList<>();

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-2014 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -25,6 +25,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BoxLayout;
import javax.swing.JButton;
@ -32,24 +33,24 @@ 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;
/**
* Dialog box that allows ingest modules to be run on a data source.
* Used outside of the wizards.
* Dialog box that allows ingest modules to be run on a data source. Used
* outside of the wizards.
*/
public final class IngestDialog extends JDialog {
private static final String TITLE = NbBundle.getMessage(IngestDialog.class, "IngestDialog.title.text");
private static Dimension DIMENSIONS = new Dimension(500, 300);
private IngestJobLauncher ingestConfigurator;
private List<Content> dataSources = new ArrayList<>();
private IngestJobLauncher ingestJobLauncher;
public IngestDialog(JFrame frame, String title, boolean modal) {
super(frame, title, modal);
ingestConfigurator = new IngestJobLauncher(IngestDialog.class.getCanonicalName());
List<String> messages = ingestConfigurator.getContextSettingsWarnings();
ingestJobLauncher = new IngestJobLauncher(IngestDialog.class.getCanonicalName());
List<String> messages = ingestJobLauncher.getIngestJobConfigWarnings();
if (messages.isEmpty() == false) {
StringBuilder warning = new StringBuilder();
for (String message : messages) {
@ -59,7 +60,7 @@ public final class IngestDialog extends JDialog {
}
}
public IngestDialog(){
public IngestDialog() {
this(new JFrame(TITLE), TITLE, true);
}
@ -78,39 +79,36 @@ public final class IngestDialog extends JDialog {
// set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
add(ingestConfigurator.getIngestJobConfigPanel(), BorderLayout.PAGE_START);
add(ingestJobLauncher.getIngestJobConfigPanel(), BorderLayout.PAGE_START);
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
public void actionPerformed(ActionEvent e) {
ingestConfigurator.saveIngestJobConfig();
ingestConfigurator.startIngestJobs();
ingestJobLauncher.saveIngestJobConfig();
ingestJobLauncher.startIngestJobs(dataSources);
close();
}
});
closeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ingestConfigurator.saveIngestJobConfig();
ingestJobLauncher.saveIngestJobConfig();
close();
}
});
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
ingestConfigurator.saveIngestJobConfig();
ingestJobLauncher.saveIngestJobConfig();
close();
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
buttonPanel.add(new javax.swing.Box.Filler(new Dimension(10,10), new Dimension(10,10), new Dimension(10,10)));
buttonPanel.add(new javax.swing.Box.Filler(new Dimension(10, 10), new Dimension(10, 10), new Dimension(10, 10)));
buttonPanel.add(startButton);
buttonPanel.add(new javax.swing.Box.Filler(new Dimension(10,10), new Dimension(10,10), new Dimension(10,10)));
buttonPanel.add(new javax.swing.Box.Filler(new Dimension(10, 10), new Dimension(10, 10), new Dimension(10, 10)));
buttonPanel.add(closeButton);
add(buttonPanel, BorderLayout.LINE_START);
@ -120,7 +118,8 @@ public final class IngestDialog extends JDialog {
}
public void setDataSources(List<Content> inputContent) {
ingestConfigurator.setDataSourcesToIngest(inputContent);
dataSources.clear();
dataSources.addAll(inputContent);
}
/**

View File

@ -25,6 +25,7 @@ import java.util.Map;
import java.util.logging.Level;
import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
@ -170,7 +171,7 @@ final class IngestJob {
try {
module.startUp(context);
modulesByClass.put(module.getClassName(), module);
IngestManager.fireModuleEvent(IngestManager.IngestModuleEvent.STARTED.toString(), module.getDisplayName());
IngestManager.fireModuleEvent(IngestManager.IngestEvent.STARTED.toString(), module.getDisplayName());
} catch (Exception ex) {
errors.add(new IngestModuleError(module.getDisplayName(), ex));
}
@ -200,10 +201,9 @@ final class IngestJob {
logger.log(Level.INFO, "Processing data source {0}", dataSource.getName());
for (DataSourceIngestModuleDecorator module : this.modules) {
try {
progress.start();
progress.switchToIndeterminate();
String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.DataSourceIngestPipeline.displayName.text", module.getDisplayName(), dataSource.getName());
progress.setDisplayName(displayName);
module.process(dataSource, new DataSourceIngestModuleStatusHelper(worker, progress, dataSource));
progress.finish();
} catch (Exception ex) {
errors.add(new IngestModuleError(module.getDisplayName(), ex));
}
@ -222,7 +222,7 @@ final class IngestJob {
} catch (Exception ex) {
errors.add(new IngestModuleError(module.getDisplayName(), ex));
} finally {
IngestManager.fireModuleEvent(IngestManager.IngestModuleEvent.COMPLETED.toString(), module.getDisplayName());
IngestManager.fireModuleEvent(IngestManager.IngestEvent.COMPLETED.toString(), module.getDisplayName());
}
}
return errors;
@ -295,7 +295,7 @@ final class IngestJob {
try {
module.startUp(context);
modulesByClass.put(module.getClassName(), module);
IngestManager.fireModuleEvent(IngestManager.IngestModuleEvent.STARTED.toString(), template.getModuleName());
IngestManager.fireModuleEvent(IngestManager.IngestEvent.STARTED.toString(), template.getModuleName());
} catch (Exception ex) {
errors.add(new IngestModuleError(module.getDisplayName(), ex));
}
@ -346,7 +346,7 @@ final class IngestJob {
} catch (Exception ex) {
errors.add(new IngestModuleError(module.getDisplayName(), ex));
} finally {
IngestManager.fireModuleEvent(IngestManager.IngestModuleEvent.COMPLETED.toString(), module.getDisplayName());
IngestManager.fireModuleEvent(IngestManager.IngestEvent.COMPLETED.toString(), module.getDisplayName());
}
}
return errors;

View File

@ -33,10 +33,31 @@ public final class IngestJobContext {
this.ingestJob = ingestJob;
}
public boolean isIngestJobCancelled() {
/**
* Gets the identifier of the ingest job associated with this context.
*
* @return The ingest job identifier.
*/
public long getJobId() {
return this.ingestJob.getId();
}
/**
* Determines whether the ingest job associated with the current context has
* been canceled.
*
* @return True if the job has been canceled, false otherwise.
*/
public boolean isJobCancelled() {
return this.ingestJob.isCancelled();
}
/**
* Adds one or more files to the files to be passed through the file ingest
* pipeline of the ingest job associated with the current context.
*
* @param files The files to be processed by the file ingest pipeline.
*/
public void addFilesToPipeline(List<AbstractFile> files) {
for (AbstractFile file : files) {
IngestManager.getDefault().scheduleFile(ingestJob.getId(), file);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2014 Basis Technology Corp.
* Copyright 2014 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -26,9 +26,9 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.datamodel.Content;
/**
* Provides a mechanism for creating and persisting a context-sensitive ingest
* pipeline configuration and launching ingest jobs to process one or more data
* sources.
* Provides a mechanism for creating and persisting an ingest job configuration
* for a particular context and for launching ingest jobs that process one or
* more data sources using the ingest job configuration.
*/
public final class IngestJobLauncher {
@ -36,13 +36,13 @@ public final class IngestJobLauncher {
private static final String DISABLED_INGEST_MODULES_KEY = "Disabled_Ingest_Modules";
private static final String PARSE_UNALLOC_SPACE_KEY = "Process_Unallocated_Space";
private final String launcherContext;
private final List<String> contextSettingsWarnings = new ArrayList<>();
private final List<Content> dataSourcesToIngest = new ArrayList<>();
private final List<String> warnings = new ArrayList<>();
private IngestJobConfigurationPanel ingestConfigPanel;
/**
* Constructs an ingest job launcher that loads and updates the ingest job
* and ingest pipeline for a particular context.
* Constructs an ingest job launcher that creates and persists an ingest job
* configuration for a particular context and launches ingest jobs that
* process one or more data sources using the ingest job configuration.
*
* @param launcherContext The context identifier.
*/
@ -51,8 +51,7 @@ public final class IngestJobLauncher {
// Get the ingest module factories discovered by the ingest module
// loader.
// RJCTODO: Put in module name uniqueness test/notification either here or in the loader
List<IngestModuleFactory> moduleFactories = IngestModuleLoader.getInstance().getIngestModuleFactories();
List<IngestModuleFactory> moduleFactories = IngestModuleFactoryLoader.getInstance().getIngestModuleFactories();
HashSet<String> loadedModuleNames = new HashSet<>();
for (IngestModuleFactory moduleFactory : moduleFactories) {
loadedModuleNames.add(moduleFactory.getModuleDisplayName());
@ -79,13 +78,12 @@ public final class IngestJobLauncher {
for (String moduleName : missingModuleNames) {
enabledModuleNames.remove(moduleName);
disabledModuleNames.remove(moduleName);
contextSettingsWarnings.add(String.format("Previously loaded %s module could not be found", moduleName));
warnings.add(String.format("Previously loaded %s module could not be found", moduleName));
}
// Create ingest module templates.
List<IngestModuleTemplate> moduleTemplates = new ArrayList<>();
for (IngestModuleFactory moduleFactory : moduleFactories) {
// RJCTODO: Make sure there is a story in JIRA for this.
// NOTE: In the future, this code will be modified to get the
// module settings for the current context, if available, from
// storage; for now always use the defaults.
@ -121,74 +119,6 @@ public final class IngestJobLauncher {
ingestConfigPanel = new IngestJobConfigurationPanel(moduleTemplates, processUnallocatedSpace);
}
public List<String> getContextSettingsWarnings() {
return contextSettingsWarnings;
}
public JPanel getIngestJobConfigPanel() {
return ingestConfigPanel;
}
public void saveIngestJobConfig() {
List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates();
// Save the enabled/disabled ingest module settings for the current context.
HashSet<String> enabledModuleNames = new HashSet<>();
HashSet<String> disabledModuleNames = new HashSet<>();
for (IngestModuleTemplate moduleTemplate : moduleTemplates) {
String moduleName = moduleTemplate.getModuleName();
if (moduleTemplate.isEnabled()) {
enabledModuleNames.add(moduleName);
} else {
disabledModuleNames.add(moduleName);
}
}
ModuleSettings.setConfigSetting(launcherContext, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames));
ModuleSettings.setConfigSetting(launcherContext, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames));
// Save the process unallocated space setting for the current context.
String processUnalloc = Boolean.toString(ingestConfigPanel.getProcessUnallocSpace());
ModuleSettings.setConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY, processUnalloc);
// NOTE: In the future, this code will be modified to persist the ingest
// options for each ingest module for the current launch context.
}
public void setDataSourcesToIngest(List<Content> dataSourcesToIngest) { // RJCTODO: This should really be handled by passing the data sources to startIngestJobs()
this.dataSourcesToIngest.clear();
this.dataSourcesToIngest.addAll(dataSourcesToIngest);
}
public void startIngestJobs() {
// Filter out the disabled ingest module templates.
List<IngestModuleTemplate> enabledModuleTemplates = new ArrayList<>();
List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates();
for (IngestModuleTemplate moduleTemplate : moduleTemplates) {
if (moduleTemplate.isEnabled()) {
enabledModuleTemplates.add(moduleTemplate);
}
}
if ((!enabledModuleTemplates.isEmpty()) && (dataSourcesToIngest != null)) {
IngestManager.getDefault().scheduleDataSourceTasks(dataSourcesToIngest, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace());
}
}
private static String makeCommaSeparatedList(HashSet<String> input) {
if (input == null || input.isEmpty()) {
return "";
}
ArrayList<String> list = new ArrayList<>();
list.addAll(input);
StringBuilder csvList = new StringBuilder();
for (int i = 0; i < list.size() - 1; ++i) {
csvList.append(list.get(i)).append(", ");
}
csvList.append(list.get(list.size() - 1));
return csvList.toString();
}
private HashSet<String> getModulesNamesFromSetting(String key, String defaultSetting) {
// Get the ingest modules setting from the user's config file.
// If there is no such setting yet, create the default setting.
@ -220,4 +150,89 @@ public final class IngestJobLauncher {
}
return moduleNames;
}
/**
* Gets any warnings generated when the persisted ingest job configuration
* for the specified context is retrieved and loaded.
*
* @return A collection of warning messages.
*/
public List<String> getIngestJobConfigWarnings() {
return warnings;
}
/**
* Gets the user interface panel the launcher uses to obtain the user's
* ingest job configuration for the specified context.
*
* @return A JPanel with components that can be used to create an ingest job
* configuration.
*/
public JPanel getIngestJobConfigPanel() {
return ingestConfigPanel;
}
/**
* Persists the ingest job configuration for the specified context.
*/
public void saveIngestJobConfig() {
List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates();
// Save the enabled/disabled ingest module settings for the current context.
HashSet<String> enabledModuleNames = new HashSet<>();
HashSet<String> disabledModuleNames = new HashSet<>();
for (IngestModuleTemplate moduleTemplate : moduleTemplates) {
String moduleName = moduleTemplate.getModuleName();
if (moduleTemplate.isEnabled()) {
enabledModuleNames.add(moduleName);
} else {
disabledModuleNames.add(moduleName);
}
}
ModuleSettings.setConfigSetting(launcherContext, ENABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(enabledModuleNames));
ModuleSettings.setConfigSetting(launcherContext, DISABLED_INGEST_MODULES_KEY, makeCommaSeparatedList(disabledModuleNames));
// Save the process unallocated space setting for the current context.
String processUnalloc = Boolean.toString(ingestConfigPanel.getProcessUnallocSpace());
ModuleSettings.setConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY, processUnalloc);
// NOTE: In the future, this code will be modified to persist the ingest
// options for each ingest module for the current launch context.
}
private static String makeCommaSeparatedList(HashSet<String> input) {
if (input == null || input.isEmpty()) {
return "";
}
ArrayList<String> list = new ArrayList<>();
list.addAll(input);
StringBuilder csvList = new StringBuilder();
for (int i = 0; i < list.size() - 1; ++i) {
csvList.append(list.get(i)).append(", ");
}
csvList.append(list.get(list.size() - 1));
return csvList.toString();
}
/**
* Launches ingest jobs for one or more data sources using the ingest job
* configuration for the selected context.
*
* @param dataSources The data sources to ingest.
*/
public void startIngestJobs(List<Content> dataSources) {
// Filter out the disabled ingest module templates.
List<IngestModuleTemplate> enabledModuleTemplates = new ArrayList<>();
List<IngestModuleTemplate> moduleTemplates = ingestConfigPanel.getIngestModuleTemplates();
for (IngestModuleTemplate moduleTemplate : moduleTemplates) {
if (moduleTemplate.isEnabled()) {
enabledModuleTemplates.add(moduleTemplate);
}
}
if ((!enabledModuleTemplates.isEmpty()) && (dataSources != null) && (!dataSources.isEmpty())) {
IngestManager.getDefault().scheduleDataSourceTasks(dataSources, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace());
}
}
}

View File

@ -36,12 +36,7 @@ import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
/**
* IngestManager sets up and manages ingest modules runs them in a background
* thread notifies modules when work is complete or should be interrupted
* processes messages from modules via messenger proxy and posts them to GUI.
*
* This runs as a singleton and you can access it using the getDefault() method.
*
* Manages the execution of ingest jobs.
*/
public class IngestManager {
@ -56,16 +51,14 @@ public class IngestManager {
private DataSourceTaskWorker dataSourceTaskWorker;
private long nextDataSourceTaskId = 0;
private long nextThreadId = 0;
public final static String MODULE_PROPERTIES = NbBundle.getMessage(IngestManager.class,
"IngestManager.moduleProperties.text");
private volatile IngestUI ingestMessageBox;
/**
* Possible events about ingest modules Event listeners can get the event
* name by using String returned by toString() method on the specific event.
* Ingest events.
*/
public enum IngestModuleEvent {
public enum IngestEvent {
// RJCTODO: Update comments
/**
* Event sent when an ingest module has been started. Second argument of
* the property change is a string form of the module name and the third
@ -174,7 +167,7 @@ public class IngestManager {
*/
static synchronized void fireFileDone(long objId) {
try {
pcs.firePropertyChange(IngestModuleEvent.FILE_DONE.toString(), objId, null);
pcs.firePropertyChange(IngestEvent.FILE_DONE.toString(), objId, null);
} catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
@ -191,7 +184,7 @@ public class IngestManager {
*/
static synchronized void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
try {
pcs.firePropertyChange(IngestModuleEvent.DATA.toString(), moduleDataEvent, null);
pcs.firePropertyChange(IngestEvent.DATA.toString(), moduleDataEvent, null);
} catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
@ -208,7 +201,7 @@ public class IngestManager {
*/
static synchronized void fireModuleContentEvent(ModuleContentEvent moduleContentEvent) {
try {
pcs.firePropertyChange(IngestModuleEvent.CONTENT_CHANGED.toString(), moduleContentEvent, null);
pcs.firePropertyChange(IngestEvent.CONTENT_CHANGED.toString(), moduleContentEvent, null);
} catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e);
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),
@ -396,7 +389,6 @@ public class IngestManager {
private final List<Content> dataSources;
private final List<IngestModuleTemplate> moduleTemplates;
private final boolean processUnallocatedSpace;
private final List<Long> scheduledJobIds = new ArrayList<>();
private ProgressHandle progress;
TaskSchedulingWorker(List<Content> dataSources, List<IngestModuleTemplate> moduleTemplates, boolean processUnallocatedSpace) {
@ -508,15 +500,14 @@ public class IngestManager {
// Set up a progress bar that can be used to cancel all of the
// ingest jobs currently being performed.
final String displayName = NbBundle.getMessage(this.getClass(), "IngestManager.DataSourceTaskWorker.displayName");
progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
progress = ProgressHandleFactory.createHandle("Data source ingest", new Cancellable() {
@Override
public boolean cancel() {
logger.log(Level.INFO, "Data source ingest thread {0} cancelled", DataSourceTaskWorker.this.id);
logger.log(Level.INFO, "Data source ingest thread (id={0}) cancelled", DataSourceTaskWorker.this.id);
if (progress != null) {
progress.setDisplayName(NbBundle.getMessage(this.getClass(),
"IngestManager.DataSourceTaskWorker.process.cancelling",
displayName));
"Data source ingest"));
}
IngestManager.getDefault().stopAll();
return true;

View File

@ -383,7 +383,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener {
}
private void init() {
List<IngestModuleFactory> moduleFactories = IngestModuleLoader.getInstance().getIngestModuleFactories();
List<IngestModuleFactory> moduleFactories = IngestModuleFactoryLoader.getInstance().getIngestModuleFactories();
for (IngestModuleFactory factory : moduleFactories) {
groupings.put(factory.getModuleDisplayName(), new HashMap<String, List<IngestMessageGroup>>());
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2012-2014 Basis Technology Corp.
* Copyright 2014 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.ingest;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Level;
import org.openide.util.Lookup;
@ -28,29 +29,33 @@ import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Looks up loaded ingest module factories using the NetBean global lookup.
*/
final class IngestModuleLoader {
final class IngestModuleFactoryLoader {
private static final Logger logger = Logger.getLogger(IngestModuleLoader.class.getName());
private static IngestModuleLoader instance;
private final List<IngestModuleFactory> moduleFactories = new ArrayList<>();
private static final Logger logger = Logger.getLogger(IngestModuleFactoryLoader.class.getName());
private static IngestModuleFactoryLoader instance;
private IngestModuleLoader() {
private IngestModuleFactoryLoader() {
}
synchronized static IngestModuleLoader getInstance() {
synchronized static IngestModuleFactoryLoader getInstance() {
if (instance == null) {
instance = new IngestModuleLoader();
instance = new IngestModuleFactoryLoader();
}
return instance;
}
synchronized List<IngestModuleFactory> getIngestModuleFactories() {
moduleFactories.clear();
// RJCTODO: Need a name uniqueness test/solution, here or in the launcher.
List<IngestModuleFactory> moduleFactories = new ArrayList<>();
HashSet<String> moduleDisplayNames = new HashSet<>();
Collection<? extends IngestModuleFactory> factories = Lookup.getDefault().lookupAll(IngestModuleFactory.class);
for (IngestModuleFactory factory : factories) {
logger.log(Level.INFO, "Found ingest module factory: name = {0}, version = {1}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()});
if (!moduleDisplayNames.contains(factory.getModuleDisplayName())) {
moduleFactories.add(factory);
moduleDisplayNames.add(factory.getModuleDisplayName());
} else {
logger.log(Level.SEVERE, "Found duplicate ingest module display name, discarding ingest module factory (name = {0}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()});
}
}
return new ArrayList<>(moduleFactories);
}

View File

@ -57,7 +57,7 @@ final class IngestPipelinesConfiguration {
synchronized static IngestPipelinesConfiguration getInstance() {
if (instance == null) {
Logger.getLogger(IngestModuleLoader.class.getName()).log(Level.INFO, "Creating ingest module loader instance");
Logger.getLogger(IngestPipelinesConfiguration.class.getName()).log(Level.INFO, "Creating ingest module loader instance");
instance = new IngestPipelinesConfiguration();
}
return instance;
@ -73,14 +73,14 @@ final class IngestPipelinesConfiguration {
private void readPipelinesConfigurationFile() {
try {
PlatformUtil.extractResourceToUserConfigDir(IngestModuleLoader.class, PIPELINES_CONFIG_FILE);
PlatformUtil.extractResourceToUserConfigDir(IngestPipelinesConfiguration.class, PIPELINES_CONFIG_FILE);
} catch (IOException ex) {
logger.log(Level.SEVERE, "Error copying default pipeline configuration to user dir", ex);
return;
}
String configFilePath = PlatformUtil.getUserConfigDirectory() + File.separator + PIPELINES_CONFIG_FILE;
Document doc = XMLUtil.loadDoc(IngestModuleLoader.class, configFilePath, PIPELINES_CONFIG_FILE_XSD);
Document doc = XMLUtil.loadDoc(IngestPipelinesConfiguration.class, configFilePath, PIPELINES_CONFIG_FILE_XSD);
if (doc == null) {
return;
}

View File

@ -47,12 +47,12 @@ import org.sleuthkit.datamodel.TskException;
public class FileExtMismatchIngestModule extends IngestModuleAdapter implements FileIngestModule {
private static final Logger logger = Logger.getLogger(FileExtMismatchIngestModule.class.getName());
private static long processTime = 0; // RJCTODO: This is not thread safe
private static int messageId = 0; // RJCTODO: This is not thread safe
private static long numFiles = 0; // RJCTODO: This is not thread safe
private final IngestServices services = IngestServices.getDefault();
private final FileExtMismatchDetectorModuleSettings settings;
private HashMap<String, String[]> SigTypeToExtMap = new HashMap<>();
private long processTime = 0;
private long numFiles = 0;
FileExtMismatchIngestModule(FileExtMismatchDetectorModuleSettings settings) {
this.settings = settings;

View File

@ -1,5 +1,6 @@
OpenIDE-Module-Name=FileTypeId
FileTypeIdentifierModuleSettingsPanel.skipKnownCheckBox.toolTipText=Depending on how many files have known hashes, checking this box will improve the speed of file type identification.
FileTypeIdModuleSettingsPanel.skipKnownCheckBox.text=Skip known files (NSRL)
FileTypeIdModuleSettingsPanel.skipKnownCheckBox.toolTipText=Depending on how many files have known hashes, checking this box will improve the speed of file type identification.
FileTypeIdIngestModule.moduleName.text=File Type Identification
FileTypeIdIngestModule.moduleDesc.text=Matches file types based on binary signatures.
FileTypeIdIngestModule.complete.totalProcTime=Total Processing Time

View File

@ -1,5 +1,5 @@
OpenIDE-Module-Name=\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7\u306e\u7279\u5b9a
FileTypeIdentifierModuleSettingsPanel.skipKnownCheckBox.toolTipText=\u65e2\u77e5\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u6570\u306b\u3088\u3063\u3066\u306f\u3001\u3053\u306e\u30dc\u30c3\u30af\u30b9\u3092\u9078\u629e\u3059\u308b\u306e\u306b\u3088\u308a\u3001\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7\u306e\u7279\u5b9a\u3092\u52a0\u901f\u3057\u307e\u3059\u3002
FileTypeIdModuleSettingsPanel.skipKnownCheckBox.toolTipText=\u65e2\u77e5\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u6570\u306b\u3088\u3063\u3066\u306f\u3001\u3053\u306e\u30dc\u30c3\u30af\u30b9\u3092\u9078\u629e\u3059\u308b\u306e\u306b\u3088\u308a\u3001\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7\u306e\u7279\u5b9a\u3092\u52a0\u901f\u3057\u307e\u3059\u3002
FileTypeIdIngestModule.moduleName.text=\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7\u306e\u7279\u5b9a
FileTypeIdIngestModule.moduleDesc.text=\u30d0\u30a4\u30ca\u30ea\u7f72\u540d\u306b\u57fa\u3065\u3044\u3066\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7\u3092\u4e00\u81f4\u3059\u308b\u3002
FileTypeIdIngestModule.complete.totalProcTime=\u5408\u8a08\u51e6\u7406\u6642\u9593

View File

@ -19,7 +19,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="skipKnownCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="138" max="32767" attributes="0"/>
<EmptySpace pref="608" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -28,7 +28,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Component id="skipKnownCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="45" max="32767" attributes="0"/>
<EmptySpace pref="47" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -38,10 +38,13 @@
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filetypeid/Bundle.properties" key="FileTypeIdSimpleConfigPanel.skipKnownCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/filetypeid/Bundle.properties" key="FileTypeIdModuleSettingsPanel.skipKnownCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filetypeid/Bundle.properties" key="FileTypeIdSimpleConfigPanel.skipKnownCheckBox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/filetypeid/Bundle.properties" key="FileTypeIdModuleSettingsPanel.skipKnownCheckBox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="label" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filetypeid/Bundle.properties" key="FileTypeIdModuleSettingsPanel.skipKnownCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>

View File

@ -56,8 +56,9 @@ final class FileTypeIdModuleSettingsPanel extends IngestModuleSettingsPanel {
skipKnownCheckBox = new javax.swing.JCheckBox();
skipKnownCheckBox.setSelected(true);
skipKnownCheckBox.setText(org.openide.util.NbBundle.getMessage(FileTypeIdModuleSettingsPanel.class, "FileTypeIdSimpleConfigPanel.skipKnownCheckBox.text")); // NOI18N
skipKnownCheckBox.setToolTipText(org.openide.util.NbBundle.getMessage(FileTypeIdModuleSettingsPanel.class, "FileTypeIdSimpleConfigPanel.skipKnownCheckBox.toolTipText")); // NOI18N
skipKnownCheckBox.setText(org.openide.util.NbBundle.getMessage(FileTypeIdModuleSettingsPanel.class, "FileTypeIdModuleSettingsPanel.skipKnownCheckBox.text")); // NOI18N
skipKnownCheckBox.setToolTipText(org.openide.util.NbBundle.getMessage(FileTypeIdModuleSettingsPanel.class, "FileTypeIdModuleSettingsPanel.skipKnownCheckBox.toolTipText")); // NOI18N
skipKnownCheckBox.setLabel(org.openide.util.NbBundle.getMessage(FileTypeIdModuleSettingsPanel.class, "FileTypeIdModuleSettingsPanel.skipKnownCheckBox.text")); // NOI18N
skipKnownCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
skipKnownCheckBoxActionPerformed(evt);
@ -71,14 +72,14 @@ final class FileTypeIdModuleSettingsPanel extends IngestModuleSettingsPanel {
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(skipKnownCheckBox)
.addContainerGap(138, Short.MAX_VALUE))
.addContainerGap(608, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(skipKnownCheckBox)
.addContainerGap(45, Short.MAX_VALUE))
.addContainerGap(47, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents

View File

@ -48,8 +48,6 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
private static final Logger logger = Logger.getLogger(HashDbIngestModule.class.getName());
private static final int MAX_COMMENT_SIZE = 500;
private static int messageId = 0; // RJCTODO: This is not thread safe
static long calctime = 0; // RJCTODO: This is not thread safe
static long lookuptime = 0; // RJCTODO: This is not thread safe
private final IngestServices services = IngestServices.getDefault();
private final Hash hasher = new Hash();
private final SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
@ -58,6 +56,8 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
private List<HashDb> knownBadHashSets = new ArrayList<>();
private List<HashDb> knownHashSets = new ArrayList<>();
private int knownBadCount = 0;
private long calctime = 0;
private long lookuptime = 0;
HashDbIngestModule(HashLookupModuleSettings settings) {
this.settings = settings;

View File

@ -225,7 +225,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
}
private boolean isFileIngestStatusChangeEvent(PropertyChangeEvent evt) {
return evt.getPropertyName().equals(IngestManager.IngestModuleEvent.STARTED.toString()) || evt.getPropertyName().equals(IngestManager.IngestModuleEvent.COMPLETED.toString()) || evt.getPropertyName().equals(IngestManager.IngestModuleEvent.STOPPED.toString());
return evt.getPropertyName().equals(IngestManager.IngestEvent.STARTED.toString()) || evt.getPropertyName().equals(IngestManager.IngestEvent.COMPLETED.toString()) || evt.getPropertyName().equals(IngestManager.IngestEvent.STOPPED.toString());
}
@Override

View File

@ -25,8 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
/**
* Global options panel for keyword searching.
*/
// RJCTODO: Why is this a public class?
public final class KeywordSearchConfigurationPanel extends IngestModuleGlobalSetttingsPanel implements OptionsPanel {
final class KeywordSearchConfigurationPanel extends IngestModuleGlobalSetttingsPanel implements OptionsPanel {
private KeywordSearchConfigurationPanel1 listsPanel;
private KeywordSearchConfigurationPanel3 languagesPanel;
@ -74,13 +73,13 @@ public final class KeywordSearchConfigurationPanel extends IngestModuleGlobalSet
@Override
public void load() {
// This calls actually clears the component. RJCTODO: Krazy!
// This calls actually clears the component.
listsPanel.load();
languagesPanel.load();
generalPanel.load();
// Reload the XML to avoid 'ghost' vars RJCTODO: What does this mean?
// Reload the XML to avoid 'ghost' vars
KeywordSearchListsXML.getCurrent().reload();
}

View File

@ -47,7 +47,7 @@ import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestModuleEvent;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestEvent;
import org.sleuthkit.datamodel.BlackboardAttribute;
/**
@ -171,13 +171,13 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
public void propertyChange(PropertyChangeEvent evt) {
String changed = evt.getPropertyName();
Object oldValue = evt.getOldValue();
if (changed.equals(IngestModuleEvent.COMPLETED.toString() )
if (changed.equals(IngestEvent.COMPLETED.toString() )
&& ((String) oldValue).equals(KeywordSearchModuleFactory.getModuleName())) {
initIngest(1);
} else if (changed.equals(IngestModuleEvent.STARTED.toString() )
} else if (changed.equals(IngestEvent.STARTED.toString() )
&& ((String) oldValue).equals(KeywordSearchModuleFactory.getModuleName())) {
initIngest(0);
} else if (changed.equals(IngestModuleEvent.STOPPED.toString() )
} else if (changed.equals(IngestEvent.STOPPED.toString() )
&& ((String) oldValue).equals(KeywordSearchModuleFactory.getModuleName())) {
initIngest(1);
}

View File

@ -173,7 +173,7 @@ abstract class KeywordSearchListsAbstract {
}
// RJCTODO: Need a manager of getting lists
// RJCTODO: There is onient, KeywordSearchEditListPanel, fetching unlocked lists
// RJCTODO: There is one client, KeywordSearchEditListPanel, fetching unlocked lists
public List<KeywordList> getListsL(boolean locked) {
List<KeywordList> ret = new ArrayList<>();
for (KeywordList list : theLists.values()) {
@ -184,7 +184,7 @@ abstract class KeywordSearchListsAbstract {
return ret;
}
// RJCTODO: one perhaps weird use by KeywordSearchListsManagementPanel, for manager, since global list affected
// RJCTODO: Used by KeywordSearchListsManagementPanel; for manager, since global list affected
/**
* Get list names of all loaded keyword list names
*
@ -194,7 +194,7 @@ abstract class KeywordSearchListsAbstract {
return new ArrayList<>(theLists.keySet());
}
// RJCTODO: one perhaps weird use by KeywordSearchListsManagementPanel, for manager, since global list affected
// RJCTODO: Used by KeywordSearchListsManagementPanel; for manager, since global list affected
/**
* Get list names of all locked or unlocked loaded keyword list names
*
@ -213,24 +213,6 @@ abstract class KeywordSearchListsAbstract {
return lists;
}
// RJCTODO: Not used
/**
* return first list that contains the keyword
*
* @param keyword
* @return found list or null
*/
// public KeywordList getListWithKeyword(Keyword keyword) {
// KeywordList found = null;
// for (KeywordList list : theLists.values()) {
// if (list.hasKeyword(keyword)) {
// found = list;
// break;
// }
// }
// return found;
// }
/**
* return first list that contains the keyword
*

View File

@ -41,7 +41,7 @@ import org.openide.util.NbBundle;
import org.openide.util.actions.SystemAction;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestModuleEvent;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestEvent;
/**
* Viewer panel widget for keyword lists that is used in the ingest config and options area.
@ -125,13 +125,13 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
public void propertyChange(PropertyChangeEvent evt) {
String changed = evt.getPropertyName();
Object oldValue = evt.getOldValue();
if (changed.equals(IngestModuleEvent.COMPLETED.toString())
if (changed.equals(IngestEvent.COMPLETED.toString())
&& ((String) oldValue).equals(KeywordSearchModuleFactory.getModuleName())) {
initIngest(false);
} else if (changed.equals(IngestModuleEvent.STARTED.toString())
} else if (changed.equals(IngestEvent.STARTED.toString())
&& ((String) oldValue).equals(KeywordSearchModuleFactory.getModuleName())) {
initIngest(true);
} else if (changed.equals(IngestModuleEvent.STOPPED.toString())
} else if (changed.equals(IngestEvent.STOPPED.toString())
&& ((String) oldValue).equals(KeywordSearchModuleFactory.getModuleName())) {
initIngest(false);
}

View File

@ -112,7 +112,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
@Override
public ProcessResult process(AbstractFile abstractFile) {
ScalpelCarver.init(); // RJCTODO: Is this SclapelCarver class thread-safe?
ScalpelCarver.init(); // RJCTODO: Is this ScalpelCarver class thread-safe?
if (!initialized) {
return ProcessResult.OK;

View File

@ -287,7 +287,7 @@ public final class ThunderbirdMboxFileIngestModule extends IngestModuleAdapter i
}
if (derivedFiles.isEmpty() == false) {
for (AbstractFile derived : derivedFiles) { // RJCTODO: May want to add bulk method
for (AbstractFile derived : derivedFiles) {
services.fireModuleContentEvent(new ModuleContentEvent(derived));
}
}