Merge pull request #2508 from wschaeferB/2198-RunIngestModulesWizard

2198 run ingest modules wizard
This commit is contained in:
Richard Cordovano 2017-02-15 16:16:14 -05:00 committed by GitHub
commit 996031e340
30 changed files with 1100 additions and 531 deletions

View File

@ -31,6 +31,14 @@
<specification-version>1.46.1</specification-version> <specification-version>1.46.1</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency>
<code-name-base>org.netbeans.api.templates</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.6.1</specification-version>
</run-dependency>
</dependency>
<dependency> <dependency>
<code-name-base>org.netbeans.core</code-name-base> <code-name-base>org.netbeans.core</code-name-base>
<build-prerequisite/> <build-prerequisite/>
@ -155,6 +163,14 @@
<specification-version>9.7.1</specification-version> <specification-version>9.7.1</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency>
<code-name-base>org.openide.loaders</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.63.2</specification-version>
</run-dependency>
</dependency>
<dependency> <dependency>
<code-name-base>org.openide.modules</code-name-base> <code-name-base>org.openide.modules</code-name-base>
<build-prerequisite/> <build-prerequisite/>

View File

@ -30,8 +30,10 @@ import javax.swing.JButton;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import org.omg.CORBA.BAD_CONTEXT;
import org.openide.WizardDescriptor; import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx; import org.openide.util.HelpCtx;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
@ -47,7 +49,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
* 3rd panel( {@link AddImageWizardAddingProgressPanel}) separate class -jm * 3rd panel( {@link AddImageWizardAddingProgressPanel}) separate class -jm
*/ */
class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDescriptor> { class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDescriptor> {
@Messages("AddImageWizardIngestConfigPanel.name.text=Configure Ingest Modules")
private final IngestJobSettingsPanel ingestJobSettingsPanel; private final IngestJobSettingsPanel ingestJobSettingsPanel;
/** /**
@ -79,6 +81,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
IngestJobSettings ingestJobSettings = new IngestJobSettings(AddImageWizardIngestConfigPanel.class.getCanonicalName()); IngestJobSettings ingestJobSettings = new IngestJobSettings(AddImageWizardIngestConfigPanel.class.getCanonicalName());
showWarnings(ingestJobSettings); showWarnings(ingestJobSettings);
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings); this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings);
this.ingestJobSettingsPanel.setName(Bundle.AddImageWizardIngestConfigPanel_name_text());
} }
/** /**

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -18,7 +18,6 @@
*/ */
package org.sleuthkit.autopsy.datamodel; package org.sleuthkit.autopsy.datamodel;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -27,7 +26,6 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
import org.openide.nodes.Children; import org.openide.nodes.Children;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
@ -40,7 +38,7 @@ import org.sleuthkit.autopsy.directorytree.FileSearchAction;
import org.sleuthkit.autopsy.directorytree.NewWindowViewAction; import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.ModuleContentEvent; import org.sleuthkit.autopsy.ingest.ModuleContentEvent;
import org.sleuthkit.autopsy.ingest.RunIngestModulesDialog; import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.SleuthkitCase.CaseDbQuery; import org.sleuthkit.datamodel.SleuthkitCase.CaseDbQuery;
@ -101,22 +99,14 @@ public class ImageNode extends AbstractContentNode<Image> {
"ImageNode.getActions.openFileSearchByAttr.text=Open File Search by Attributes",}) "ImageNode.getActions.openFileSearchByAttr.text=Open File Search by Attributes",})
public Action[] getActions(boolean context) { public Action[] getActions(boolean context) {
List<Action> actionsList = new ArrayList<Action>(); List<Action> actionsList = new ArrayList<>();
for (Action a : super.getActions(true)) { for (Action a : super.getActions(true)) {
actionsList.add(a); actionsList.add(a);
} }
actionsList.addAll(ExplorerNodeActionVisitor.getActions(content)); actionsList.addAll(ExplorerNodeActionVisitor.getActions(content));
actionsList.add(new FileSearchAction( actionsList.add(new FileSearchAction(
Bundle.ImageNode_getActions_openFileSearchByAttr_text())); Bundle.ImageNode_getActions_openFileSearchByAttr_text()));
actionsList.add(new AbstractAction( actionsList.add(new RunIngestModulesAction(Collections.<Content>singletonList(content)));
Bundle.ImageNode_action_runIngestMods_text()) {
@Override
public void actionPerformed(ActionEvent e) {
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content));
ingestDialog.display();
}
});
actionsList.add(new NewWindowViewAction( actionsList.add(new NewWindowViewAction(
NbBundle.getMessage(this.getClass(), "ImageNode.getActions.viewInNewWin.text"), this)); NbBundle.getMessage(this.getClass(), "ImageNode.getActions.viewInNewWin.text"), this));
return actionsList.toArray(new Action[0]); return actionsList.toArray(new Action[0]);

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -18,7 +18,6 @@
*/ */
package org.sleuthkit.autopsy.datamodel; package org.sleuthkit.autopsy.datamodel;
import java.awt.event.ActionEvent;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
@ -27,7 +26,6 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
@ -38,7 +36,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.directorytree.ExtractAction; import org.sleuthkit.autopsy.directorytree.ExtractAction;
import org.sleuthkit.autopsy.directorytree.FileSearchAction; import org.sleuthkit.autopsy.directorytree.FileSearchAction;
import org.sleuthkit.autopsy.directorytree.NewWindowViewAction; import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
import org.sleuthkit.autopsy.ingest.RunIngestModulesDialog; import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
@ -100,14 +98,7 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode<VirtualDirect
actions.add(null); // creates a menu separator actions.add(null); // creates a menu separator
actions.add(new FileSearchAction( actions.add(new FileSearchAction(
Bundle.ImageNode_getActions_openFileSearchByAttr_text())); Bundle.ImageNode_getActions_openFileSearchByAttr_text()));
actions.add(new AbstractAction( actions.add(new RunIngestModulesAction(Collections.<Content>singletonList(content)));
Bundle.VirtualDirectoryNode_action_runIngestMods_text()) {
@Override
public void actionPerformed(ActionEvent e) {
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content));
ingestDialog.display();
}
});
actions.addAll(ContextMenuExtensionPoint.getActions()); actions.addAll(ContextMenuExtensionPoint.getActions());
return actions.toArray(new Action[0]); return actions.toArray(new Action[0]);
} }

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -18,12 +18,9 @@
*/ */
package org.sleuthkit.autopsy.directorytree; package org.sleuthkit.autopsy.directorytree;
import java.awt.event.ActionEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction;
import javax.swing.Action; import javax.swing.Action;
import org.openide.nodes.FilterNode; import org.openide.nodes.FilterNode;
import org.openide.nodes.Node; import org.openide.nodes.Node;
@ -33,7 +30,7 @@ import org.openide.util.lookup.ProxyLookup;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.AbstractContentNode; import org.sleuthkit.autopsy.datamodel.AbstractContentNode;
import org.sleuthkit.autopsy.datamodel.DisplayableItemNode; import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
import org.sleuthkit.autopsy.ingest.RunIngestModulesDialog; import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Directory; import org.sleuthkit.datamodel.Directory;
@ -108,14 +105,7 @@ 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( actions.add(new RunIngestModulesAction(dir));
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);
@ -138,14 +128,7 @@ class DirectoryTreeFilterNode extends FilterNode {
if (img != null || isRootVD) { if (img != null || isRootVD) {
actions.add(new FileSearchAction( actions.add(new FileSearchAction(
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text"))); NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text")));
actions.add(new AbstractAction( actions.add(new RunIngestModulesAction(dir));
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();
}
});
} }
} }

