Merge pull request #2509 from wschaeferB/2199-ProfilesInAddDataWizard

2199 profiles in add data wizard
This commit is contained in:
Richard Cordovano 2017-02-16 13:01:50 -05:00 committed by GitHub
commit 50be46cdee
23 changed files with 285 additions and 123 deletions

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");
@ -30,6 +30,7 @@ import org.openide.util.HelpCtx;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescriptorPanel;
/** /**
* The final panel of the add image wizard. It displays a progress bar and * The final panel of the add image wizard. It displays a progress bar and
@ -39,7 +40,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgress
* {@link AddImageWizardIngestConfigPanel} (which is a bit weird if you ask m * {@link AddImageWizardIngestConfigPanel} (which is a bit weird if you ask m
* -jm) * -jm)
*/ */
class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> { class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel {
/** /**
* flag to indicate that the image adding process is finished and this panel * flag to indicate that the image adding process is finished and this panel
@ -53,7 +54,7 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePa
private AddImageWizardAddingProgressVisual component; private AddImageWizardAddingProgressVisual component;
private final Set<ChangeListener> listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.0 private final Set<ChangeListener> listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.0
private DSPProgressMonitorImpl dspProgressMonitorImpl = new DSPProgressMonitorImpl(); private final DSPProgressMonitorImpl dspProgressMonitorImpl = new DSPProgressMonitorImpl();
public DSPProgressMonitorImpl getDSPProgressMonitorImpl() { public DSPProgressMonitorImpl getDSPProgressMonitorImpl() {
return dspProgressMonitorImpl; return dspProgressMonitorImpl;
@ -192,7 +193,7 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePa
protected final void fireChangeEvent() { protected final void fireChangeEvent() {
Iterator<ChangeListener> it; Iterator<ChangeListener> it;
synchronized (listeners) { synchronized (listeners) {
it = new HashSet<ChangeListener>(listeners).iterator(); it = new HashSet<>(listeners).iterator();
} }
ChangeEvent ev = new ChangeEvent(this); ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) { while (it.hasNext()) {
@ -239,8 +240,4 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePa
getComponent().showErrors(errorString, critical); getComponent().showErrors(errorString, critical);
} }
@Override
public boolean isFinishPanel() {
return true;
}
} }

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011 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");
@ -33,18 +33,19 @@ import org.openide.util.HelpCtx;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import java.awt.Cursor; import java.awt.Cursor;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescriptorPanel;
/** /**
* The "Add Image" wizard panel1 handling the logic of selecting image file(s) * The "Add Image" wizard panel1 handling the logic of selecting image file(s)
* to add to Case, and pick the time zone. * to add to Case, and pick the time zone.
*/ */
class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<WizardDescriptor>, PropertyChangeListener { class AddImageWizardChooseDataSourcePanel extends ShortcutWizardDescriptorPanel implements PropertyChangeListener {
/** /**
* The visual component that displays this panel. If you need to access the * The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent(). * component from this class, just use getComponent().
*/ */
private AddImageWizardAddingProgressPanel progressPanel; private final AddImageWizardAddingProgressPanel progressPanel;
private AddImageWizardChooseDataSourceVisual component; private AddImageWizardChooseDataSourceVisual component;
private boolean isNextEnable = false; private boolean isNextEnable = false;
private static final String PROP_LASTDATASOURCE_PATH = "LBL_LastDataSource_PATH"; //NON-NLS private static final String PROP_LASTDATASOURCE_PATH = "LBL_LastDataSource_PATH"; //NON-NLS
@ -122,7 +123,7 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<Wiza
isNextEnable = isEnabled; isNextEnable = isEnabled;
fireChangeEvent(); fireChangeEvent();
} }
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0 private final Set<ChangeListener> listeners = new HashSet<>(1); // or can use ChangeSupport in NB 6.0
/** /**
* Adds a listener to changes of the panel's validity. * Adds a listener to changes of the panel's validity.
@ -155,7 +156,7 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<Wiza
protected final void fireChangeEvent() { protected final void fireChangeEvent() {
Iterator<ChangeListener> it; Iterator<ChangeListener> it;
synchronized (listeners) { synchronized (listeners) {
it = new HashSet<ChangeListener>(listeners).iterator(); it = new HashSet<>(listeners).iterator();
} }
ChangeEvent ev = new ChangeEvent(this); ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) { while (it.hasNext()) {
@ -218,8 +219,6 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<Wiza
*/ */
@Override @Override
public void storeSettings(WizardDescriptor settings) { public void storeSettings(WizardDescriptor settings) {
return;
} }
/** /**

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");
@ -30,17 +30,19 @@ 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.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;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.ingest.IngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.IngestProfileSelectionWizardPanel;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescriptorPanel;
/** /**
* second panel of add image wizard, allows user to configure ingest modules. * second panel of add image wizard, allows user to configure ingest modules.
@ -48,20 +50,19 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
* TODO: review this for dead code. think about moving logic of adding image to * TODO: review this for dead code. think about moving logic of adding image to
* 3rd panel( {@link AddImageWizardAddingProgressPanel}) separate class -jm * 3rd panel( {@link AddImageWizardAddingProgressPanel}) separate class -jm
*/ */
class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDescriptor> { class AddImageWizardIngestConfigPanel extends ShortcutWizardDescriptorPanel {
@Messages("AddImageWizardIngestConfigPanel.name.text=Configure Ingest Modules")
private final IngestJobSettingsPanel ingestJobSettingsPanel;
@Messages("AddImageWizardIngestConfigPanel.name.text=Configure Ingest Modules")
private IngestJobSettingsPanel ingestJobSettingsPanel;
/** /**
* The visual component that displays this panel. If you need to access the * The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent(). * component from this class, just use getComponent().
*/ */
private Component component = null; private Component component = null;
private String lastProfileUsed = AddImageWizardIngestConfigPanel.class.getCanonicalName();
private final List<Content> newContents = Collections.synchronizedList(new ArrayList<Content>()); private final List<Content> newContents = Collections.synchronizedList(new ArrayList<Content>());
private boolean ingested = false; private boolean ingested = false;
private boolean readyToIngest = false; private boolean readyToIngest = false;
// task that will clean up the created database file if the wizard is cancelled before it finishes // task that will clean up the created database file if the wizard is cancelled before it finishes
private AddImageAction.CleanupTask cleanupTask; private AddImageAction.CleanupTask cleanupTask;
@ -77,11 +78,12 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
this.addImageAction = action; this.addImageAction = action;
this.progressPanel = proPanel; this.progressPanel = proPanel;
this.dataSourcePanel = dsPanel; this.dataSourcePanel = dsPanel;
IngestJobSettings ingestJobSettings = new IngestJobSettings(AddImageWizardIngestConfigPanel.class.getCanonicalName()); IngestJobSettings ingestJobSettings = new IngestJobSettings(AddImageWizardIngestConfigPanel.class.getCanonicalName());
showWarnings(ingestJobSettings); showWarnings(ingestJobSettings);
//When this panel is viewed by the user it will always be displaying the
//IngestJobSettingsPanel with the AddImageWizardIngestConfigPanel.class.getCanonicalName();
this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings); this.ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings);
this.ingestJobSettingsPanel.setName(Bundle.AddImageWizardIngestConfigPanel_name_text());
} }
/** /**
@ -96,6 +98,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
public Component getComponent() { public Component getComponent() {
if (component == null) { if (component == null) {
component = new AddImageWizardIngestConfigVisual(this.ingestJobSettingsPanel); component = new AddImageWizardIngestConfigVisual(this.ingestJobSettingsPanel);
component.setName(Bundle.AddImageWizardIngestConfigPanel_name_text());
} }
return component; return component;
} }
@ -169,12 +172,10 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
settings.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, WizardDescriptor.FINISH_OPTION, cancel}); settings.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, WizardDescriptor.FINISH_OPTION, cancel});
cleanupTask = null; cleanupTask = null;
readyToIngest = false; readyToIngest = false;
newContents.clear(); newContents.clear();
// Start processing the data source by handing it off to the selected DSP, // Start processing the data source by handing it off to the selected DSP,
// so it gets going in the background while the user is still picking the Ingest modules // so it gets going in the background while the user is still picking the Ingest modules
startDataSourceProcessing(settings); startDataSourceProcessing();
} }
/** /**
@ -188,7 +189,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
*/ */
@Override @Override
public void storeSettings(WizardDescriptor settings) { public void storeSettings(WizardDescriptor settings) {
IngestJobSettings ingestJobSettings = this.ingestJobSettingsPanel.getSettings(); IngestJobSettings ingestJobSettings = ingestJobSettingsPanel.getSettings();
ingestJobSettings.save(); ingestJobSettings.save();
showWarnings(ingestJobSettings); showWarnings(ingestJobSettings);
@ -208,6 +209,28 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
} }
} }
/**
* Loads the proper settings for this panel to use the previously selected
* Ingest profile when this panel would be skipped due to a profile being
* chosen.
*/
@Override
public void processThisPanelBeforeSkipped() {
if (!(ModuleSettings.getConfigSetting(IngestProfileSelectionWizardPanel.getLastProfilePropertiesFile(), AddImageWizardIterator.getPropLastprofileName()) == null)
&& !ModuleSettings.getConfigSetting(IngestProfileSelectionWizardPanel.getLastProfilePropertiesFile(), AddImageWizardIterator.getPropLastprofileName()).isEmpty()) {
lastProfileUsed = ModuleSettings.getConfigSetting(IngestProfileSelectionWizardPanel.getLastProfilePropertiesFile(), AddImageWizardIterator.getPropLastprofileName());
}
//Because this panel kicks off ingest during the wizard we need to
//swap out the ingestJobSettings for the ones of the chosen profile before
//we start processing
IngestJobSettings ingestJobSettings = new IngestJobSettings(lastProfileUsed);
ingestJobSettingsPanel = new IngestJobSettingsPanel(ingestJobSettings);
showWarnings(ingestJobSettings);
component = new AddImageWizardIngestConfigVisual(this.ingestJobSettingsPanel);
readyToIngest = true;
startDataSourceProcessing();
}
/** /**
* Start ingest after verifying we have a new image, we are ready to ingest, * Start ingest after verifying we have a new image, we are ready to ingest,
* and we haven't already ingested. * and we haven't already ingested.
@ -224,7 +247,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
* Starts the Data source processing by kicking off the selected * Starts the Data source processing by kicking off the selected
* DataSourceProcessor * DataSourceProcessor
*/ */
private void startDataSourceProcessing(WizardDescriptor settings) { private void startDataSourceProcessing() {
final UUID dataSourceId = UUID.randomUUID(); final UUID dataSourceId = UUID.randomUUID();
// Add a cleanup task to interrupt the background process if the // Add a cleanup task to interrupt the background process if the

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011 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");
@ -26,6 +26,9 @@ import javax.swing.JComponent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor; import org.openide.WizardDescriptor;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.ingest.IngestProfiles;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.IngestProfileSelectionWizardPanel;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescriptorPanel;
/** /**
* The iterator class for the "Add Image" wizard panel. This class is used to * The iterator class for the "Add Image" wizard panel. This class is used to
@ -34,8 +37,10 @@ import org.openide.util.NbBundle;
class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> { class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
private int index = 0; private int index = 0;
private List<WizardDescriptor.Panel<WizardDescriptor>> panels; private List<ShortcutWizardDescriptorPanel> panels;
private AddImageAction action; private final AddImageAction action;
private int progressPanelIndex;
private final static String PROP_LASTPROFILE_NAME = "AIW_LASTPROFILE_NAME"; //NON-NLS
AddImageWizardIterator(AddImageAction action) { AddImageWizardIterator(AddImageAction action) {
this.action = action; this.action = action;
@ -45,19 +50,22 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
* Initialize panels representing individual wizard's steps and sets various * Initialize panels representing individual wizard's steps and sets various
* properties for them influencing wizard appearance. * properties for them influencing wizard appearance.
*/ */
private List<WizardDescriptor.Panel<WizardDescriptor>> getPanels() { private List<ShortcutWizardDescriptorPanel> getPanels() {
if (panels == null) { if (panels == null) {
panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>(); panels = new ArrayList<>();
AddImageWizardAddingProgressPanel progressPanel = new AddImageWizardAddingProgressPanel(); AddImageWizardAddingProgressPanel progressPanel = new AddImageWizardAddingProgressPanel();
AddImageWizardChooseDataSourcePanel dsPanel = new AddImageWizardChooseDataSourcePanel(progressPanel); AddImageWizardChooseDataSourcePanel dsPanel = new AddImageWizardChooseDataSourcePanel(progressPanel);
AddImageWizardIngestConfigPanel ingestConfigPanel = new AddImageWizardIngestConfigPanel(dsPanel, action, progressPanel); AddImageWizardIngestConfigPanel ingestConfigPanel = new AddImageWizardIngestConfigPanel(dsPanel, action, progressPanel);
panels.add(dsPanel); panels.add(dsPanel);
List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles();
if (!profiles.isEmpty()) {
panels.add(new IngestProfileSelectionWizardPanel(AddImageWizardIngestConfigPanel.class.getCanonicalName(), getPropLastprofileName()));
}
panels.add(ingestConfigPanel); panels.add(ingestConfigPanel);
panels.add(progressPanel); panels.add(progressPanel);
progressPanelIndex = panels.indexOf(progressPanel); //Doing programatically because number of panels is variable
String[] steps = new String[panels.size()]; String[] steps = new String[panels.size()];
for (int i = 0; i < panels.size(); i++) { for (int i = 0; i < panels.size(); i++) {
Component c = panels.get(i).getComponent(); Component c = panels.get(i).getComponent();
@ -66,7 +74,7 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
if (c instanceof JComponent) { // assume Swing components if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c; JComponent jc = (JComponent) c;
// Sets step number of a component // Sets step number of a component
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
// Sets steps names for a panel // Sets steps names for a panel
jc.putClientProperty("WizardPanel_contentData", steps); jc.putClientProperty("WizardPanel_contentData", steps);
// Turn on subtitle creation on each step // Turn on subtitle creation on each step
@ -91,13 +99,30 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
return index; return index;
} }
/**
* Gets the name of the property which stores the name of the last profile
* used by the Add Image Wizard.
*
* @return the PROP_LASTPROFILE_NAME
*/
static String getPropLastprofileName() {
return PROP_LASTPROFILE_NAME;
}
/**
* @return the PROP_LASTPROFILE_NAME
*/
static String getPROP_LASTPROFILE_NAME() {
return PROP_LASTPROFILE_NAME;
}
/** /**
* Gets the current panel. * Gets the current panel.
* *
* @return panel the current panel * @return panel the current panel
*/ */
@Override @Override
public WizardDescriptor.Panel<WizardDescriptor> current() { public ShortcutWizardDescriptorPanel current() {
if (panels != null) { if (panels != null) {
return panels.get(index); return panels.get(index);
} else { } else {
@ -146,7 +171,14 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
if (!hasNext()) { if (!hasNext()) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
boolean panelEnablesSkipping = current().panelEnablesSkipping();
boolean skipNextPanel = current().skipNextPanel();
index++; index++;
if (panelEnablesSkipping && skipNextPanel) {
current().processThisPanelBeforeSkipped();
nextPanel();
}
} }
/** /**
@ -158,7 +190,7 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
if (!hasPrevious()) { if (!hasPrevious()) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
if (index == 2) { if (index == progressPanelIndex) {
index--; index--;
} }
index--; index--;

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2013-2014 Basis Technology Corp. * Copyright 2013-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

@ -48,7 +48,7 @@ import org.sleuthkit.datamodel.VirtualDirectory;
*/ */
public class VirtualDirectoryNode extends AbstractAbstractFileNode<VirtualDirectory> { public class VirtualDirectoryNode extends AbstractAbstractFileNode<VirtualDirectory> {
private static Logger logger = Logger.getLogger(VirtualDirectoryNode.class.getName()); private static final Logger logger = Logger.getLogger(VirtualDirectoryNode.class.getName());
//prefix for special VirtualDirectory root nodes grouping local files //prefix for special VirtualDirectory root nodes grouping local files
public final static String LOGICAL_FILE_SET_PREFIX = "LogicalFileSet"; //NON-NLS public final static String LOGICAL_FILE_SET_PREFIX = "LogicalFileSet"; //NON-NLS

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");
@ -297,6 +297,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
* only, i.e. deserialization routines; otherwise you could get a * only, i.e. deserialization routines; otherwise you could get a
* non-deserialized instance. To obtain the singleton instance, use * non-deserialized instance. To obtain the singleton instance, use
* {@link #findInstance}. * {@link #findInstance}.
*
* @return instance - the default instance
*/ */
public static synchronized DirectoryTreeTopComponent getDefault() { public static synchronized DirectoryTreeTopComponent getDefault() {
if (instance == null) { if (instance == null) {
@ -308,6 +310,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
/** /**
* Obtain the DirectoryTreeTopComponent instance. Never call * Obtain the DirectoryTreeTopComponent instance. Never call
* {@link #getDefault} directly! * {@link #getDefault} directly!
*
* @return getDefault() - the default instance
*/ */
public static synchronized DirectoryTreeTopComponent findInstance() { public static synchronized DirectoryTreeTopComponent findInstance() {
WindowManager winManager = WindowManager.getDefault(); WindowManager winManager = WindowManager.getDefault();
@ -667,7 +671,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
try { try {
displayName = content.getUniquePath(); displayName = content.getUniquePath();
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for node: " + originNode); //NON-NLS LOGGER.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for node: {0}", originNode); //NON-NLS
} }
} else if (originNode.getLookup().lookup(String.class) != null) { } else if (originNode.getLookup().lookup(String.class) != null) {
displayName = originNode.getLookup().lookup(String.class); displayName = originNode.getLookup().lookup(String.class);

View File

@ -1,15 +1,15 @@
/* /*
* 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");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View File

@ -42,8 +42,11 @@ public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implemen
"IngestOptionsPanel.profilesTab.toolTipText=Settings for creating and editing profiles."}) "IngestOptionsPanel.profilesTab.toolTipText=Settings for creating and editing profiles."})
private FilesSetDefsPanel filterPanel; private FilesSetDefsPanel filterPanel;
private final static int INDEX_OF_FILTER_PANEL = 0;
private IngestSettingsPanel settingsPanel; private IngestSettingsPanel settingsPanel;
private final static int INDEX_OF_SETTINGS_PANEL = 2;
private ProfileSettingsPanel profilePanel; private ProfileSettingsPanel profilePanel;
private final static int INDEX_OF_PROFILE_PANEL = 1;
/** /**
* This panel implements a property change listener that listens to ingest * This panel implements a property change listener that listens to ingest
* job events so it can disable the buttons on the panel if ingest is * job events so it can disable the buttons on the panel if ingest is
@ -63,11 +66,11 @@ public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implemen
profilePanel = new ProfileSettingsPanel(); profilePanel = new ProfileSettingsPanel();
tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.fileFiltersTab.text"), null, tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.fileFiltersTab.text"), null,
filterPanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.fileFiltersTab.toolTipText"), 0); filterPanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.fileFiltersTab.toolTipText"), INDEX_OF_FILTER_PANEL);
tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.profilesTab.text"), null, tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.profilesTab.text"), null,
profilePanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.profilesTab.toolTipText"), 1); profilePanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.profilesTab.toolTipText"), INDEX_OF_PROFILE_PANEL);
tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.settingsTab.text"), null, tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.settingsTab.text"), null,
settingsPanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.settingsTab.toolTipText"), 2); settingsPanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.settingsTab.toolTipText"), INDEX_OF_SETTINGS_PANEL);
//Listener for when tabbed panes are switched, because we can have two file filter definitions panels open at the same time //Listener for when tabbed panes are switched, because we can have two file filter definitions panels open at the same time
//we may wind up in a situation where the user has created and saved one in the profiles panel //we may wind up in a situation where the user has created and saved one in the profiles panel
//so we need to refresh the filterPanel in those cases before proceeding. //so we need to refresh the filterPanel in those cases before proceeding.
@ -75,10 +78,15 @@ public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implemen
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (e.getSource() instanceof JTabbedPane) { if (e.getSource() instanceof JTabbedPane) {
profilePanel.shouldFiltersBeRefreshed(); //because we can have two filterPanels open at the same time
{ //we need to save the settings when we change tabs otherwise
filterPanel.load(); //they could be overwritten with out of date
} if (tabbedPane.getSelectedIndex() == INDEX_OF_FILTER_PANEL) {
filterPanel.load();
}
else {
filterPanel.saveSettings();
}
} }
} }
}); });
@ -152,10 +160,6 @@ public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implemen
*/ */
@Override @Override
public void saveSettings() { public void saveSettings() {
//if a new filter was created in the profilePanel we don't want to save over it accidently
if (profilePanel.shouldFiltersBeRefreshed()) {
filterPanel.load();
}
filterPanel.store(); filterPanel.store();
settingsPanel.store(); settingsPanel.store();
} }

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2017 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

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2012-2016 Basis Technology Corp. * Copyright 2012-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,6 @@ 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

@ -51,7 +51,6 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
private final DefaultListModel<IngestProfile> profilesListModel; private final DefaultListModel<IngestProfile> profilesListModel;
private Map<String, IngestProfile> profiles; private Map<String, IngestProfile> profiles;
private ProfilePanel panel; private ProfilePanel panel;
private boolean filtersShouldBeRefreshed;
/** /**
* Creates new form ProfileOptionsPanel * Creates new form ProfileOptionsPanel
@ -59,7 +58,6 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
ProfileSettingsPanel() { ProfileSettingsPanel() {
this.profilesListModel = new DefaultListModel<>(); this.profilesListModel = new DefaultListModel<>();
initComponents(); initComponents();
this.filtersShouldBeRefreshed = false;
this.profileList.setModel(profilesListModel); this.profileList.setModel(profilesListModel);
this.profileList.addListSelectionListener(new ProfileSettingsPanel.ProfileListSelectionListener()); this.profileList.addListSelectionListener(new ProfileSettingsPanel.ProfileListSelectionListener());
ingestWarningLabel.setVisible(false); ingestWarningLabel.setVisible(false);
@ -275,20 +273,6 @@ class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements Op
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null); firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_deleteProfileButtonActionPerformed }//GEN-LAST:event_deleteProfileButtonActionPerformed
/**
* Returns whether there were possible changes to the filter list since the
* last time this was called.
*
* Resets value to false after being called.
*
* @return true or false
*/
boolean shouldFiltersBeRefreshed() {
boolean shouldRefresh = filtersShouldBeRefreshed;
filtersShouldBeRefreshed = false;
return shouldRefresh;
}
/** /**
* Enable / disable buttons, so they can be disabled while ingest is * Enable / disable buttons, so they can be disabled while ingest is
* running. * running.

View File

@ -18,6 +18,7 @@
*/ */
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard; package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.awt.Component;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor; import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx; import org.openide.util.HelpCtx;
@ -25,9 +26,10 @@ import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.ingest.IngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
class IngestModulesConfigWizardPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> { class IngestModulesConfigWizardPanel extends ShortcutWizardDescriptorPanel {
@NbBundle.Messages("IngestModulesConfigWizardPanel.name.text=Configure Ingest Modules") @NbBundle.Messages("IngestModulesConfigWizardPanel.name.text=Configure Ingest Modules")
/** /**
* The visual ingestJobSettingsPanel that displays this panel. If you need * The visual ingestJobSettingsPanel that displays this panel. If you need
* to access the ingestJobSettingsPanel from this class, just use * to access the ingestJobSettingsPanel from this class, just use
@ -40,7 +42,7 @@ class IngestModulesConfigWizardPanel implements WizardDescriptor.FinishablePanel
// but never displayed, or not all panels are displayed, it is better to // but never displayed, or not all panels are displayed, it is better to
// create only those which really need to be visible. // create only those which really need to be visible.
@Override @Override
public IngestJobSettingsPanel getComponent() { public Component getComponent() {
if (ingestJobSettingsPanel == null) { if (ingestJobSettingsPanel == null) {
ingestJobSettingsPanel = new IngestJobSettingsPanel(new IngestJobSettings(RunIngestModulesAction.getDefaultContext())); ingestJobSettingsPanel = new IngestJobSettingsPanel(new IngestJobSettings(RunIngestModulesAction.getDefaultContext()));
} }
@ -79,9 +81,4 @@ class IngestModulesConfigWizardPanel implements WizardDescriptor.FinishablePanel
wiz.putProperty("executionContext", RunIngestModulesAction.getDefaultContext()); //NON-NLS wiz.putProperty("executionContext", RunIngestModulesAction.getDefaultContext()); //NON-NLS
} }
@Override
public boolean isFinishPanel() {
return true;
}
} }

View File

@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -91,7 +90,7 @@ final class IngestProfileSelectionPanel extends JPanel implements ItemListener {
constraints.weighty = .0; constraints.weighty = .0;
constraints.anchor = GridBagConstraints.FIRST_LINE_START; constraints.anchor = GridBagConstraints.FIRST_LINE_START;
addRadioButton(CUSTOM_SETTINGS_DISPLAY_NAME, RunIngestModulesAction.getDefaultContext(), CUSTOM_SETTINGS_DESCRIPTION, gridBagLayout, constraints); addRadioButton(CUSTOM_SETTINGS_DISPLAY_NAME, wizardPanel.getDefaultContext(), CUSTOM_SETTINGS_DESCRIPTION, gridBagLayout, constraints);
for (IngestProfile profile : profiles) { for (IngestProfile profile : profiles) {
constraints.weightx = 0; constraints.weightx = 0;
constraints.gridy++; constraints.gridy++;
@ -275,7 +274,7 @@ final class IngestProfileSelectionPanel extends JPanel implements ItemListener {
} }
} }
boolean wasLastPanel = isLastPanel; boolean wasLastPanel = isLastPanel;
isLastPanel = !selectedProfile.equals(RunIngestModulesAction.getDefaultContext()); isLastPanel = !selectedProfile.equals(wizardPanel.getDefaultContext());
wizardPanel.fireChangeEvent(); wizardPanel.fireChangeEvent();
this.firePropertyChange("LAST_ENABLED", wasLastPanel, isLastPanel); //NON-NLS this.firePropertyChange("LAST_ENABLED", wasLastPanel, isLastPanel); //NON-NLS
} }

View File

@ -18,6 +18,7 @@
*/ */
package org.sleuthkit.autopsy.ingest.runIngestModuleWizard; package org.sleuthkit.autopsy.ingest.runIngestModuleWizard;
import java.awt.Component;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -32,37 +33,60 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings;
* selection panel and is only created when profiles exist. * selection panel and is only created when profiles exist.
* *
*/ */
class IngestProfileSelectionWizardPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> { public class IngestProfileSelectionWizardPanel extends ShortcutWizardDescriptorPanel {
@Messages("IngestProfileWizardPanel.panelName=Ingest Profile Selection") @Messages("IngestProfileWizardPanel.panelName=Ingest Profile Selection")
private final Set<ChangeListener> listeners = new HashSet<>(1); 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 private final static String LAST_PROFILE_PROPERTIES_FILE = "IngestProfileSelectionPanel"; //NON-NLS
/** /**
* The visual component that displays this panel. If you need to access the * The visual ingestProfileSelectionPanel that displays this panel. If you
* component from this class, just use getComponent(). * need to access the ingestProfileSelectionPanel from this class, just use
* getComponent().
*/ */
private IngestProfileSelectionPanel component; private IngestProfileSelectionPanel ingestProfileSelectionPanel;
private String lastProfileUsed; private String lastProfileUsed;
private final String lastProfilePropertyName;
private final String defaultContext;
// Get the visual component for the panel. In this template, the component public IngestProfileSelectionWizardPanel(String defaultContext, String lastProfilePropertyName) {
this.lastProfilePropertyName = lastProfilePropertyName;
this.defaultContext = defaultContext;
}
/**
* @return the defaultContext
*/
String getDefaultContext() {
return defaultContext;
}
/**
* Gets the name of the file which stores the last profile used properties.
*
* @return the LAST_PROFILE_PROPERTIES_FILE
*/
public static String getLastProfilePropertiesFile() {
return LAST_PROFILE_PROPERTIES_FILE;
}
// Get the visual ingestProfileSelectionPanel for the panel. In this template, the ingestProfileSelectionPanel
// is kept separate. This can be more efficient: if the wizard is created // 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 // but never displayed, or not all panels are displayed, it is better to
// create only those which really need to be visible. // create only those which really need to be visible.
@Override @Override
public IngestProfileSelectionPanel getComponent() { public Component getComponent() {
if (component == null) { if (ingestProfileSelectionPanel == null) {
if (ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME) == null if (!(ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName) == null)
|| ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME).isEmpty()) { && !ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName).isEmpty()) {
lastProfileUsed = RunIngestModulesAction.getDefaultContext(); lastProfileUsed = ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName);
} else { } else {
lastProfileUsed = ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME); lastProfileUsed = getDefaultContext();
} }
component = new IngestProfileSelectionPanel(this, lastProfileUsed); ingestProfileSelectionPanel = new IngestProfileSelectionPanel(this, lastProfileUsed);
component.setName(Bundle.IngestProfileWizardPanel_panelName()); ingestProfileSelectionPanel.setName(Bundle.IngestProfileWizardPanel_panelName());
} }
return component; return ingestProfileSelectionPanel;
} }
@Override @Override
@ -111,14 +135,18 @@ class IngestProfileSelectionWizardPanel implements WizardDescriptor.FinishablePa
@Override @Override
public void storeSettings(WizardDescriptor wiz) { public void storeSettings(WizardDescriptor wiz) {
lastProfileUsed = component.getLastSelectedProfile(); lastProfileUsed = ingestProfileSelectionPanel.getLastSelectedProfile();
wiz.putProperty("executionContext", lastProfileUsed); //NON-NLS wiz.putProperty("executionContext", lastProfileUsed); //NON-NLS
ModuleSettings.setConfigSetting(LAST_PROFILE_PROPERTIES_FILE, PROP_LASTPROFILE_NAME, lastProfileUsed); ModuleSettings.setConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName, lastProfileUsed);
} }
@Override @Override
public boolean isFinishPanel() { public boolean skipNextPanel() {
return component.isLastPanel; return ingestProfileSelectionPanel.isLastPanel;
} }
@Override
public boolean panelEnablesSkipping() {
return true;
}
} }

View File

@ -34,8 +34,8 @@ import org.sleuthkit.autopsy.ingest.IngestProfiles;
final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> { final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
private int index; private int index;
private final static String PROP_LASTPROFILE_NAME = "RIMW_LASTPROFILE_NAME"; //NON-NLS
private List<WizardDescriptor.FinishablePanel<WizardDescriptor>> panels; private List<ShortcutWizardDescriptorPanel> panels;
/** /**
* Gets the list of panels used by this wizard for iterating over. * Gets the list of panels used by this wizard for iterating over.
@ -43,12 +43,12 @@ final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<
* *
* @return panels - the list of of WizardDescriptor panels * @return panels - the list of of WizardDescriptor panels
*/ */
private List<WizardDescriptor.FinishablePanel<WizardDescriptor>> getPanels() { private List<ShortcutWizardDescriptorPanel> getPanels() {
if (panels == null) { if (panels == null) {
panels = new ArrayList<>(); panels = new ArrayList<>();
List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles(); List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles();
if (!profiles.isEmpty()) { if (!profiles.isEmpty()) {
panels.add(new IngestProfileSelectionWizardPanel()); panels.add(new IngestProfileSelectionWizardPanel(RunIngestModulesAction.getDefaultContext(), PROP_LASTPROFILE_NAME));
} }
panels.add(new IngestModulesConfigWizardPanel()); panels.add(new IngestModulesConfigWizardPanel());
@ -71,7 +71,7 @@ final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<
} }
@Override @Override
public WizardDescriptor.FinishablePanel<WizardDescriptor> current() { public ShortcutWizardDescriptorPanel current() {
return getPanels().get(index); return getPanels().get(index);
} }
@ -82,7 +82,8 @@ final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<
@Override @Override
public boolean hasNext() { public boolean hasNext() {
return (index < getPanels().size() - 1) && !current().isFinishPanel(); return (index < getPanels().size() - 1
&& !(current().panelEnablesSkipping() && current().skipNextPanel()));
} }
@Override @Override

View File

@ -0,0 +1,68 @@
/*
* 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 org.openide.WizardDescriptor;
/**
* An abstract class providing a methods which can be checked by the iterator
* containing panels of this type. So that Wizards containing these panels can
* skip panels, but still call necessary methods of those panels.
*/
public abstract class ShortcutWizardDescriptorPanel implements WizardDescriptor.Panel<WizardDescriptor> {
/**
* Whether or not this panel under the correct conditions can enable the
* skipping of the panel after it.
*
* @return true or false
*/
public boolean panelEnablesSkipping() {
/*
* This method should be overriden by any panel that might want to
* enable the iterator to skip the panel that comes after it.
*/
return false;
}
/**
* Whether or not the panel immediately following this one should be skipped
* .
*
* @return true or false
*/
public boolean skipNextPanel() {
/*
* This method should be overriden by any panel that might want to
* enable the iterator to skip the panel that comes after it.
*/
return false;
}
/**
* Provides a method which will allow code to be executed in a panel you
* plan to skip
*/
public void processThisPanelBeforeSkipped() {
/*
* If you need to perform some actions of this panel before it is
* skipped override this method to have it call the necessary code.
*/
}
}

View File

@ -1,6 +1,20 @@
/* /*
* To change this template, choose Tools | Templates * Autopsy Forensic Browser
* and open the template in the editor. *
* 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.modules.fileextmismatch; package org.sleuthkit.autopsy.modules.fileextmismatch;

View File

@ -1,7 +1,20 @@
/* /*
* To change this license header, choose License Headers in Project Properties. * Autopsy Forensic Browser
* To change this template file, choose Tools | Templates *
* and open the template in the editor. * 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.modules.filetypeid; package org.sleuthkit.autopsy.modules.filetypeid;

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011 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

@ -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");

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

@ -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");