mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
commit
ea3484461b
@ -105,6 +105,14 @@ class DirectoryTreeFilterNode extends FilterNode {
|
|||||||
Directory dir = this.getLookup().lookup(Directory.class);
|
Directory dir = this.getLookup().lookup(Directory.class);
|
||||||
if (dir != null) {
|
if (dir != null) {
|
||||||
actions.add(ExtractAction.getInstance());
|
actions.add(ExtractAction.getInstance());
|
||||||
|
actions.add(new AbstractAction(
|
||||||
|
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.runIngestMods.text")) {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(dir);
|
||||||
|
ingestDialog.display();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final Image img = this.getLookup().lookup(Image.class);
|
final Image img = this.getLookup().lookup(Image.class);
|
||||||
|
@ -619,8 +619,6 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
DirectoryTreeTopComponent.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
DirectoryTreeTopComponent.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// make sure dataResult is open, redundant?
|
|
||||||
//dataResult.open();
|
|
||||||
Node treeNode = DirectoryTreeTopComponent.this.getSelectedNode();
|
Node treeNode = DirectoryTreeTopComponent.this.getSelectedNode();
|
||||||
if (treeNode != null) {
|
if (treeNode != null) {
|
||||||
DirectoryTreeFilterNode.OriginalNode origin = treeNode.getLookup().lookup(DirectoryTreeFilterNode.OriginalNode.class);
|
DirectoryTreeFilterNode.OriginalNode origin = treeNode.getLookup().lookup(DirectoryTreeFilterNode.OriginalNode.class);
|
||||||
|
@ -53,12 +53,24 @@ public class IngestJobSettings {
|
|||||||
private static final String MODULE_SETTINGS_FILE_EXT = ".settings"; //NON-NLS
|
private static final String MODULE_SETTINGS_FILE_EXT = ".settings"; //NON-NLS
|
||||||
private static final Logger logger = Logger.getLogger(IngestJobSettings.class.getName());
|
private static final Logger logger = Logger.getLogger(IngestJobSettings.class.getName());
|
||||||
private final String context;
|
private final String context;
|
||||||
|
private final IngestType ingestType;
|
||||||
private String moduleSettingsFolderPath;
|
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);
|
||||||
private final List<IngestModuleTemplate> moduleTemplates;
|
private final List<IngestModuleTemplate> moduleTemplates;
|
||||||
private boolean processUnallocatedSpace;
|
private boolean processUnallocatedSpace;
|
||||||
private final List<String> warnings;
|
private final List<String> warnings;
|
||||||
|
|
||||||
|
// Determines which modeules to run
|
||||||
|
public enum IngestType {
|
||||||
|
|
||||||
|
// Run all modules
|
||||||
|
ALL_MODULES,
|
||||||
|
// Run only data source modules
|
||||||
|
DATA_SOURCE_ONLY,
|
||||||
|
// Run only files modules
|
||||||
|
FILES_ONLY
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an ingest job settings object for a given context.
|
* Constructs an ingest job settings object for a given context.
|
||||||
*
|
*
|
||||||
@ -66,6 +78,29 @@ public class IngestJobSettings {
|
|||||||
*/
|
*/
|
||||||
public IngestJobSettings(String context) {
|
public IngestJobSettings(String context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
this.ingestType = IngestType.ALL_MODULES;
|
||||||
|
this.moduleTemplates = new ArrayList<>();
|
||||||
|
this.processUnallocatedSpace = Boolean.parseBoolean(IngestJobSettings.PROCESS_UNALLOC_SPACE_DEFAULT);
|
||||||
|
this.warnings = new ArrayList<>();
|
||||||
|
this.createSavedModuleSettingsFolder();
|
||||||
|
this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an ingest job settings object for a given context.
|
||||||
|
*
|
||||||
|
* @param context The context identifier string.
|
||||||
|
* @param ingestType The type of modules ingest is running.
|
||||||
|
*/
|
||||||
|
public IngestJobSettings(String context, IngestType ingestType) {
|
||||||
|
this.ingestType = ingestType;
|
||||||
|
|
||||||
|
if (this.ingestType.equals(IngestType.ALL_MODULES)) {
|
||||||
|
this.context = context;
|
||||||
|
} else {
|
||||||
|
this.context = context + "." + this.ingestType.name();
|
||||||
|
}
|
||||||
|
|
||||||
this.moduleTemplates = new ArrayList<>();
|
this.moduleTemplates = new ArrayList<>();
|
||||||
this.processUnallocatedSpace = Boolean.parseBoolean(IngestJobSettings.PROCESS_UNALLOC_SPACE_DEFAULT);
|
this.processUnallocatedSpace = Boolean.parseBoolean(IngestJobSettings.PROCESS_UNALLOC_SPACE_DEFAULT);
|
||||||
this.warnings = new ArrayList<>();
|
this.warnings = new ArrayList<>();
|
||||||
@ -145,10 +180,10 @@ public class IngestJobSettings {
|
|||||||
void setProcessUnallocatedSpace(boolean processUnallocatedSpace) {
|
void setProcessUnallocatedSpace(boolean processUnallocatedSpace) {
|
||||||
this.processUnallocatedSpace = processUnallocatedSpace;
|
this.processUnallocatedSpace = processUnallocatedSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the path to the ingest module settings folder.
|
* Returns the path to the ingest module settings folder.
|
||||||
*
|
*
|
||||||
* @return path to the module settings folder
|
* @return path to the module settings folder
|
||||||
*/
|
*/
|
||||||
public Path getSavedModuleSettingsFolder(){
|
public Path getSavedModuleSettingsFolder(){
|
||||||
@ -178,8 +213,21 @@ public class IngestJobSettings {
|
|||||||
* Get the ingest module factories discovered by the ingest module
|
* Get the ingest module factories discovered by the ingest module
|
||||||
* loader.
|
* loader.
|
||||||
*/
|
*/
|
||||||
List<IngestModuleFactory> moduleFactories = IngestModuleFactoryLoader.getIngestModuleFactories();
|
List<IngestModuleFactory> moduleFactories = new ArrayList<>();
|
||||||
|
List<IngestModuleFactory> allModuleFactories = IngestModuleFactoryLoader.getIngestModuleFactories();
|
||||||
HashSet<String> loadedModuleNames = new HashSet<>();
|
HashSet<String> loadedModuleNames = new HashSet<>();
|
||||||
|
|
||||||
|
// Add modules that are going to be used for this ingest depending on type.
|
||||||
|
for (IngestModuleFactory moduleFactory : allModuleFactories) {
|
||||||
|
if (this.ingestType.equals(IngestType.ALL_MODULES)) {
|
||||||
|
moduleFactories.add(moduleFactory);
|
||||||
|
} else if (this.ingestType.equals(IngestType.DATA_SOURCE_ONLY) && moduleFactory.isDataSourceIngestModuleFactory()) {
|
||||||
|
moduleFactories.add(moduleFactory);
|
||||||
|
} else if (this.ingestType.equals(IngestType.FILES_ONLY) && moduleFactory.isFileIngestModuleFactory()) {
|
||||||
|
moduleFactories.add(moduleFactory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (IngestModuleFactory moduleFactory : moduleFactories) {
|
for (IngestModuleFactory moduleFactory : moduleFactories) {
|
||||||
loadedModuleNames.add(moduleFactory.getModuleDisplayName());
|
loadedModuleNames.add(moduleFactory.getModuleDisplayName());
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,9 @@ import javax.swing.JFrame;
|
|||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestJobSettings.IngestType;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
|
import org.sleuthkit.datamodel.Directory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog box that allows a user to configure and run an ingest job on one or
|
* Dialog box that allows a user to configure and run an ingest job on one or
|
||||||
@ -43,6 +45,7 @@ import org.sleuthkit.datamodel.Content;
|
|||||||
public final class RunIngestModulesDialog extends JDialog {
|
public final class RunIngestModulesDialog extends JDialog {
|
||||||
|
|
||||||
private static final String TITLE = NbBundle.getMessage(RunIngestModulesDialog.class, "IngestDialog.title.text");
|
private static final String TITLE = NbBundle.getMessage(RunIngestModulesDialog.class, "IngestDialog.title.text");
|
||||||
|
private final IngestType ingestType;
|
||||||
private static Dimension DIMENSIONS = new Dimension(500, 300);
|
private static Dimension DIMENSIONS = new Dimension(500, 300);
|
||||||
private final List<Content> dataSources = new ArrayList<>();
|
private final List<Content> dataSources = new ArrayList<>();
|
||||||
private IngestJobSettingsPanel ingestJobSettingsPanel;
|
private IngestJobSettingsPanel ingestJobSettingsPanel;
|
||||||
@ -59,6 +62,7 @@ public final class RunIngestModulesDialog extends JDialog {
|
|||||||
public RunIngestModulesDialog(JFrame frame, String title, boolean modal, List<Content> dataSources) {
|
public RunIngestModulesDialog(JFrame frame, String title, boolean modal, List<Content> dataSources) {
|
||||||
super(frame, title, modal);
|
super(frame, title, modal);
|
||||||
this.dataSources.addAll(dataSources);
|
this.dataSources.addAll(dataSources);
|
||||||
|
this.ingestType = IngestType.ALL_MODULES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,6 +74,11 @@ public final class RunIngestModulesDialog extends JDialog {
|
|||||||
public RunIngestModulesDialog(List<Content> dataSources) {
|
public RunIngestModulesDialog(List<Content> dataSources) {
|
||||||
this(new JFrame(TITLE), TITLE, true, dataSources);
|
this(new JFrame(TITLE), TITLE, true, dataSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RunIngestModulesDialog(Directory dir) {
|
||||||
|
this.dataSources.add(dir);
|
||||||
|
this.ingestType = IngestType.FILES_ONLY;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a dialog box that allows a user to configure and run an ingest
|
* Construct a dialog box that allows a user to configure and run an ingest
|
||||||
@ -84,6 +93,7 @@ public final class RunIngestModulesDialog extends JDialog {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public RunIngestModulesDialog(JFrame frame, String title, boolean modal) {
|
public RunIngestModulesDialog(JFrame frame, String title, boolean modal) {
|
||||||
super(frame, title, modal);
|
super(frame, title, modal);
|
||||||
|
this.ingestType = IngestType.ALL_MODULES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,7 +139,7 @@ public final class RunIngestModulesDialog extends JDialog {
|
|||||||
* Get the default or saved ingest job settings for this context and use
|
* Get the default or saved ingest job settings for this context and use
|
||||||
* them to create and add an ingest job settings panel.
|
* them to create and add an ingest job settings panel.
|
||||||
*/
|
*/
|
||||||
IngestJobSettings ingestJobSettings = new IngestJobSettings(RunIngestModulesDialog.class.getCanonicalName());
|
IngestJobSettings ingestJobSettings = new IngestJobSettings(RunIngestModulesDialog.class.getCanonicalName(), this.ingestType);
|
||||||
RunIngestModulesDialog.showWarnings(ingestJobSettings);
|
RunIngestModulesDialog.showWarnings(ingestJobSettings);
|
||||||
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings);
|
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings);
|
||||||
add(this.ingestJobSettingsPanel, BorderLayout.PAGE_START);
|
add(this.ingestJobSettingsPanel, BorderLayout.PAGE_START);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user