View File

@ -23,7 +23,6 @@ IngestJob.progress.fileIngest.displayName=Analyzing files from {0}
IngestJob.progress.fileIngest.cancelMessage=Waiting for {0} on {1} IngestJob.progress.fileIngest.cancelMessage=Waiting for {0} on {1}
IngestJob.progress.cancelling={0} (Cancelling...) IngestJob.progress.cancelling={0} (Cancelling...)
IngestJob.cancellationDialog.title=Cancel Ingest IngestJob.cancellationDialog.title=Cancel Ingest
IngestDialog.title.text=Run Ingest Modules
IngestDialog.startButton.title=Start IngestDialog.startButton.title=Start
IngestDialog.closeButton.title=Close IngestDialog.closeButton.title=Close
IngestManager.moduleErr=Module Error IngestManager.moduleErr=Module Error

View File

@ -2,7 +2,6 @@ CTL_IngestMessageTopComponent=\u30e1\u30c3\u30bb\u30fc\u30b8
HINT_IngestMessageTopComponent=\u30e1\u30c3\u30bb\u30fc\u30b8\u30a6\u30a3\u30f3\u30c9\u30a6 HINT_IngestMessageTopComponent=\u30e1\u30c3\u30bb\u30fc\u30b8\u30a6\u30a3\u30f3\u30c9\u30a6
IngestDialog.closeButton.title=\u9589\u3058\u308b IngestDialog.closeButton.title=\u9589\u3058\u308b
IngestDialog.startButton.title=\u958b\u59cb IngestDialog.startButton.title=\u958b\u59cb
IngestDialog.title.text=\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8
IngestJob.progress.cancelling={0}\uff08\u30ad\u30e3\u30f3\u30bb\u30eb\u4e2d\u2026\uff09 IngestJob.progress.cancelling={0}\uff08\u30ad\u30e3\u30f3\u30bb\u30eb\u4e2d\u2026\uff09
IngestJob.progress.dataSourceIngest.displayName={1}\u306e{0} IngestJob.progress.dataSourceIngest.displayName={1}\u306e{0}
IngestJob.progress.fileIngest.displayName={0}\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u6790\u4e2d IngestJob.progress.fileIngest.displayName={0}\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u6790\u4e2d

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2016 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -32,7 +32,7 @@ import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.PANEL_TY
/** /**
* Global options panel for keyword searching. * Global options panel for keyword searching.
*/ */
class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel { public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
@NbBundle.Messages({"IngestOptionsPanel.settingsTab.text=Settings", @NbBundle.Messages({"IngestOptionsPanel.settingsTab.text=Settings",
"IngestOptionsPanel.settingsTab.toolTipText=Settings regarding resources available to ingest.", "IngestOptionsPanel.settingsTab.toolTipText=Settings regarding resources available to ingest.",
@ -52,7 +52,7 @@ class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implements Opti
*/ */
IngestJobEventPropertyChangeListener ingestJobEventsListener; IngestJobEventPropertyChangeListener ingestJobEventsListener;
IngestOptionsPanel() { public IngestOptionsPanel() {
initComponents(); initComponents();
customizeComponents(); customizeComponents();
} }

View File

@ -117,7 +117,7 @@ public final class IngestProfiles {
* *
* @return the description * @return the description
*/ */
String getDescription() { public String getDescription() {
return description; return description;
} }

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2014 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -38,7 +38,7 @@ import org.openide.windows.WindowManager;
*/ */
public final class IngestProgressSnapshotDialog extends JDialog { public final class IngestProgressSnapshotDialog extends JDialog {
private static final String TITLE = NbBundle.getMessage(RunIngestModulesDialog.class, "IngestProgressSnapshotDialog.title.text"); private static final String TITLE = NbBundle.getMessage(IngestProgressSnapshotDialog.class, "IngestProgressSnapshotDialog.title.text");
private static final Dimension DIMENSIONS = new Dimension(500, 300); private static final Dimension DIMENSIONS = new Dimension(500, 300);
/** /**

View File

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[693, 413]"/>
</Property>
</Properties>
<AuxValues> <AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -16,7 +21,7 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="0" pref="691" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
@ -36,6 +41,11 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1"> <Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[664, 400]"/>
</Property>
</Properties>
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
@ -67,7 +77,7 @@
<EmptySpace min="-2" pref="213" max="-2" attributes="0"/> <EmptySpace min="-2" pref="213" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace min="-2" pref="215" max="-2" attributes="0"/> <EmptySpace pref="52" max="32767" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/> <Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
@ -99,7 +109,7 @@
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/> <Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="277" max="32767" attributes="0"/> <EmptySpace pref="257" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>

View File

@ -118,7 +118,7 @@ final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
* *
* @param isEnabled * @param isEnabled
*/ */
void enableButtons(boolean isEnabled){ void enableButtons(boolean isEnabled) {
numberOfFileIngestThreadsComboBox.setEnabled(isEnabled); numberOfFileIngestThreadsComboBox.setEnabled(isEnabled);
jFormattedTextFieldProcTimeOutHrs.setEnabled(isEnabled); jFormattedTextFieldProcTimeOutHrs.setEnabled(isEnabled);
jCheckBoxEnableProcTimeout.setEnabled(isEnabled); jCheckBoxEnableProcTimeout.setEnabled(isEnabled);
@ -144,8 +144,12 @@ final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
jLabelProcessTimeOutUnits = new javax.swing.JLabel(); jLabelProcessTimeOutUnits = new javax.swing.JLabel();
ingestWarningLabel = new javax.swing.JLabel(); ingestWarningLabel = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(693, 413));
jScrollPane1.setBorder(null); jScrollPane1.setBorder(null);
jPanel1.setPreferredSize(new java.awt.Dimension(664, 400));
org.openide.awt.Mnemonics.setLocalizedText(jLabelNumThreads, org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.jLabelNumThreads.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabelNumThreads, org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.jLabelNumThreads.text")); // NOI18N
numberOfFileIngestThreadsComboBox.addActionListener(new java.awt.event.ActionListener() { numberOfFileIngestThreadsComboBox.addActionListener(new java.awt.event.ActionListener() {
@ -205,7 +209,7 @@ final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabelProcessTimeOutUnits))) .addComponent(jLabelProcessTimeOutUnits)))
.addGap(213, 213, 213))) .addGap(213, 213, 213)))
.addGap(215, 215, 215)) .addContainerGap(52, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(ingestWarningLabel) .addComponent(ingestWarningLabel)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
@ -229,7 +233,7 @@ final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
.addComponent(jLabelProcessTimeOutUnits))) .addComponent(jLabelProcessTimeOutUnits)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(ingestWarningLabel) .addComponent(ingestWarningLabel)
.addContainerGap(277, Short.MAX_VALUE)) .addContainerGap(257, Short.MAX_VALUE))
); );
jScrollPane1.setViewportView(jPanel1); jScrollPane1.setViewportView(jPanel1);
@ -238,7 +242,7 @@ final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -246,18 +250,18 @@ final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void numberOfFileIngestThreadsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numberOfFileIngestThreadsComboBoxActionPerformed private void jFormattedTextFieldProcTimeOutHrsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_numberOfFileIngestThreadsComboBoxActionPerformed }//GEN-LAST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed
private void jCheckBoxEnableProcTimeoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxEnableProcTimeoutActionPerformed private void jCheckBoxEnableProcTimeoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxEnableProcTimeoutActionPerformed
jFormattedTextFieldProcTimeOutHrs.setEditable(jCheckBoxEnableProcTimeout.isSelected()); jFormattedTextFieldProcTimeOutHrs.setEditable(jCheckBoxEnableProcTimeout.isSelected());
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_jCheckBoxEnableProcTimeoutActionPerformed }//GEN-LAST:event_jCheckBoxEnableProcTimeoutActionPerformed
private void jFormattedTextFieldProcTimeOutHrsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed private void numberOfFileIngestThreadsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numberOfFileIngestThreadsComboBoxActionPerformed
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed }//GEN-LAST:event_numberOfFileIngestThreadsComboBoxActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel ingestWarningLabel; private javax.swing.JLabel ingestWarningLabel;

