mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
Merge pull request #1252 from sidheshenator/ingest_modules_run_at_DS_level
Ingest modules run at ds level
This commit is contained in:
commit
a150990e80
@ -39,6 +39,7 @@ import org.sleuthkit.datamodel.Content;
|
|||||||
import org.sleuthkit.datamodel.Directory;
|
import org.sleuthkit.datamodel.Directory;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
import org.sleuthkit.datamodel.VirtualDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class sets the actions for the nodes in the directory tree and creates
|
* This class sets the actions for the nodes in the directory tree and creates
|
||||||
@ -106,22 +107,35 @@ class DirectoryTreeFilterNode extends FilterNode {
|
|||||||
actions.add(ExtractAction.getInstance());
|
actions.add(ExtractAction.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
// file search action
|
|
||||||
final Image img = this.getLookup().lookup(Image.class);
|
final Image img = this.getLookup().lookup(Image.class);
|
||||||
if (img != null) {
|
|
||||||
actions.add(new FileSearchAction(
|
VirtualDirectory virtualDirectory = this.getLookup().lookup(VirtualDirectory.class);
|
||||||
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text")));
|
// determine if the virtualDireory is at root-level (Logical File Set).
|
||||||
|
boolean isRootVD = false;
|
||||||
|
if (virtualDirectory != null) {
|
||||||
|
try {
|
||||||
|
if (virtualDirectory.getParent() == null) {
|
||||||
|
isRootVD = true;
|
||||||
|
}
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.WARNING, "Error determining the parent of the virtual directory", ex); // NON-NLS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//ingest action
|
// 'run ingest' action and 'file search' action are added only if the
|
||||||
actions.add(new AbstractAction(
|
// selected node is img node or a root level virtual directory.
|
||||||
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.runIngestMods.text")) {
|
if (img != null || isRootVD) {
|
||||||
@Override
|
actions.add(new FileSearchAction(
|
||||||
public void actionPerformed(ActionEvent e) {
|
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text")));
|
||||||
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content));
|
actions.add(new AbstractAction(
|
||||||
ingestDialog.display();
|
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.runIngestMods.text")) {
|
||||||
}
|
@Override
|
||||||
});
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content));
|
||||||
|
ingestDialog.display();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if delete actions should be added
|
//check if delete actions should be added
|
||||||
|
Loading…
x
Reference in New Issue
Block a user