19package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
21import java.awt.Cursor;
22import java.awt.event.ActionEvent;
23import java.text.MessageFormat;
24import java.util.ArrayList;
26import java.util.logging.Level;
27import javax.swing.AbstractAction;
28import javax.swing.Action;
29import javax.swing.JOptionPane;
30import javax.swing.RootPaneContainer;
31import org.openide.DialogDisplayer;
32import org.openide.WizardDescriptor;
33import org.openide.util.NbBundle.Messages;
34import org.openide.windows.WindowManager;
35import org.sleuthkit.autopsy.coreutils.Logger;
36import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
37import org.sleuthkit.autopsy.datamodel.SpecialDirectoryNode;
38import org.sleuthkit.autopsy.ingest.IngestJobSettings;
39import org.sleuthkit.autopsy.ingest.IngestManager;
40import org.sleuthkit.datamodel.AbstractFile;
41import org.sleuthkit.datamodel.Content;
42import org.sleuthkit.datamodel.TskCoreException;
50 @Messages(
"RunIngestModulesAction.name=Run Ingest Modules")
58 private static final String
EXECUTION_CONTEXT =
"org.sleuthkit.autopsy.ingest.RunIngestModulesDialog";
69 List<String> warnings = ingestJobSettings.getWarnings();
70 if (warnings.isEmpty() ==
false) {
71 StringBuilder warningMessage = new StringBuilder(1024);
72 for (String warning : warnings) {
73 warningMessage.append(warning).append(
"\n");
75 JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), warningMessage.toString());
86 this.putValue(Action.NAME, Bundle.RunIngestModulesAction_name());
89 this.parentFile =
null;
99 this.putValue(Action.NAME, Bundle.RunIngestModulesAction_name());
104 }
catch (TskCoreException ex) {
105 this.setEnabled(
false);
106 logger.log(Level.SEVERE, String.format(
"Failed to get children count for parent file %s (objId=%d), RunIngestModulesAction disabled",
parentFile.getName(),
parentFile.getId()), ex);
117 "RunIngestModulesAction.actionPerformed.errorMessage=Error querying the case database for the selected item."
126 RootPaneContainer root = (RootPaneContainer) WindowManager.getDefault().getMainWindow();
127 root.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
128 root.getGlassPane().setVisible(
true);
130 WizardDescriptor wiz =
new WizardDescriptor(wizard);
131 wiz.setTitleFormat(
new MessageFormat(
"{0}"));
132 wiz.setTitle(Bundle.RunIngestModulesAction_name());
133 root.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
134 root.getGlassPane().setVisible(
false);
135 if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
142 Content dataSource =
parentFile.getDataSource();
143 List<Content> children =
parentFile.getChildren();
144 List<AbstractFile> files =
new ArrayList<>();
145 for (Content child : children) {
146 if (child instanceof AbstractFile) {
147 files.add((AbstractFile) child);
150 if (!files.isEmpty()) {
153 }
catch (TskCoreException ex) {
154 logger.log(Level.SEVERE, String.format(
"Failed to get data source or children for parent file %s (objId=%d), action failed",
parentFile.getName(),
parentFile.getId()), ex);
162 public Object
clone() throws CloneNotSupportedException {
163 throw new CloneNotSupportedException(
"Clone is not supported for the RunIngestModulesAction");
static void error(String message)
static synchronized IngestManager getInstance()
void queueIngestJob(Collection< Content > dataSources, IngestJobSettings settings)
RunIngestModulesAction(AbstractFile parentFile)
final List< Content > dataSources
static final String EXECUTION_CONTEXT
static final long serialVersionUID
static final Logger logger
final AbstractFile parentFile
static void showWarnings(IngestJobSettings ingestJobSettings)
RunIngestModulesAction(List< Content > dataSources)
final IngestJobSettings.IngestType ingestType
void actionPerformed(ActionEvent e)