View File

@ -32,6 +32,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;

View File

@ -7,6 +7,9 @@
<EtchetBorder/> <EtchetBorder/>
</Border> </Border>
</Property> </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[800, 488]"/>
</Property>
</Properties> </Properties>
<AuxValues> <AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
@ -22,28 +25,27 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="profileListLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="profileListPane" max="32767" attributes="0"/> <Component id="profileListLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0"> <Group type="102" alignment="1" attributes="0">
<Component id="newProfileButton" max="32767" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/> <Component id="profileListPane" alignment="1" min="-2" pref="339" max="-2" attributes="0"/>
<Component id="editProfileButton" max="32767" attributes="0"/> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/> <Component id="newProfileButton" linkSize="5" min="-2" pref="107" max="-2" attributes="0"/>
<Component id="deleteProfileButton" pref="98" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="editProfileButton" linkSize="5" min="-2" pref="107" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="deleteProfileButton" linkSize="5" min="-2" pref="109" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/> <Component id="jSeparator2" min="-2" pref="2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="filterNameLabel" min="-2" pref="36" max="-2" attributes="0"/> <Component id="filterNameLabel" min="-2" pref="36" max="-2" attributes="0"/>
@ -59,33 +61,28 @@
<EmptySpace min="0" pref="0" max="32767" attributes="0"/> <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/> <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/> <Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/> <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group> </Group>
<Component id="filterDescPane" alignment="1" pref="530" max="32767" attributes="0"/> <Component id="filterDescPane" alignment="1" pref="413" max="32767" attributes="0"/>
<Component id="profileDescPane" alignment="1" max="32767" attributes="0"/> <Component id="profileDescPane" alignment="1" pref="413" max="32767" attributes="0"/>
<Component id="selectedModulesPane" alignment="1" max="32767" attributes="0"/> <Component id="selectedModulesPane" alignment="1" pref="413" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</Group> </Group>
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/> <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="330" max="32767" attributes="0"/>
<Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="564" max="32767" attributes="0"/>
</Group>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="profileListLabel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="profileListLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="profileDescLabel" alignment="3" max="32767" attributes="0"/> <Component id="profileDescLabel" alignment="3" max="32767" attributes="0"/>
@ -103,12 +100,12 @@
<Component id="filterDescLabel" min="-2" max="-2" attributes="0"/> <Component id="filterDescLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="filterDescPane" pref="0" max="32767" attributes="0"/> <Component id="filterDescPane" pref="0" max="32767" attributes="0"/>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="selectedModulesLabel" min="-2" max="-2" attributes="0"/> <Component id="selectedModulesLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="selectedModulesPane" max="32767" attributes="0"/> <Component id="selectedModulesPane" max="32767" attributes="0"/>
</Group> </Group>
<Component id="profileListPane" pref="419" max="32767" attributes="0"/> <Component id="profileListPane" pref="415" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/> <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
@ -119,10 +116,7 @@
</Group> </Group>
<EmptySpace min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
</Group> </Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> <Component id="jSeparator2" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jSeparator1" pref="477" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</Group> </Group>
@ -156,16 +150,17 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
<Properties>
<Property name="orientation" type="int" value="1"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="newProfileButton"> <Component class="javax.swing.JButton" name="newProfileButton">
<Properties> <Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/images/add16.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.newProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.newProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[2, 8, 2, 8]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[97, 23]"/> <Dimension value="[97, 23]"/>
</Property> </Property>
@ -182,9 +177,15 @@
</Component> </Component>
<Component class="javax.swing.JButton" name="editProfileButton"> <Component class="javax.swing.JButton" name="editProfileButton">
<Properties> <Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/images/edit16.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.editProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.editProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[2, 8, 2, 8]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[97, 23]"/> <Dimension value="[97, 23]"/>
</Property> </Property>
@ -201,9 +202,18 @@
</Component> </Component>
<Component class="javax.swing.JButton" name="deleteProfileButton"> <Component class="javax.swing.JButton" name="deleteProfileButton">
<Properties> <Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/org/sleuthkit/autopsy/images/delete16.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.deleteProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.deleteProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[2, 8, 2, 8]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[97, 23]"/>
</Property>
</Properties> </Properties>
<Events> <Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteProfileButtonActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteProfileButtonActionPerformed"/>
@ -325,5 +335,10 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JSeparator" name="jSeparator2">
<Properties>
<Property name="orientation" type="int" value="1"/>
</Properties>
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -79,7 +79,6 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
profileListPane = new javax.swing.JScrollPane(); profileListPane = new javax.swing.JScrollPane();
profileList = new javax.swing.JList<>(); profileList = new javax.swing.JList<>();
profileListLabel = new javax.swing.JLabel(); profileListLabel = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
newProfileButton = new javax.swing.JButton(); newProfileButton = new javax.swing.JButton();
editProfileButton = new javax.swing.JButton(); editProfileButton = new javax.swing.JButton();
deleteProfileButton = new javax.swing.JButton(); deleteProfileButton = new javax.swing.JButton();
@ -95,17 +94,19 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
selectedModulesArea = new javax.swing.JTextArea(); selectedModulesArea = new javax.swing.JTextArea();
selectedModulesLabel = new javax.swing.JLabel(); selectedModulesLabel = new javax.swing.JLabel();
ingestWarningLabel = new javax.swing.JLabel(); ingestWarningLabel = new javax.swing.JLabel();
jSeparator2 = new javax.swing.JSeparator();
setBorder(javax.swing.BorderFactory.createEtchedBorder()); setBorder(javax.swing.BorderFactory.createEtchedBorder());
setPreferredSize(new java.awt.Dimension(800, 488));
profileList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); profileList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
profileListPane.setViewportView(profileList); profileListPane.setViewportView(profileList);
org.openide.awt.Mnemonics.setLocalizedText(profileListLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.profileListLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(profileListLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.profileListLabel.text")); // NOI18N
jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL); newProfileButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/add16.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(newProfileButton, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.newProfileButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(newProfileButton, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.newProfileButton.text")); // NOI18N
newProfileButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
newProfileButton.setMaximumSize(new java.awt.Dimension(97, 23)); newProfileButton.setMaximumSize(new java.awt.Dimension(97, 23));
newProfileButton.setMinimumSize(new java.awt.Dimension(97, 23)); newProfileButton.setMinimumSize(new java.awt.Dimension(97, 23));
newProfileButton.setPreferredSize(new java.awt.Dimension(97, 23)); newProfileButton.setPreferredSize(new java.awt.Dimension(97, 23));
@ -115,7 +116,9 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
} }
}); });
editProfileButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/edit16.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(editProfileButton, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.editProfileButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(editProfileButton, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.editProfileButton.text")); // NOI18N
editProfileButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
editProfileButton.setMaximumSize(new java.awt.Dimension(97, 23)); editProfileButton.setMaximumSize(new java.awt.Dimension(97, 23));
editProfileButton.setMinimumSize(new java.awt.Dimension(97, 23)); editProfileButton.setMinimumSize(new java.awt.Dimension(97, 23));
editProfileButton.setPreferredSize(new java.awt.Dimension(97, 23)); editProfileButton.setPreferredSize(new java.awt.Dimension(97, 23));
@ -125,7 +128,10 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
} }
}); });
deleteProfileButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/delete16.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(deleteProfileButton, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.deleteProfileButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(deleteProfileButton, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.deleteProfileButton.text")); // NOI18N
deleteProfileButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
deleteProfileButton.setPreferredSize(new java.awt.Dimension(97, 23));
deleteProfileButton.addActionListener(new java.awt.event.ActionListener() { deleteProfileButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
deleteProfileButtonActionPerformed(evt); deleteProfileButtonActionPerformed(evt);
@ -168,26 +174,28 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"))); // NOI18N ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.ingestWarningLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.ingestWarningLabel.text")); // NOI18N
jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(profileListLabel))
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(profileListPane) .addComponent(profileListLabel)
.addGroup(layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(newProfileButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(profileListPane, javax.swing.GroupLayout.PREFERRED_SIZE, 339, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(newProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(editProfileButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(editProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deleteProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 98, Short.MAX_VALUE))))) .addComponent(deleteProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18) .addGap(6, 6, 6)))
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(filterNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(filterNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -200,25 +208,25 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
.addComponent(profileDescLabel)) .addComponent(profileDescLabel))
.addGap(0, 0, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10) .addGap(8, 8, 8)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(ingestWarningLabel) .addComponent(ingestWarningLabel)
.addGap(0, 0, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))
.addComponent(filterDescPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE) .addComponent(filterDescPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
.addComponent(profileDescPane, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(profileDescPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
.addComponent(selectedModulesPane, javax.swing.GroupLayout.Alignment.TRAILING)))) .addComponent(selectedModulesPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE))))
.addGap(14, 14, 14)) .addGap(12, 12, 12))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(330, Short.MAX_VALUE)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(564, Short.MAX_VALUE)))
); );
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteProfileButton, editProfileButton, newProfileButton});
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(profileListLabel) .addComponent(profileListLabel)
.addComponent(profileDescLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(profileDescLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
@ -238,18 +246,15 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
.addComponent(selectedModulesLabel) .addComponent(selectedModulesLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selectedModulesPane)) .addComponent(selectedModulesPane))
.addComponent(profileListPane, javax.swing.GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)) .addComponent(profileListPane, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE))
.addGap(4, 4, 4) .addGap(4, 4, 4)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(newProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(newProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(editProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(editProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(deleteProfileButton) .addComponent(deleteProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ingestWarningLabel)) .addComponent(ingestWarningLabel))
.addContainerGap()) .addContainerGap())
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 477, Short.MAX_VALUE)))
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@ -356,6 +361,8 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
option = JOptionPane.showConfirmDialog(null, panel, Bundle.ProfileSettingsPanel_title(), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); option = JOptionPane.showConfirmDialog(null, panel, Bundle.ProfileSettingsPanel_title(), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
} while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition()); } while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
if (option == JOptionPane.OK_OPTION) {
// While adding new profile(selectedPRofile == null), if a profile with same name already exists, do not add to the profiles hashMap. // While adding new profile(selectedPRofile == null), if a profile with same name already exists, do not add to the profiles hashMap.
// In case of editing an existing profile(selectedProfile != null), following check is not performed. // In case of editing an existing profile(selectedProfile != null), following check is not performed.
if (this.profiles.containsKey(panel.getProfileName()) && selectedProfile == null) { if (this.profiles.containsKey(panel.getProfileName()) && selectedProfile == null) {
@ -364,7 +371,6 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
panel.getProfileName())); panel.getProfileName()));
return; return;
} }
if (option == JOptionPane.OK_OPTION) {
panel.saveSettings(); panel.saveSettings();
load(); load();
} }
@ -377,7 +383,6 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
@Override @Override
public void store() { public void store() {
saveSettings();
} }
/** /**
@ -444,7 +449,7 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
private javax.swing.JLabel filterNameLabel; private javax.swing.JLabel filterNameLabel;
private javax.swing.JLabel filterNameText; private javax.swing.JLabel filterNameText;
private javax.swing.JLabel ingestWarningLabel; private javax.swing.JLabel ingestWarningLabel;
private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator2;
private javax.swing.JButton newProfileButton; private javax.swing.JButton newProfileButton;
private javax.swing.JTextArea profileDescArea; private javax.swing.JTextArea profileDescArea;
private javax.swing.JLabel profileDescLabel; private javax.swing.JLabel profileDescLabel;

View File

@ -1,53 +0,0 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest;
import java.awt.event.ActionEvent;
import java.util.Collections;
import javax.swing.AbstractAction;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Image;
/**
* This class is used to add the action to the run ingest modules menu item.
* When the data source is pressed, it should open the wizard for ingest
* modules.
*/
final class RunIngestModulesAction extends AbstractAction {
Content dataSource;
/**
* the constructor
*/
public RunIngestModulesAction(Content dataSource) {
this.dataSource = dataSource;
}
/**
* Runs the ingest modules wizard on the data source.
*
* @param e the action event
*/
@Override
public void actionPerformed(ActionEvent e) {
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(dataSource));
ingestDialog.display();
}
}

View File

@ -1,241 +0,0 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
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.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.ingest.IngestJobSettings.IngestType;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Directory;
/**
*
* A dialog box that allows a user to configure and execute analysis of one or
* more data sources with ingest modules or analysis of the contents of a
* directory with file-level ingest modules.
*/
public final class RunIngestModulesDialog extends JDialog {
private static final long serialVersionUID = 1L;
private static final String TITLE = NbBundle.getMessage(RunIngestModulesDialog.class, "IngestDialog.title.text");
private final IngestType ingestType;
private final List<Content> dataSources = new ArrayList<>();
private IngestJobSettingsPanel ingestJobSettingsPanel;
/**
* Constructs a dialog box that allows a user to configure and execute
* analysis of one or more data sources with ingest modules.
*
* @param frame The dialog parent window.
* @param title The title for the dialog.
* @param modal True if the dialog should be modal, false otherwise.
* @param dataSources The data sources to be analyzed.
*/
public RunIngestModulesDialog(JFrame frame, String title, boolean modal, List<Content> dataSources) {
super(frame, title, modal);
this.dataSources.addAll(dataSources);
this.ingestType = IngestType.ALL_MODULES;
}
/**
* Constructs a dialog box that allows a user to configure and execute
* analysis of one or more data sources with ingest modules.
*
* @param dataSources The data sources to be processed.
*/
public RunIngestModulesDialog(List<Content> dataSources) {
this((JFrame) WindowManager.getDefault().getMainWindow(), TITLE, true, dataSources);
}
/**
* Constructs a dialog box that allows a user to configure and execute
* analysis of the contents of a directory with file-level ingest modules.
*
* @param dir
*/
public RunIngestModulesDialog(Directory dir) {
this.dataSources.add(dir);
this.ingestType = IngestType.FILES_ONLY;
}
/**
* Displays this dialog.
*/
public void display() {
setLayout(new BorderLayout());
/**
* Center the dialog.
*/
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();;
/**
* Get the default or saved ingest job settings for this context and use
* them to create and add an ingest job settings panel.
*/
IngestJobSettings ingestJobSettings = new IngestJobSettings(RunIngestModulesDialog.class.getCanonicalName(), this.ingestType);
RunIngestModulesDialog.showWarnings(ingestJobSettings);
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings, dataSources);
setPreferredSize(this.ingestJobSettingsPanel.getPreferredSize());
add(this.ingestJobSettingsPanel, BorderLayout.CENTER);
// Add a start ingest button.
JButton startButton = new JButton(NbBundle.getMessage(this.getClass(), "IngestDialog.startButton.title"));
startButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
doButtonAction(true);
}
});
// Add a close button.
JButton closeButton = new JButton(NbBundle.getMessage(this.getClass(), "IngestDialog.closeButton.title"));
closeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
doButtonAction(false);
}
});
// Put the buttons in their own panel, under the settings panel.
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.TRAILING));
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
buttonPanel.add(startButton);
buttonPanel.add(new javax.swing.Box.Filler(new Dimension(5, 10), new Dimension(5, 10), new Dimension(5, 10)));
buttonPanel.add(closeButton);
add(buttonPanel, BorderLayout.SOUTH);
/**
* Add a handler for when the dialog window is closed directly,
* bypassing the buttons.
*/
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
doButtonAction(false);
}
});
/**
* Show the dialog.
*/
int width = this.getPreferredSize().width;
int height = this.getPreferredSize().height;
setLocation((screenDimension.width - width) / 2, (screenDimension.height - height) / 2);
pack();
setVisible(true);
}
/**
* Closes this dialog.
*/
@Deprecated
public void close() {
setVisible(false);
dispose();
}
/**
* Saves the ingest job settings, optionally starts an ingest job for each
* data source, then closes the dialog
*
* @param startIngestJob True if ingest job(s) should be started, false
* otherwise.
*/
private void doButtonAction(boolean startIngestJob) {
IngestJobSettings ingestJobSettings = this.ingestJobSettingsPanel.getSettings();
ingestJobSettings.save();
showWarnings(ingestJobSettings);
if (startIngestJob) {
IngestManager.getInstance().queueIngestJob(RunIngestModulesDialog.this.dataSources, ingestJobSettings);
}
setVisible(false);
dispose();
}
private static void showWarnings(IngestJobSettings ingestJobSettings) {
List<String> warnings = ingestJobSettings.getWarnings();
if (warnings.isEmpty() == false) {
StringBuilder warningMessage = new StringBuilder();
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
}
}
/**
* Constructs a dialog box that allows a user to configure and execute
* analysis of one or more data sources with ingest modules.
*
* @param frame The dialog parent window.
* @param title The title for the dialog.
* @param modal True if the dialog should be modal, false otherwise.
*
* @deprecated
*/
@Deprecated
public RunIngestModulesDialog(JFrame frame, String title, boolean modal) {
super(frame, title, modal);
this.ingestType = IngestType.ALL_MODULES;
}
/**
* Constructs a dialog box that allows a user to configure and run an ingest
* job on one or more data sources.
*
* @deprecated
*/
@Deprecated
public RunIngestModulesDialog() {
this(new JFrame(TITLE), TITLE, true);
}
/**
* Sets the data sources to be processed.
*
* @param dataSources The data sources.
*
* @deprecated
*/
@Deprecated
public void setDataSources(List<Content> dataSources) {
this.dataSources.clear();
this.dataSources.addAll(dataSources);
}
}

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2015 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -18,7 +18,9 @@
*/ */
package org.sleuthkit.autopsy.ingest; package org.sleuthkit.autopsy.ingest;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
@ -26,19 +28,18 @@ import org.openide.awt.DynamicMenuContent;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
/** /**
* This class is used to populate the list of open dataSources to run ingest on them * This class is used to populate the list of open dataSources to run ingest on
* them
*/ */
final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent { final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent {
/** /**
* Creates main menu/popup menu items. It's called each time a popup menu * Creates main menu/popup menu items. It's called each time a popup menu is
* is constructed and just once for the main menu. * constructed and just once for the main menu. Main menu updates happen
* Main menu updates happen through the synchMenuPresenters() method. * through the synchMenuPresenters() method.
* *
* @return * @return
*/ */
@ -61,7 +62,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent {
String action = dataSources.get(i).getName(); String action = dataSources.get(i).getName();
JMenuItem menuItem = new JMenuItem(action); JMenuItem menuItem = new JMenuItem(action);
menuItem.setActionCommand(action.toUpperCase()); menuItem.setActionCommand(action.toUpperCase());
menuItem.addActionListener(new RunIngestModulesAction(dataSources.get(i))); menuItem.addActionListener(new RunIngestModulesAction(Collections.<Content>singletonList(dataSources.get(i))));
comps[i] = menuItem; comps[i] = menuItem;
} }
// If no dataSources are open, create a disabled empty menu // If no dataSources are open, create a disabled empty menu
@ -95,5 +96,4 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent {
return getMenuPresenters(); return getMenuPresenters();
} }
} }

View File

@ -0,0 +1,2 @@
IngestProfileSelectionPanel.ingestSettingsButton.text=Ingest Settings
IngestProfileSelectionPanel.profileListLabel.text=Select Profile:

View File

@ -0,0 +1 @@
RunIngestModulesAction.name=\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8

View File

@ -0,0 +1,87 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
class IngestModulesConfigWizardPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
@NbBundle.Messages("IngestModulesConfigWizardPanel.name.text=Configure Ingest Modules")
/**
* The visual ingestJobSettingsPanel that displays this panel. If you need
* to access the ingestJobSettingsPanel from this class, just use
* getComponent().
*/
private IngestJobSettingsPanel ingestJobSettingsPanel;
// Get the visual ingestJobSettingsPanel for the panel. In this template, the ingestJobSettingsPanel
// is kept separate. This can be more efficient: if the wizard is created
// but never displayed, or not all panels are displayed, it is better to
// create only those which really need to be visible.
@Override
public IngestJobSettingsPanel getComponent() {
if (ingestJobSettingsPanel == null) {
ingestJobSettingsPanel = new IngestJobSettingsPanel(new IngestJobSettings(RunIngestModulesAction.getDefaultContext()));
}
ingestJobSettingsPanel.setName(Bundle.IngestModulesConfigWizardPanel_name_text());
return ingestJobSettingsPanel;
}
@Override
public HelpCtx getHelp() {
// Show no Help button for this panel:
return HelpCtx.DEFAULT_HELP;
}
@Override
public boolean isValid() {
// If it is always OK to press Next or Finish, then:
return true;
}
@Override
public void addChangeListener(ChangeListener l) {
}
@Override
public void removeChangeListener(ChangeListener l) {
}
@Override
public void readSettings(WizardDescriptor wiz) {
}
@Override
public void storeSettings(WizardDescriptor wiz) {
IngestJobSettings ingestJobSettings = this.ingestJobSettingsPanel.getSettings();
ingestJobSettings.save();
wiz.putProperty("executionContext", RunIngestModulesAction.getDefaultContext()); //NON-NLS
}
@Override
public boolean isFinishPanel() {
return true;
}
}

View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="profileListButtonGroup">
<AuxValues>
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="IngestProfileSelectionPanel_buttonGroup1"/>
</AuxValues>
</Component>
</NonVisualComponents>
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[5750, 3000]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[625, 450]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="profileListScrollPane" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="ingestSettingsButton" alignment="0" min="-2" pref="128" max="-2" attributes="0"/>
<Component id="profileListLabel" alignment="0" min="-2" pref="102" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="523" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="profileListLabel" min="-2" pref="27" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="profileListScrollPane" pref="385" max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="ingestSettingsButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="ingestSettingsButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/runIngestModuleWizard/Bundle.properties" key="IngestProfileSelectionPanel.ingestSettingsButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ingestSettingsButtonActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="profileListScrollPane">
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="profileListScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="profileListPanel">
<Properties>
<Property name="autoscrolls" type="boolean" value="true"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JPanel()"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="profileListLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/ingest/runIngestModuleWizard/Bundle.properties" key="IngestProfileSelectionPanel.profileListLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>

View File

@ -0,0 +1,289 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.awt.Color;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Collections;
import java.util.List;
import static javax.swing.Box.createVerticalGlue;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog;
import org.sleuthkit.autopsy.ingest.IngestOptionsPanel;
import org.sleuthkit.autopsy.ingest.IngestProfiles;
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
/**
* Visual panel for the choosing of ingest profiles by the user when running
* ingest.
*/
final class IngestProfileSelectionPanel extends JPanel implements ItemListener {
@Messages({"IngestProfileSelectionPanel.customSettings.name=Custom Settings",
"IngestProfileSelectionPanel.customSettings.description=configure individual module settings in next step of wizard"})
private static final String CUSTOM_SETTINGS_DISPLAY_NAME = Bundle.IngestProfileSelectionPanel_customSettings_name();
private static final String CUSTOM_SETTINGS_DESCRIPTION = Bundle.IngestProfileSelectionPanel_customSettings_description();
private final IngestProfileSelectionWizardPanel wizardPanel;
private String selectedProfile;
private List<IngestProfile> profiles = Collections.emptyList();
/**
* Creates new IngestProfileSelectionPanel
*
* @param panel - the WizardPanel which contains this panel
* @param lastSelectedProfile - the profile that will be selected initially
*/
IngestProfileSelectionPanel(IngestProfileSelectionWizardPanel panel, String lastSelectedProfile) {
initComponents();
wizardPanel = panel;
selectedProfile = lastSelectedProfile;
populateListOfCheckboxes();
}
/**
* Returns the profile that is currently selected in this panel
*
* @return selectedProfile
*/
String getLastSelectedProfile() {
return selectedProfile;
}
/**
* Adds a radio button for custom settings as well as one for each profile
* that has been created to the panel containing them.
*/
private void populateListOfCheckboxes() {
profiles = getProfiles();
GridBagLayout gridBagLayout = new GridBagLayout();
GridBagConstraints constraints = new GridBagConstraints();
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.weighty = .0;
constraints.anchor = GridBagConstraints.FIRST_LINE_START;
addRadioButton(CUSTOM_SETTINGS_DISPLAY_NAME, RunIngestModulesAction.getDefaultContext(), CUSTOM_SETTINGS_DESCRIPTION, gridBagLayout, constraints);
for (IngestProfile profile : profiles) {
constraints.weightx = 0;
constraints.gridy++;
constraints.gridx = 0;
addRadioButton(profile.toString(), profile.toString(), profile.getDescription(), gridBagLayout, constraints);
}
//Add vertical glue at the bottom of the scroll panel so spacing
//between elements is less dependent on the number of elements
constraints.gridy++;
constraints.gridx = 0;
constraints.weighty = 1;
Component vertGlue = createVerticalGlue();
profileListPanel.add(vertGlue);
gridBagLayout.setConstraints(vertGlue, constraints);
profileListPanel.setLayout(gridBagLayout);
}
/**
* Creates and configures a single radio button before adding it to both the
* button group and the panel.
*
* @param profileDisplayName - the name of the profile the user should see
* @param profileContextName - the name the profile will be recognized as
* programmatically
* @param profileDesc - the description of the profile
*/
private void addRadioButton(String profileDisplayName, String profileContextName, String profileDesc, GridBagLayout layout, GridBagConstraints constraints) {
String displayText = profileDisplayName + " - " + profileDesc;
JRadioButton myRadio = new JRadioButton();
//Using a JTextArea as though it is a label in order to get multi-line support
JTextArea myLabel = new JTextArea(displayText);
Color gray = new Color(240, 240, 240); //matches background of panel
myLabel.setBackground(gray);
myLabel.setEditable(false);
myLabel.setWrapStyleWord(true);
myLabel.setLineWrap(true);
myRadio.setName(profileContextName);
myRadio.setToolTipText(profileDesc);
myRadio.addItemListener(this);
if (profileContextName.equals(selectedProfile)) {
myRadio.setSelected(true);
}
profileListButtonGroup.add(myRadio);
profileListPanel.add(myRadio);
layout.setConstraints(myRadio, constraints);
constraints.gridx++;
constraints.weightx = 1;
profileListPanel.add(myLabel);
layout.setConstraints(myLabel, constraints);
}
/**
* Getter for the list of profiles
*
* @return profiles
*/
private List<IngestProfile> getProfiles() {
if (profiles.isEmpty()) {
fetchProfileList();
}
return profiles;
}
/**
* Remove everything from the list of checkboxes.
*/
private void clearListOfCheckBoxes() {
profileListButtonGroup = new javax.swing.ButtonGroup();
profileListPanel.removeAll();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
profileListButtonGroup = new javax.swing.ButtonGroup();
ingestSettingsButton = new javax.swing.JButton();
profileListScrollPane = new javax.swing.JScrollPane();
profileListPanel = new javax.swing.JPanel();
profileListLabel = new javax.swing.JLabel();
setMaximumSize(new java.awt.Dimension(5750, 3000));
setPreferredSize(new java.awt.Dimension(625, 450));
org.openide.awt.Mnemonics.setLocalizedText(ingestSettingsButton, org.openide.util.NbBundle.getMessage(IngestProfileSelectionPanel.class, "IngestProfileSelectionPanel.ingestSettingsButton.text")); // NOI18N
ingestSettingsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ingestSettingsButtonActionPerformed(evt);
}
});
profileListScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
profileListPanel.setAutoscrolls(true);
profileListPanel.setLayout(new java.awt.GridBagLayout());
profileListScrollPane.setViewportView(profileListPanel);
org.openide.awt.Mnemonics.setLocalizedText(profileListLabel, org.openide.util.NbBundle.getMessage(IngestProfileSelectionPanel.class, "IngestProfileSelectionPanel.profileListLabel.text")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(profileListScrollPane)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ingestSettingsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(profileListLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 523, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(profileListLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(profileListScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ingestSettingsButton)
.addGap(18, 18, 18))
);
}// </editor-fold>//GEN-END:initComponents
/**
* Opens up a dialog with an IngestOptionsPanel so the user can modify any
* settings from that options panel.
*
* @param evt the button press
*/
private void ingestSettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ingestSettingsButtonActionPerformed
final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true);
IngestOptionsPanel ingestOptions = new IngestOptionsPanel();
ingestOptions.load();
dialog.addApplyButtonListener(
(ActionEvent e) -> {
ingestOptions.store();
clearListOfCheckBoxes();
fetchProfileList();
profileListPanel.revalidate();
profileListPanel.repaint();
populateListOfCheckboxes();
dialog.close();
}
);
dialog.display(ingestOptions);
}//GEN-LAST:event_ingestSettingsButtonActionPerformed
boolean isLastPanel = false;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton ingestSettingsButton;
private javax.swing.ButtonGroup profileListButtonGroup;
private javax.swing.JLabel profileListLabel;
private javax.swing.JPanel profileListPanel;
private javax.swing.JScrollPane profileListScrollPane;
// End of variables declaration//GEN-END:variables
/**
* Listens for changes and checks the currently selected radio button if
* custom settings button is enabled it enables the next button, otherwise
* it enables the Finish button.
*
* @param e
*/
@Override
public void itemStateChanged(ItemEvent e) {
for (Component rButton : profileListPanel.getComponents()) {
if (rButton instanceof JRadioButton){
JRadioButton jrb = (JRadioButton) rButton;
if (jrb.isSelected()) {
selectedProfile = jrb.getName();
break;
}
}
}
boolean wasLastPanel = isLastPanel;
isLastPanel = !selectedProfile.equals(RunIngestModulesAction.getDefaultContext());
wizardPanel.fireChangeEvent();
this.firePropertyChange("LAST_ENABLED", wasLastPanel, isLastPanel); //NON-NLS
}
/**
* Get all the currently existing ingest profiles.
*/
private void fetchProfileList() {
profiles = IngestProfiles.getIngestProfiles();
}
}

View File

@ -0,0 +1,124 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.util.HashSet;
import java.util.Set;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
/**
* The first wizard panel of the run ingest modules wizard. Displays the profile
* selection panel and is only created when profiles exist.
*
*/
class IngestProfileSelectionWizardPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
@Messages("IngestProfileWizardPanel.panelName=Ingest Profile Selection")
private final Set<ChangeListener> listeners = new HashSet<>(1);
private final static String PROP_LASTPROFILE_NAME = "RIMW_LASTPROFILE_NAME"; //NON-NLS
private final static String LAST_PROFILE_PROPERTIES_FILE = "IngestProfileSelectionPanel"; //NON-NLS
/**
* The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent().
*/
private IngestProfileSelectionPanel component;
private String lastProfileUsed;
// Get the visual component for the panel. In this template, the component
// is kept separate. This can be more efficient: if the wizard is created
// but never displayed, or not all panels are displayed, it is better to
// create only those which really need to be visible.
@Override
public IngestProfileSelectionPanel getComponent() {
if (component == null) {
if (ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME) == null
|| ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME).isEmpty()) {
lastProfileUsed = RunIngestModulesAction.getDefaultContext();
} else {
lastProfileUsed = ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME);
}
component = new IngestProfileSelectionPanel(this, lastProfileUsed);
component.setName(Bundle.IngestProfileWizardPanel_panelName());
}
return component;
}
@Override
public HelpCtx getHelp() {
// Show no Help button for this panel:
return HelpCtx.DEFAULT_HELP;
}
@Override
public boolean isValid() {
// If it is always OK to press Next or Finish, then:
return true;
}
/**
* Fires a change event to notify listeners that changes have taken place.
*/
protected final void fireChangeEvent() {
Set<ChangeListener> ls;
synchronized (listeners) {
ls = new HashSet<>(listeners);
}
ChangeEvent ev = new ChangeEvent(this);
for (ChangeListener l : ls) {
l.stateChanged(ev);
}
}
@Override
public void addChangeListener(ChangeListener l) {
synchronized (listeners) {
listeners.add(l);
}
}
@Override
public void removeChangeListener(ChangeListener l) {
synchronized (listeners) {
listeners.remove(l);
}
}
@Override
public void readSettings(WizardDescriptor wiz) {
}
@Override
public void storeSettings(WizardDescriptor wiz) {
lastProfileUsed = component.getLastSelectedProfile();
wiz.putProperty("executionContext", lastProfileUsed); //NON-NLS
ModuleSettings.setConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME, lastProfileUsed);
}
@Override
public boolean isFinishPanel() {
return component.isLastPanel;
}
}

View File

@ -0,0 +1,120 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.awt.event.ActionEvent;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JOptionPane;
import org.openide.DialogDisplayer;
import org.openide.WizardDescriptor;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Directory;
/**
* This class is used to add the action to the run ingest modules menu item.
* When the data source is pressed, it should open the wizard for ingest
* modules.
*/
public final class RunIngestModulesAction extends AbstractAction {
@Messages("RunIngestModulesAction.name=Run Ingest Modules")
//'dialog' context name required so existing settings do not need to be reconfigured
private static final String DEFAULT_CONTEXT = "org.sleuthkit.autopsy.ingest.RunIngestModulesDialog";
/**
* Returns the name of the default context which will be used when profiles
* are not available.
*
* @return the DEFAULT_CONTEXT
*/
static String getDefaultContext() {
return DEFAULT_CONTEXT;
}
private final List<Content> dataSources = new ArrayList<>();
private final IngestJobSettings.IngestType ingestType;
/**
* Creates an action which will make a run ingest modules wizard when it is
* performed.
*
* @param dataSources - the data sources you want to run ingest on
*/
public RunIngestModulesAction(List<Content> dataSources) {
this.putValue(Action.NAME, Bundle.RunIngestModulesAction_name());
this.dataSources.addAll(dataSources);
this.ingestType = IngestJobSettings.IngestType.ALL_MODULES;
}
/**
* Creates an action which will make a run ingest modules wizard when it is
* performed.
*
* @param dir - the directory you want to run ingest on
*/
public RunIngestModulesAction(Directory dir) {
this.putValue(Action.NAME, Bundle.RunIngestModulesAction_name());
this.dataSources.add(dir);
this.ingestType = IngestJobSettings.IngestType.FILES_ONLY;
}
/**
* Opens a run ingest modules wizard with the list of data sources.
*
* @param e the action event
*/
@Override
public void actionPerformed(ActionEvent e) {
WizardDescriptor wiz = new WizardDescriptor(new RunIngestModulesWizardIterator());
// {0} will be replaced by WizardDescriptor.Panel.getComponent().getName()
wiz.setTitleFormat(new MessageFormat("{0}"));
wiz.setTitle(Bundle.RunIngestModulesAction_name());
if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
String executionContext = (String) wiz.getProperty("executionContext"); //NON-NLS
IngestJobSettings ingestJobSettings = new IngestJobSettings(executionContext, this.ingestType);
showWarnings(ingestJobSettings);
IngestManager.getInstance().queueIngestJob(this.dataSources, ingestJobSettings);
}
}
/**
* Display any warnings that the ingestJobSettings have.
*
* @param ingestJobSettings
*/
private static void showWarnings(IngestJobSettings ingestJobSettings) {
List<String> warnings = ingestJobSettings.getWarnings();
if (warnings.isEmpty() == false) {
StringBuilder warningMessage = new StringBuilder();
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
}
}
}

View File

@ -0,0 +1,122 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import javax.swing.JComponent;
import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.sleuthkit.autopsy.ingest.IngestProfiles;
/**
* Iterator class for creating a wizard for run ingest modules.
*
*/
final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
private int index;
private List<WizardDescriptor.FinishablePanel<WizardDescriptor>> panels;
/**
* Gets the list of panels used by this wizard for iterating over.
* Constructing it when it is null.
*
* @return panels - the list of of WizardDescriptor panels
*/
private List<WizardDescriptor.FinishablePanel<WizardDescriptor>> getPanels() {
if (panels == null) {
panels = new ArrayList<>();
List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles();
if (!profiles.isEmpty()) {
panels.add(new IngestProfileSelectionWizardPanel());
}
panels.add(new IngestModulesConfigWizardPanel());
String[] steps = new String[panels.size()];
for (int i = 0; i < panels.size(); i++) {
Component c = panels.get(i).getComponent();
// Default step name to component name of panel.
steps[i] = c.getName();
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true);
}
}
}
return panels;
}
@Override
public WizardDescriptor.FinishablePanel<WizardDescriptor> current() {
return getPanels().get(index);
}
@Override
public String name() {
return index + 1 + ". from " + getPanels().size();
}
@Override
public boolean hasNext() {
return (index < getPanels().size() - 1) && !current().isFinishPanel();
}
@Override
public boolean hasPrevious() {
return index > 0;
}
@Override
public void nextPanel() {
if (!hasNext()) {
throw new NoSuchElementException();
}
index++;
}
@Override
public void previousPanel() {
if (!hasPrevious()) {
throw new NoSuchElementException();
}
index--;
}
// If nothing unusual changes in the middle of the wizard, simply:
@Override
public void addChangeListener(ChangeListener l) {
}
@Override
public void removeChangeListener(ChangeListener l) {
}
// If something changes dynamically (besides moving between panels), e.g.
// the number of panels changes in response to user input, then use
// ChangeSupport to implement add/removeChangeListener and call fireChange
// when needed
}

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2016 Basis Technology Corp. * Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -32,7 +32,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.ingest.RunIngestModulesDialog; import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
import org.sleuthkit.autopsy.modules.filetypeid.FileType.Signature; import org.sleuthkit.autopsy.modules.filetypeid.FileType.Signature;
/** /**
@ -43,7 +43,7 @@ final class AddFileTypeSignatureDialog extends JDialog {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final AddFileTypeSignaturePanel addFileTypeSigPanel; private final AddFileTypeSignaturePanel addFileTypeSigPanel;
private static final String TITLE = NbBundle.getMessage(RunIngestModulesDialog.class, "IngestDialog.title.text"); private static final String TITLE = NbBundle.getMessage(RunIngestModulesAction.class, "RunIngestModulesAction.name");
private Signature signature; private Signature signature;
private BUTTON_PRESSED result; private BUTTON_PRESSED result;

View File

@ -1,5 +1,5 @@
#Updated by build script #Updated by build script
#Mon, 02 Jan 2017 18:41:13 -0500 #Mon, 30 Jan 2017 13:39:12 -0500
LBL_splash_window_title=Starting Autopsy LBL_splash_window_title=Starting Autopsy
SPLASH_HEIGHT=314 SPLASH_HEIGHT=314
SPLASH_WIDTH=538 SPLASH_WIDTH=538

View File

@ -1,4 +1,4 @@
#Updated by build script #Updated by build script
#Mon, 02 Jan 2017 18:41:13 -0500 #Mon, 30 Jan 2017 13:39:12 -0500
CTL_MainWindow_Title=Autopsy 4.3.0 CTL_MainWindow_Title=Autopsy 4.3.0
CTL_MainWindow_Title_No_Project=Autopsy 4.3.0 CTL_MainWindow_Title_No_Project=Autopsy 4.3.0