Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 1922-KeywordSearchEdit
@ -31,6 +31,14 @@
|
||||
<specification-version>1.46.1</specification-version>
|
||||
</run-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>
|
||||
<code-name-base>org.netbeans.core</code-name-base>
|
||||
<build-prerequisite/>
|
||||
@ -155,6 +163,14 @@
|
||||
<specification-version>9.7.1</specification-version>
|
||||
</run-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>
|
||||
<code-name-base>org.openide.modules</code-name-base>
|
||||
<build-prerequisite/>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2014 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* 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.NbBundle;
|
||||
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
|
||||
@ -39,7 +40,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgress
|
||||
* {@link AddImageWizardIngestConfigPanel} (which is a bit weird if you ask m
|
||||
* -jm)
|
||||
*/
|
||||
class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
|
||||
class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel {
|
||||
|
||||
/**
|
||||
* 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 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() {
|
||||
return dspProgressMonitorImpl;
|
||||
@ -192,7 +193,7 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePa
|
||||
protected final void fireChangeEvent() {
|
||||
Iterator<ChangeListener> it;
|
||||
synchronized (listeners) {
|
||||
it = new HashSet<ChangeListener>(listeners).iterator();
|
||||
it = new HashSet<>(listeners).iterator();
|
||||
}
|
||||
ChangeEvent ev = new ChangeEvent(this);
|
||||
while (it.hasNext()) {
|
||||
@ -239,8 +240,4 @@ class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePa
|
||||
getComponent().showErrors(errorString, critical);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinishPanel() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* 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.windows.WindowManager;
|
||||
import java.awt.Cursor;
|
||||
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.ShortcutWizardDescriptorPanel;
|
||||
|
||||
/**
|
||||
* The "Add Image" wizard panel1 handling the logic of selecting image file(s)
|
||||
* 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
|
||||
* component from this class, just use getComponent().
|
||||
*/
|
||||
private AddImageWizardAddingProgressPanel progressPanel;
|
||||
private final AddImageWizardAddingProgressPanel progressPanel;
|
||||
private AddImageWizardChooseDataSourceVisual component;
|
||||
private boolean isNextEnable = false;
|
||||
private static final String PROP_LASTDATASOURCE_PATH = "LBL_LastDataSource_PATH"; //NON-NLS
|
||||
@ -122,7 +123,7 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<Wiza
|
||||
isNextEnable = isEnabled;
|
||||
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.
|
||||
@ -155,7 +156,7 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<Wiza
|
||||
protected final void fireChangeEvent() {
|
||||
Iterator<ChangeListener> it;
|
||||
synchronized (listeners) {
|
||||
it = new HashSet<ChangeListener>(listeners).iterator();
|
||||
it = new HashSet<>(listeners).iterator();
|
||||
}
|
||||
ChangeEvent ev = new ChangeEvent(this);
|
||||
while (it.hasNext()) {
|
||||
@ -218,8 +219,6 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel<Wiza
|
||||
*/
|
||||
@Override
|
||||
public void storeSettings(WizardDescriptor settings) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2015 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -32,13 +32,17 @@ import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.openide.WizardDescriptor;
|
||||
import org.openide.util.HelpCtx;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.sleuthkit.datamodel.Content;
|
||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback;
|
||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
|
||||
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
|
||||
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.
|
||||
@ -46,20 +50,19 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
* TODO: review this for dead code. think about moving logic of adding image to
|
||||
* 3rd panel( {@link AddImageWizardAddingProgressPanel}) separate class -jm
|
||||
*/
|
||||
class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDescriptor> {
|
||||
|
||||
private final IngestJobSettingsPanel ingestJobSettingsPanel;
|
||||
class AddImageWizardIngestConfigPanel extends ShortcutWizardDescriptorPanel {
|
||||
|
||||
@Messages("AddImageWizardIngestConfigPanel.name.text=Configure Ingest Modules")
|
||||
private IngestJobSettingsPanel ingestJobSettingsPanel;
|
||||
/**
|
||||
* The visual component that displays this panel. If you need to access the
|
||||
* component from this class, just use getComponent().
|
||||
*/
|
||||
private Component component = null;
|
||||
|
||||
private String lastProfileUsed = AddImageWizardIngestConfigPanel.class.getCanonicalName();
|
||||
private final List<Content> newContents = Collections.synchronizedList(new ArrayList<Content>());
|
||||
private boolean ingested = false;
|
||||
private boolean readyToIngest = false;
|
||||
|
||||
// task that will clean up the created database file if the wizard is cancelled before it finishes
|
||||
private AddImageAction.CleanupTask cleanupTask;
|
||||
|
||||
@ -75,10 +78,12 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
|
||||
this.addImageAction = action;
|
||||
this.progressPanel = proPanel;
|
||||
this.dataSourcePanel = dsPanel;
|
||||
|
||||
IngestJobSettings ingestJobSettings = new IngestJobSettings(AddImageWizardIngestConfigPanel.class.getCanonicalName());
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,6 +98,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
|
||||
public Component getComponent() {
|
||||
if (component == null) {
|
||||
component = new AddImageWizardIngestConfigVisual(this.ingestJobSettingsPanel);
|
||||
component.setName(Bundle.AddImageWizardIngestConfigPanel_name_text());
|
||||
}
|
||||
return component;
|
||||
}
|
||||
@ -166,12 +172,10 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
|
||||
settings.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, WizardDescriptor.FINISH_OPTION, cancel});
|
||||
cleanupTask = null;
|
||||
readyToIngest = false;
|
||||
|
||||
newContents.clear();
|
||||
|
||||
// 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
|
||||
startDataSourceProcessing(settings);
|
||||
startDataSourceProcessing();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,7 +189,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
|
||||
*/
|
||||
@Override
|
||||
public void storeSettings(WizardDescriptor settings) {
|
||||
IngestJobSettings ingestJobSettings = this.ingestJobSettingsPanel.getSettings();
|
||||
IngestJobSettings ingestJobSettings = ingestJobSettingsPanel.getSettings();
|
||||
ingestJobSettings.save();
|
||||
showWarnings(ingestJobSettings);
|
||||
|
||||
@ -205,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,
|
||||
* and we haven't already ingested.
|
||||
@ -221,7 +247,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
|
||||
* Starts the Data source processing by kicking off the selected
|
||||
* DataSourceProcessor
|
||||
*/
|
||||
private void startDataSourceProcessing(WizardDescriptor settings) {
|
||||
private void startDataSourceProcessing() {
|
||||
final UUID dataSourceId = UUID.randomUUID();
|
||||
|
||||
// Add a cleanup task to interrupt the background process if the
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -26,6 +26,9 @@ import javax.swing.JComponent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.openide.WizardDescriptor;
|
||||
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
|
||||
@ -34,8 +37,10 @@ import org.openide.util.NbBundle;
|
||||
class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
|
||||
|
||||
private int index = 0;
|
||||
private List<WizardDescriptor.Panel<WizardDescriptor>> panels;
|
||||
private AddImageAction action;
|
||||
private List<ShortcutWizardDescriptorPanel> panels;
|
||||
private final AddImageAction action;
|
||||
private int progressPanelIndex;
|
||||
private final static String PROP_LASTPROFILE_NAME = "AIW_LASTPROFILE_NAME"; //NON-NLS
|
||||
|
||||
AddImageWizardIterator(AddImageAction action) {
|
||||
this.action = action;
|
||||
@ -45,19 +50,22 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
|
||||
* Initialize panels representing individual wizard's steps and sets various
|
||||
* properties for them influencing wizard appearance.
|
||||
*/
|
||||
private List<WizardDescriptor.Panel<WizardDescriptor>> getPanels() {
|
||||
private List<ShortcutWizardDescriptorPanel> getPanels() {
|
||||
if (panels == null) {
|
||||
panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>();
|
||||
panels = new ArrayList<>();
|
||||
|
||||
AddImageWizardAddingProgressPanel progressPanel = new AddImageWizardAddingProgressPanel();
|
||||
|
||||
AddImageWizardChooseDataSourcePanel dsPanel = new AddImageWizardChooseDataSourcePanel(progressPanel);
|
||||
AddImageWizardIngestConfigPanel ingestConfigPanel = new AddImageWizardIngestConfigPanel(dsPanel, action, progressPanel);
|
||||
|
||||
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(progressPanel);
|
||||
|
||||
progressPanelIndex = panels.indexOf(progressPanel); //Doing programatically because number of panels is variable
|
||||
String[] steps = new String[panels.size()];
|
||||
for (int i = 0; i < panels.size(); i++) {
|
||||
Component c = panels.get(i).getComponent();
|
||||
@ -66,7 +74,7 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
|
||||
if (c instanceof JComponent) { // assume Swing components
|
||||
JComponent jc = (JComponent) c;
|
||||
// Sets step number of a component
|
||||
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
|
||||
jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
|
||||
// Sets steps names for a panel
|
||||
jc.putClientProperty("WizardPanel_contentData", steps);
|
||||
// Turn on subtitle creation on each step
|
||||
@ -91,13 +99,30 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
|
||||
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.
|
||||
*
|
||||
* @return panel the current panel
|
||||
*/
|
||||
@Override
|
||||
public WizardDescriptor.Panel<WizardDescriptor> current() {
|
||||
public ShortcutWizardDescriptorPanel current() {
|
||||
if (panels != null) {
|
||||
return panels.get(index);
|
||||
} else {
|
||||
@ -146,7 +171,14 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
boolean panelEnablesSkipping = current().panelEnablesSkipping();
|
||||
boolean skipNextPanel = current().skipNextPanel();
|
||||
index++;
|
||||
if (panelEnablesSkipping && skipNextPanel) {
|
||||
current().processThisPanelBeforeSkipped();
|
||||
nextPanel();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -158,7 +190,7 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
|
||||
if (!hasPrevious()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
if (index == 2) {
|
||||
if (index == progressPanelIndex) {
|
||||
index--;
|
||||
}
|
||||
index--;
|
||||
|
@ -1,21 +1,21 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.casemodule.services;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
@ -31,14 +31,14 @@ import org.openide.util.Lookup;
|
||||
iconBase = "org/sleuthkit/autopsy/casemodule/services/tag-options-panel-icon.png",
|
||||
keywords = "#OptionsCategory_TagNames",
|
||||
keywordsCategory = "CustomTagNames",
|
||||
position = 8
|
||||
position = 10
|
||||
)
|
||||
public final class TagsOptionsPanelController extends OptionsPanelController {
|
||||
|
||||
private TagOptionsPanel panel;
|
||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
private boolean changed;
|
||||
|
||||
|
||||
/**
|
||||
* Component should load its data here.
|
||||
*/
|
||||
@ -105,7 +105,7 @@ public final class TagsOptionsPanelController extends OptionsPanelController {
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
pcs.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
||||
private TagOptionsPanel getPanel() {
|
||||
if (panel == null) {
|
||||
panel = new TagOptionsPanel();
|
||||
@ -117,7 +117,7 @@ public final class TagsOptionsPanelController extends OptionsPanelController {
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
||||
void changed() {
|
||||
if (!changed) {
|
||||
changed = true;
|
||||
|
@ -49,55 +49,6 @@
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Component id="numberOfFileIngestThreadsComboBox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="restartRequiredLabel" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabelTimeDisplay" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelNumThreads" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelSetProcessTimeOut" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="useLocalTimeRB" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="useGMTTimeRB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jCheckBoxEnableProcTimeout" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jFormattedTextFieldProcTimeOutHrs" min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabelProcessTimeOutUnits" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="213" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabelHideKnownFiles" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelSelectFile" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="keepCurrentViewerRB" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="useBestViewerRB" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dataSourcesHideKnownCB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="viewsHideKnownCB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="395" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabelHideSlackFiles" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
@ -111,6 +62,30 @@
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabelTimeDisplay" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="useLocalTimeRB" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="useGMTTimeRB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="jLabelHideKnownFiles" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelSelectFile" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="keepCurrentViewerRB" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="useBestViewerRB" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dataSourcesHideKnownCB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="viewsHideKnownCB" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
@ -142,24 +117,7 @@
|
||||
<Component id="useLocalTimeRB" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="useGMTTimeRB" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabelNumThreads" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="numberOfFileIngestThreadsComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="restartRequiredLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabelSetProcessTimeOut" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jCheckBoxEnableProcTimeout" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="jFormattedTextFieldProcTimeOutHrs" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelProcessTimeOutUnits" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="49" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="148" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -264,73 +222,6 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="viewsHideKnownCBActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelNumThreads">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyOptionsPanel.jLabelNumThreads.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="numberOfFileIngestThreadsComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="numberOfFileIngestThreadsComboBoxActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<Integer>"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="restartRequiredLabel">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/corecomponents/warning16.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyOptionsPanel.restartRequiredLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelSetProcessTimeOut">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyOptionsPanel.jLabelSetProcessTimeOut.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="jCheckBoxEnableProcTimeout">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyOptionsPanel.jCheckBoxEnableProcTimeout.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBoxEnableProcTimeoutActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelProcessTimeOutUnits">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyOptionsPanel.jLabelProcessTimeOutUnits.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JFormattedTextField" name="jFormattedTextFieldProcTimeOutHrs">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyOptionsPanel.jFormattedTextFieldProcTimeOutHrs.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jFormattedTextFieldProcTimeOutHrsActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new JFormattedTextField(NumberFormat.getIntegerInstance());"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="dataSourcesHideSlackCB">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
|
@ -18,13 +18,7 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.corecomponents;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JFormattedTextField;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.event.DocumentListener;
|
||||
import org.netbeans.spi.options.OptionsPanelController;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
|
||||
/**
|
||||
@ -36,55 +30,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
|
||||
AutopsyOptionsPanel() {
|
||||
initComponents();
|
||||
|
||||
/*
|
||||
* Profiling has shown that contention for I/O resources and for the
|
||||
* case database limits the number of threads that can do meaningful
|
||||
* work during ingest. If Autopsy was compute-bound, adding more threads
|
||||
* on machines with enough processors might help, but currently, after
|
||||
* four threads, performance actually stays flat and then starts to
|
||||
* degrade.
|
||||
*/
|
||||
int availableProcessors = Runtime.getRuntime().availableProcessors();
|
||||
Integer fileIngestThreadCountChoices[];
|
||||
int recommendedFileIngestThreadCount;
|
||||
if (availableProcessors >= 6) {
|
||||
fileIngestThreadCountChoices = new Integer[]{1, 2, 4};
|
||||
recommendedFileIngestThreadCount = 4;
|
||||
} else if (availableProcessors >= 4 && availableProcessors < 6) {
|
||||
fileIngestThreadCountChoices = new Integer[]{1, 2, 4};
|
||||
recommendedFileIngestThreadCount = 2;
|
||||
} else if (availableProcessors >= 2 && availableProcessors < 4) {
|
||||
fileIngestThreadCountChoices = new Integer[]{1, 2};
|
||||
recommendedFileIngestThreadCount = 1;
|
||||
} else {
|
||||
fileIngestThreadCountChoices = new Integer[]{1};
|
||||
recommendedFileIngestThreadCount = 1;
|
||||
}
|
||||
numberOfFileIngestThreadsComboBox.setModel(new DefaultComboBoxModel<>(fileIngestThreadCountChoices));
|
||||
|
||||
restartRequiredLabel.setText(NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.restartRequiredLabel.text", recommendedFileIngestThreadCount));
|
||||
|
||||
// TODO listen to changes in form fields and call controller.changed()
|
||||
DocumentListener docListener = new DocumentListener() {
|
||||
|
||||
@Override
|
||||
public void insertUpdate(DocumentEvent e) {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUpdate(DocumentEvent e) {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
};
|
||||
this.jFormattedTextFieldProcTimeOutHrs.getDocument().addDocumentListener(docListener);
|
||||
|
||||
}
|
||||
|
||||
void load() {
|
||||
@ -98,20 +43,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
boolean useLocalTime = UserPreferences.displayTimesInLocalTime();
|
||||
useLocalTimeRB.setSelected(useLocalTime);
|
||||
useGMTTimeRB.setSelected(!useLocalTime);
|
||||
numberOfFileIngestThreadsComboBox.setSelectedItem(UserPreferences.numberOfFileIngestThreads());
|
||||
if (UserPreferences.getIsTimeOutEnabled()) {
|
||||
// user specified time out
|
||||
jCheckBoxEnableProcTimeout.setSelected(true);
|
||||
jFormattedTextFieldProcTimeOutHrs.setEditable(true);
|
||||
int timeOutHrs = UserPreferences.getProcessTimeOutHrs();
|
||||
jFormattedTextFieldProcTimeOutHrs.setValue((long) timeOutHrs);
|
||||
} else {
|
||||
// never time out
|
||||
jCheckBoxEnableProcTimeout.setSelected(false);
|
||||
jFormattedTextFieldProcTimeOutHrs.setEditable(false);
|
||||
int timeOutHrs = UserPreferences.getProcessTimeOutHrs();
|
||||
jFormattedTextFieldProcTimeOutHrs.setValue((long) timeOutHrs);
|
||||
}
|
||||
}
|
||||
|
||||
void store() {
|
||||
@ -121,14 +52,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
UserPreferences.setHideSlackFilesInDataSourcesTree(dataSourcesHideSlackCB.isSelected());
|
||||
UserPreferences.setHideSlackFilesInViewsTree(viewsHideSlackCB.isSelected());
|
||||
UserPreferences.setDisplayTimesInLocalTime(useLocalTimeRB.isSelected());
|
||||
UserPreferences.setNumberOfFileIngestThreads((Integer) numberOfFileIngestThreadsComboBox.getSelectedItem());
|
||||
|
||||
UserPreferences.setIsTimeOutEnabled(jCheckBoxEnableProcTimeout.isSelected());
|
||||
if (jCheckBoxEnableProcTimeout.isSelected()) {
|
||||
// only store time out if it is enabled
|
||||
long timeOutHrs = (long) jFormattedTextFieldProcTimeOutHrs.getValue();
|
||||
UserPreferences.setProcessTimeOutHrs((int) timeOutHrs);
|
||||
}
|
||||
}
|
||||
|
||||
boolean valid() {
|
||||
@ -156,13 +79,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
jLabelHideKnownFiles = new javax.swing.JLabel();
|
||||
dataSourcesHideKnownCB = new javax.swing.JCheckBox();
|
||||
viewsHideKnownCB = new javax.swing.JCheckBox();
|
||||
jLabelNumThreads = new javax.swing.JLabel();
|
||||
numberOfFileIngestThreadsComboBox = new javax.swing.JComboBox<>();
|
||||
restartRequiredLabel = new javax.swing.JLabel();
|
||||
jLabelSetProcessTimeOut = new javax.swing.JLabel();
|
||||
jCheckBoxEnableProcTimeout = new javax.swing.JCheckBox();
|
||||
jLabelProcessTimeOutUnits = new javax.swing.JLabel();
|
||||
jFormattedTextFieldProcTimeOutHrs = new JFormattedTextField(NumberFormat.getIntegerInstance());
|
||||
dataSourcesHideSlackCB = new javax.swing.JCheckBox();
|
||||
viewsHideSlackCB = new javax.swing.JCheckBox();
|
||||
jLabelHideSlackFiles = new javax.swing.JLabel();
|
||||
@ -223,35 +139,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabelNumThreads, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelNumThreads.text")); // NOI18N
|
||||
|
||||
numberOfFileIngestThreadsComboBox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
numberOfFileIngestThreadsComboBoxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
restartRequiredLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/warning16.png"))); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(restartRequiredLabel, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.restartRequiredLabel.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabelSetProcessTimeOut, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelSetProcessTimeOut.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxEnableProcTimeout, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jCheckBoxEnableProcTimeout.text")); // NOI18N
|
||||
jCheckBoxEnableProcTimeout.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jCheckBoxEnableProcTimeoutActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabelProcessTimeOutUnits, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jLabelProcessTimeOutUnits.text")); // NOI18N
|
||||
|
||||
jFormattedTextFieldProcTimeOutHrs.setText(org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.jFormattedTextFieldProcTimeOutHrs.text")); // NOI18N
|
||||
jFormattedTextFieldProcTimeOutHrs.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jFormattedTextFieldProcTimeOutHrsActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(dataSourcesHideSlackCB, org.openide.util.NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.dataSourcesHideSlackCB.text")); // NOI18N
|
||||
dataSourcesHideSlackCB.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -277,29 +164,13 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabelTimeDisplay)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(numberOfFileIngestThreadsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(restartRequiredLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabelTimeDisplay)
|
||||
.addComponent(jLabelNumThreads)
|
||||
.addComponent(jLabelSetProcessTimeOut)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(useLocalTimeRB)
|
||||
.addComponent(useGMTTimeRB)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jCheckBoxEnableProcTimeout)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jFormattedTextFieldProcTimeOutHrs, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabelProcessTimeOutUnits)))))
|
||||
.addGap(213, 213, 213)))
|
||||
.addContainerGap())
|
||||
.addComponent(useLocalTimeRB)
|
||||
.addComponent(useGMTTimeRB))))
|
||||
.addContainerGap(512, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabelHideKnownFiles)
|
||||
@ -349,21 +220,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
.addComponent(useLocalTimeRB)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(useGMTTimeRB)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabelNumThreads)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(numberOfFileIngestThreadsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(restartRequiredLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabelSetProcessTimeOut)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jCheckBoxEnableProcTimeout)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jFormattedTextFieldProcTimeOutHrs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabelProcessTimeOutUnits)))
|
||||
.addContainerGap(49, Short.MAX_VALUE))
|
||||
.addContainerGap(148, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jScrollPane1.setViewportView(jPanel1);
|
||||
@ -380,11 +237,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void jCheckBoxEnableProcTimeoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxEnableProcTimeoutActionPerformed
|
||||
jFormattedTextFieldProcTimeOutHrs.setEditable(jCheckBoxEnableProcTimeout.isSelected());
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_jCheckBoxEnableProcTimeoutActionPerformed
|
||||
|
||||
private void useBestViewerRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useBestViewerRBActionPerformed
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_useBestViewerRBActionPerformed
|
||||
@ -409,14 +261,6 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_useGMTTimeRBActionPerformed
|
||||
|
||||
private void numberOfFileIngestThreadsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numberOfFileIngestThreadsComboBoxActionPerformed
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_numberOfFileIngestThreadsComboBoxActionPerformed
|
||||
|
||||
private void jFormattedTextFieldProcTimeOutHrsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed
|
||||
|
||||
private void dataSourcesHideSlackCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourcesHideSlackCBActionPerformed
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_dataSourcesHideSlackCBActionPerformed
|
||||
@ -430,20 +274,13 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
|
||||
private javax.swing.ButtonGroup buttonGroup3;
|
||||
private javax.swing.JCheckBox dataSourcesHideKnownCB;
|
||||
private javax.swing.JCheckBox dataSourcesHideSlackCB;
|
||||
private javax.swing.JCheckBox jCheckBoxEnableProcTimeout;
|
||||
private javax.swing.JFormattedTextField jFormattedTextFieldProcTimeOutHrs;
|
||||
private javax.swing.JLabel jLabelHideKnownFiles;
|
||||
private javax.swing.JLabel jLabelHideSlackFiles;
|
||||
private javax.swing.JLabel jLabelNumThreads;
|
||||
private javax.swing.JLabel jLabelProcessTimeOutUnits;
|
||||
private javax.swing.JLabel jLabelSelectFile;
|
||||
private javax.swing.JLabel jLabelSetProcessTimeOut;
|
||||
private javax.swing.JLabel jLabelTimeDisplay;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JRadioButton keepCurrentViewerRB;
|
||||
private javax.swing.JComboBox<Integer> numberOfFileIngestThreadsComboBox;
|
||||
private javax.swing.JLabel restartRequiredLabel;
|
||||
private javax.swing.JRadioButton useBestViewerRB;
|
||||
private javax.swing.JRadioButton useGMTTimeRB;
|
||||
private javax.swing.JRadioButton useLocalTimeRB;
|
||||
|
@ -139,11 +139,9 @@ AutopsyOptionsPanel.useGMTTimeRB.text=Use GMT
|
||||
AutopsyOptionsPanel.useLocalTimeRB.text=Use local time zone
|
||||
AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText=For example, stay in Hex view when a JPEG is selected.
|
||||
AutopsyOptionsPanel.keepCurrentViewerRB.text=Stay on the same file viewer
|
||||
AutopsyOptionsPanel.restartRequiredLabel.text=For this computer, a maximum of {0} file ingest threads should be used. Application restart required to take effect.
|
||||
AutopsyOptionsPanel.jLabelSelectFile.text=When selecting a file:
|
||||
AutopsyOptionsPanel.jLabelHideKnownFiles.text=Hide known files (i.e. those in the NIST NSRL) in the:
|
||||
AutopsyOptionsPanel.jLabelTimeDisplay.text=When displaying times:
|
||||
AutopsyOptionsPanel.jLabelNumThreads.text=Number of threads to use for file ingest:
|
||||
FXVideoPanel.progress.bufferingCancelled=media buffering was canceled
|
||||
FXVideoPanel.progress.bufferingInterrupted=media buffering was interrupted
|
||||
FXVideoPanel.progress.errorWritingVideoToDisk=Error writing video to disk
|
||||
@ -158,10 +156,6 @@ MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort=Invalid database por
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort=Invalid message service port number
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort=Invalid Solr server port number
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidMessgeServiceURI=Message service host and/or port not valid
|
||||
AutopsyOptionsPanel.jCheckBoxEnableProcTimeout.text=
|
||||
AutopsyOptionsPanel.jFormattedTextFieldProcTimeOutHrs.text=60
|
||||
AutopsyOptionsPanel.jLabelProcessTimeOutUnits.text=hour(s)
|
||||
AutopsyOptionsPanel.jLabelSetProcessTimeOut.text=Enable timeout to allow modules to automatically terminate after a set amount of time\:
|
||||
DataContentViewerHex.goToOffsetLabel.text=Jump to Offset
|
||||
DataContentViewerHex.goToOffsetTextField.text=
|
||||
DataContentViewerHex.goToOffsetTextField.msgDlg=Invalid Offset\: {0}
|
||||
|
@ -116,11 +116,9 @@ AutopsyOptionsPanel.useGMTTimeRB.text=GMT\u3092\u4f7f\u7528
|
||||
AutopsyOptionsPanel.useLocalTimeRB.text=\u30ed\u30fc\u30ab\u30eb\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u4f7f\u7528
|
||||
AutopsyOptionsPanel.keepCurrentViewerRB.toolTipText=\u4f8b\u3048\u3070\u3001JPEG\u304c\u9078\u629e\u3055\u308c\u305f\u5834\u5408\u306b\u305d\u306e\u307e\u307eHEX\u30d3\u30e5\u30fc\u3092\u4f7f\u7528\u3002
|
||||
AutopsyOptionsPanel.keepCurrentViewerRB.text=\u305d\u306e\u307e\u307e\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u30d3\u30e5\u30fc\u30a2\u3092\u4f7f\u7528
|
||||
AutopsyOptionsPanel.restartRequiredLabel.text=\u3053\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u3067\u306f\u6700\u5927{0}\u306e\u30d5\u30a1\u30a4\u30eb\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u30b9\u30ec\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u3079\u304d\u3067\u3059\u3002\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u518d\u8d77\u52d5\u304c\u5fc5\u8981\u3067\u3059\u3002
|
||||
AutopsyOptionsPanel.jLabelSelectFile.text=\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3059\u308b\u5834\u5408\uff1a
|
||||
AutopsyOptionsPanel.jLabelHideKnownFiles.text=\u65e2\u77e5\u30d5\u30a1\u30a4\u30eb\uff08NIST NSRL\u5185\u306e\uff09\u3092\u6b21\u306b\u96a0\u3059\uff1a
|
||||
AutopsyOptionsPanel.jLabelTimeDisplay.text=\u6642\u9593\u3092\u8868\u793a\u3059\u308b\u5834\u5408\uff1a
|
||||
AutopsyOptionsPanel.jLabelNumThreads.text=\u30d5\u30a1\u30a4\u30eb\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u306b\u4f7f\u7528\u3059\u308b\u30b9\u30ec\u30c3\u30c9\u6570\uff1a
|
||||
FXVideoPanel.progress.bufferingCancelled=\u30e1\u30c7\u30a3\u30a2\u306e\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u304c\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u307e\u3057\u305f
|
||||
FXVideoPanel.progress.bufferingInterrupted=\u30e1\u30c7\u30a3\u30a2\u306e\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u304c\u4e2d\u65ad\u3055\u308c\u307e\u3057\u305f
|
||||
FXVideoPanel.progress.errorWritingVideoToDisk=\u30d3\u30c7\u30aa\u3092\u30c7\u30a3\u30b9\u30af\u3078\u66f8\u304d\u8fbc\u307f\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f
|
||||
@ -135,8 +133,6 @@ MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort=\u7121\u52b9\u306a\u
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort=\u7121\u52b9\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u30b5\u30fc\u30d3\u30b9\u30dd\u30fc\u30c8\u756a\u53f7
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort=\u7121\u52b9\u306aSolr\u30b5\u30fc\u30d0\u30fc\u30dd\u30fc\u30c8\u756a\u53f7
|
||||
MultiUserSettingsPanel.validationErrMsg.invalidMessgeServiceURI=\u7121\u52b9\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u30b5\u30fc\u30d3\u30b9\u30db\u30b9\u30c8\u3084\u30dd\u30fc\u30c8\u756a\u53f7
|
||||
AutopsyOptionsPanel.jLabelProcessTimeOutUnits.text=\u6642\u9593
|
||||
AutopsyOptionsPanel.jLabelSetProcessTimeOut.text=\u4e00\u5b9a\u306e\u6642\u9593\u304c\u904e\u304e\u305f\u5f8c\u306b\u81ea\u52d5\u7684\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u505c\u6b62\u3067\u304d\u308b\u3088\u3046\u306b\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u6709\u52b9\u5316\uff1a
|
||||
DataContentViewerHex.goToOffsetLabel.text=\u30aa\u30d5\u30bb\u30c3\u30c8\u306b\u30b8\u30e3\u30f3\u30d7
|
||||
DataContentViewerHex.goToOffsetTextField.msgDlg=\u7121\u52b9\u306a\u30aa\u30d5\u30bb\u30c3\u30c8\uff1a{0}
|
||||
DataContentViewerHex.setDataView.invalidOffset.negativeOffsetValue=\u8a08\u7b97\u3055\u308c\u305f\u30aa\u30d5\u30bb\u30c3\u30c8\u306b\u30b8\u30e3\u30f3\u30d7\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2013-2014 Basis Technology Corp.
|
||||
* Copyright 2013-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
|
||||
@OptionsPanelController.TopLevelRegistration(categoryName = "#OptionsCategory_Name_Multi_User_Settings",
|
||||
iconBase = "org/sleuthkit/autopsy/images/User-Group-icon-green32.png",
|
||||
position = 2,
|
||||
position = 3,
|
||||
keywords = "#OptionsCategory_Keywords_Multi_User_Options",
|
||||
keywordsCategory = "Multi-user")
|
||||
public final class MultiUserSettingsPanelController extends OptionsPanelController {
|
||||
|
@ -147,7 +147,9 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi
|
||||
final String mime_type = resultSet.getString("mime_type"); //NON-NLS
|
||||
if (!mime_type.isEmpty()) {
|
||||
String mimeType[] = mime_type.split("/");
|
||||
if (!mimeType[0].isEmpty() && !mimeType[1].isEmpty()) {
|
||||
//Note: Users are able to define custom mime types in Autopsy that do not
|
||||
//contain a "/" or possibly have multiple slashes
|
||||
if (mimeType.length > 1 && !mimeType[0].isEmpty() && !mimeType[1].isEmpty()) {
|
||||
if (!existingMimeTypes.containsKey(mimeType[0])) {
|
||||
existingMimeTypes.put(mimeType[0], new ArrayList<>());
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2014 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.datamodel;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.sql.ResultSet;
|
||||
@ -27,7 +26,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import org.openide.nodes.Children;
|
||||
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.ingest.IngestManager;
|
||||
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.Image;
|
||||
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",})
|
||||
public Action[] getActions(boolean context) {
|
||||
|
||||
List<Action> actionsList = new ArrayList<Action>();
|
||||
List<Action> actionsList = new ArrayList<>();
|
||||
for (Action a : super.getActions(true)) {
|
||||
actionsList.add(a);
|
||||
}
|
||||
actionsList.addAll(ExplorerNodeActionVisitor.getActions(content));
|
||||
actionsList.add(new FileSearchAction(
|
||||
Bundle.ImageNode_getActions_openFileSearchByAttr_text()));
|
||||
actionsList.add(new AbstractAction(
|
||||
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 RunIngestModulesAction(Collections.<Content>singletonList(content)));
|
||||
actionsList.add(new NewWindowViewAction(
|
||||
NbBundle.getMessage(this.getClass(), "ImageNode.getActions.viewInNewWin.text"), this));
|
||||
return actionsList.toArray(new Action[0]);
|
||||
|
@ -1,15 +1,15 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2014 Basis Technology Corp.
|
||||
*
|
||||
* 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.
|
||||
@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.datamodel;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@ -27,7 +26,6 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import org.openide.nodes.Sheet;
|
||||
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.FileSearchAction;
|
||||
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.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
@ -50,7 +48,7 @@ import org.sleuthkit.datamodel.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
|
||||
public final static String LOGICAL_FILE_SET_PREFIX = "LogicalFileSet"; //NON-NLS
|
||||
|
||||
@ -100,14 +98,7 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode<VirtualDirect
|
||||
actions.add(null); // creates a menu separator
|
||||
actions.add(new FileSearchAction(
|
||||
Bundle.ImageNode_getActions_openFileSearchByAttr_text()));
|
||||
actions.add(new AbstractAction(
|
||||
Bundle.VirtualDirectoryNode_action_runIngestMods_text()) {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(Collections.<Content>singletonList(content));
|
||||
ingestDialog.display();
|
||||
}
|
||||
});
|
||||
actions.add(new RunIngestModulesAction(Collections.<Content>singletonList(content)));
|
||||
actions.addAll(ContextMenuExtensionPoint.getActions());
|
||||
return actions.toArray(new Action[0]);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2014 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -18,12 +18,10 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.directorytree;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import org.openide.nodes.FilterNode;
|
||||
import org.openide.nodes.Node;
|
||||
@ -32,8 +30,7 @@ import org.openide.util.lookup.Lookups;
|
||||
import org.openide.util.lookup.ProxyLookup;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.datamodel.AbstractContentNode;
|
||||
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.Content;
|
||||
import org.sleuthkit.datamodel.Directory;
|
||||
@ -42,86 +39,83 @@ import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.datamodel.VirtualDirectory;
|
||||
|
||||
/**
|
||||
* This class sets the actions for the nodes in the directory tree and creates
|
||||
* the children filter so that files and such are hidden from the tree.
|
||||
*
|
||||
* A node filter (decorator) that sets the actions for the nodes in the
|
||||
* directory tree and wraps the node children with a
|
||||
* DirectoryTreeFilterChildren.
|
||||
*/
|
||||
class DirectoryTreeFilterNode extends FilterNode {
|
||||
|
||||
private static final Action collapseAll = new CollapseAction(
|
||||
NbBundle.getMessage(DirectoryTreeFilterNode.class, "DirectoryTreeFilterNode.action.collapseAll.text"));
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DirectoryTreeFilterNode.class.getName());
|
||||
private static final Action collapseAllAction = new CollapseAction(NbBundle.getMessage(DirectoryTreeFilterNode.class, "DirectoryTreeFilterNode.action.collapseAll.text"));
|
||||
|
||||
/**
|
||||
* the constructor
|
||||
* A node filter (decorator) that sets the actions for the nodes in the
|
||||
* directory tree and wraps the node children with a
|
||||
* DirectoryTreeFilterChildren.
|
||||
*
|
||||
* @param nodeToWrap The node to wrap.
|
||||
* @param createChildren Whether to create the children of the wrapped node
|
||||
* or treat it a a leaf node.
|
||||
*/
|
||||
DirectoryTreeFilterNode(Node arg, boolean createChildren) {
|
||||
super(arg, DirectoryTreeFilterChildren.createInstance(arg, createChildren),
|
||||
new ProxyLookup(Lookups.singleton(new OriginalNode(arg)),
|
||||
arg.getLookup()));
|
||||
DirectoryTreeFilterNode(Node nodeToWrap, boolean createChildren) {
|
||||
super(nodeToWrap,
|
||||
DirectoryTreeFilterChildren.createInstance(nodeToWrap, createChildren),
|
||||
new ProxyLookup(Lookups.singleton(new OriginalNode(nodeToWrap)), nodeToWrap.getLookup()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display name for the node, possibly including a child count in
|
||||
* parentheses.
|
||||
*
|
||||
* @return The display name for the node.
|
||||
*/
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
final Node orig = getOriginal();
|
||||
|
||||
String name = orig.getDisplayName();
|
||||
|
||||
//do not show children counts for non content nodes
|
||||
if (orig instanceof AbstractContentNode) {
|
||||
//show only for file content nodes
|
||||
AbstractFile file = getLookup().lookup(AbstractFile.class);
|
||||
if (file != null) {
|
||||
try {
|
||||
final int numChildren = file.getChildrenCount();
|
||||
|
||||
// left-to-right marks here are necessary to keep the count and parens together
|
||||
// for mixed right-to-left and left-to-right names
|
||||
name = name + " \u200E(\u200E" + numChildren + ")\u200E";
|
||||
/*
|
||||
* Left-to-right marks here are necessary to keep the count
|
||||
* and parens together for mixed right-to-left and
|
||||
* left-to-right names.
|
||||
*/
|
||||
name = name + " \u200E(\u200E" + numChildren + ")\u200E"; //NON-NLS
|
||||
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Error getting children count to display for file: " + file, ex); //NON-NLS
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Right click action for the nodes in the directory tree.
|
||||
* Gets the context mneu (right click menu) actions for the node.
|
||||
*
|
||||
* @param popup
|
||||
* @param context Whether to find actions for context meaning or for the
|
||||
* node itself.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Action[] getActions(boolean popup) {
|
||||
public Action[] getActions(boolean context) {
|
||||
List<Action> actions = new ArrayList<>();
|
||||
|
||||
final Content content = this.getLookup().lookup(Content.class);
|
||||
if (content != null) {
|
||||
actions.addAll(DirectoryTreeFilterNode.getDetailActions(content));
|
||||
actions.addAll(ExplorerNodeActionVisitor.getActions(content));
|
||||
|
||||
//extract dir action
|
||||
Directory dir = this.getLookup().lookup(Directory.class);
|
||||
if (dir != null) {
|
||||
actions.add(ExtractAction.getInstance());
|
||||
actions.add(new AbstractAction(
|
||||
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.runIngestMods.text")) {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog(dir);
|
||||
ingestDialog.display();
|
||||
}
|
||||
});
|
||||
actions.add(new RunIngestModulesAction(dir));
|
||||
}
|
||||
|
||||
final Image img = this.getLookup().lookup(Image.class);
|
||||
|
||||
VirtualDirectory virtualDirectory = this.getLookup().lookup(VirtualDirectory.class);
|
||||
// determine if the virtualDireory is at root-level (Logical File Set).
|
||||
final VirtualDirectory virtualDirectory = this.getLookup().lookup(VirtualDirectory.class);
|
||||
boolean isRootVD = false;
|
||||
if (virtualDirectory != null) {
|
||||
try {
|
||||
@ -132,48 +126,15 @@ class DirectoryTreeFilterNode extends FilterNode {
|
||||
logger.log(Level.WARNING, "Error determining the parent of the virtual directory", ex); // NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
// 'run ingest' action and 'file search' action are added only if the
|
||||
// selected node is img node or a root level virtual directory.
|
||||
if (img != null || isRootVD) {
|
||||
actions.add(new FileSearchAction(
|
||||
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text")));
|
||||
actions.add(new AbstractAction(
|
||||
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();
|
||||
}
|
||||
});
|
||||
actions.add(new FileSearchAction(NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text")));
|
||||
actions.add(new RunIngestModulesAction(Collections.<Content>singletonList(content)));
|
||||
}
|
||||
}
|
||||
|
||||
//check if delete actions should be added
|
||||
final Node orig = getOriginal();
|
||||
//TODO add a mechanism to determine if DisplayableItemNode
|
||||
if (orig instanceof DisplayableItemNode) {
|
||||
actions.addAll(getDeleteActions((DisplayableItemNode) orig));
|
||||
}
|
||||
|
||||
actions.add(collapseAll);
|
||||
actions.add(collapseAllAction);
|
||||
return actions.toArray(new Action[actions.size()]);
|
||||
}
|
||||
|
||||
private static List<Action> getDeleteActions(DisplayableItemNode original) {
|
||||
List<Action> actions = new ArrayList<>();
|
||||
//actions.addAll(original.accept(getDeleteActionVisitor));
|
||||
return actions;
|
||||
}
|
||||
|
||||
private static List<Action> getDetailActions(Content c) {
|
||||
List<Action> actions = new ArrayList<>();
|
||||
|
||||
actions.addAll(ExplorerNodeActionVisitor.getActions(c));
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
//FIXME: this seems like a big hack -jm
|
||||
public static class OriginalNode {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* 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
|
||||
* non-deserialized instance. To obtain the singleton instance, use
|
||||
* {@link #findInstance}.
|
||||
*
|
||||
* @return instance - the default instance
|
||||
*/
|
||||
public static synchronized DirectoryTreeTopComponent getDefault() {
|
||||
if (instance == null) {
|
||||
@ -308,6 +310,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
||||
/**
|
||||
* Obtain the DirectoryTreeTopComponent instance. Never call
|
||||
* {@link #getDefault} directly!
|
||||
*
|
||||
* @return getDefault() - the default instance
|
||||
*/
|
||||
public static synchronized DirectoryTreeTopComponent findInstance() {
|
||||
WindowManager winManager = WindowManager.getDefault();
|
||||
@ -667,7 +671,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
||||
try {
|
||||
displayName = content.getUniquePath();
|
||||
} 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) {
|
||||
displayName = originNode.getLookup().lookup(String.class);
|
||||
@ -799,7 +803,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
||||
* Set the selected node using a path to a previously selected node.
|
||||
*
|
||||
* @param previouslySelectedNodePath Path to a previously selected node.
|
||||
* @param rootNodeName Name of the root node to match, may be null.
|
||||
* @param rootNodeName Name of the root node to match, may be
|
||||
* null.
|
||||
*/
|
||||
private void setSelectedNode(final String[] previouslySelectedNodePath, final String rootNodeName) {
|
||||
if (previouslySelectedNodePath == null) {
|
||||
|
@ -1,15 +1,15 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
*
|
||||
* 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.
|
||||
@ -34,7 +34,7 @@ import org.openide.util.Lookup;
|
||||
iconBase = "org/sleuthkit/autopsy/directorytree/external-viewer-rules-32x32.png",
|
||||
keywords = "#OptionsCategory_Keywords_ExternalViewer",
|
||||
keywordsCategory = "ExternalViewer",
|
||||
position = 9
|
||||
position = 11
|
||||
)
|
||||
public final class ExternalViewerOptionsPanelController extends OptionsPanelController {
|
||||
|
||||
|
@ -23,7 +23,6 @@ IngestJob.progress.fileIngest.displayName=Analyzing files from {0}
|
||||
IngestJob.progress.fileIngest.cancelMessage=Waiting for {0} on {1}
|
||||
IngestJob.progress.cancelling={0} (Cancelling...)
|
||||
IngestJob.cancellationDialog.title=Cancel Ingest
|
||||
IngestDialog.title.text=Run Ingest Modules
|
||||
IngestDialog.startButton.title=Start
|
||||
IngestDialog.closeButton.title=Close
|
||||
IngestManager.moduleErr=Module Error
|
||||
@ -114,3 +113,13 @@ IngestJobSettingsPanel.globalSettingsButton.actionCommand=Advanced
|
||||
IngestJobSettingsPanel.globalSettingsButton.text=Global Settings
|
||||
IngestJobSettingsPanel.pastJobsButton.text=History
|
||||
IngestJobSettingsPanel.fileIngestFilterLabel.text=Run ingest modules on:
|
||||
OptionsCategory_Name_IngestOptions=Ingest
|
||||
OptionsCategory_Keywords_IngestOptions=Ingest
|
||||
IngestSettingsPanel.jLabelProcessTimeOutUnits.text=hour(s)
|
||||
IngestSettingsPanel.jFormattedTextFieldProcTimeOutHrs.text=60
|
||||
IngestSettingsPanel.jCheckBoxEnableProcTimeout.text=
|
||||
IngestSettingsPanel.jLabelSetProcessTimeOut.text=Enable timeout to allow modules to automatically terminate after a set amount of time:
|
||||
IngestSettingsPanel.restartRequiredLabel.text=For this computer, a maximum of {0} file ingest threads should be used. Application restart required to take effect.
|
||||
IngestSettingsPanel.jLabelNumThreads.text=Number of threads to use for file ingest:
|
||||
IngestSettingsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
|
||||
ProfileSettingsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
|
||||
|
@ -2,7 +2,6 @@ CTL_IngestMessageTopComponent=\u30e1\u30c3\u30bb\u30fc\u30b8
|
||||
HINT_IngestMessageTopComponent=\u30e1\u30c3\u30bb\u30fc\u30b8\u30a6\u30a3\u30f3\u30c9\u30a6
|
||||
IngestDialog.closeButton.title=\u9589\u3058\u308b
|
||||
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.dataSourceIngest.displayName={1}\u306e{0}
|
||||
IngestJob.progress.fileIngest.displayName={0}\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u6790\u4e2d
|
||||
@ -111,3 +110,9 @@ IngestJob.cancelReason.outOfDiskSpace.text=\u30c7\u30a3\u30b9\u30af\u30b9\u30da\
|
||||
IngestJob.cancelReason.caseClosed.text=\u30b1\u30fc\u30b9\u3092\u9589\u3058\u307e\u3057\u305f
|
||||
IngestJobSettingsPanel.globalSettingsButton.actionCommand=\u30a2\u30c9\u30d0\u30f3\u30b9
|
||||
IngestJobSettingsPanel.globalSettingsButton.text=\u30a2\u30c9\u30d0\u30f3\u30b9
|
||||
IngestSettingsPanel.jLabelNumThreads.text=\u30d5\u30a1\u30a4\u30eb\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u306b\u4f7f\u7528\u3059\u308b\u30b9\u30ec\u30c3\u30c9\u6570\uff1a
|
||||
IngestSettingsPanel.jLabelProcessTimeOutUnits.text=\u6642\u9593
|
||||
IngestSettingsPanel.jLabelSetProcessTimeOut.text=\u4e00\u5b9a\u306e\u6642\u9593\u304c\u904e\u304e\u305f\u5f8c\u306b\u81ea\u52d5\u7684\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u505c\u6b62\u3067\u304d\u308b\u3088\u3046\u306b\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u6709\u52b9\u5316\uff1a
|
||||
IngestSettingsPanel.restartRequiredLabel.text=\u3053\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u3067\u306f\u6700\u5927{0}\u306e\u30d5\u30a1\u30a4\u30eb\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u30b9\u30ec\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u3079\u304d\u3067\u3059\u3002\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u518d\u8d77\u52d5\u304c\u5fc5\u8981\u3067\u3059\u3002
|
||||
IngestSettingsPanel.ingestWarningLabel.text=\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u3067\u3059\u3002\u5b8c\u4e86\u3059\u308b\u307e\u3067\u4e00\u90e8\u306e\u8a2d\u5b9a\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
ProfileSettingsPanel.ingestWarningLabel.text=\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u3067\u3059\u3002\u5b8c\u4e86\u3059\u308b\u307e\u3067\u4e00\u90e8\u306e\u8a2d\u5b9a\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -52,13 +52,13 @@ public class IngestJobSettings {
|
||||
|
||||
private static final String ENABLED_MODULES_KEY = "Enabled_Ingest_Modules"; //NON-NLS
|
||||
private static final String DISABLED_MODULES_KEY = "Disabled_Ingest_Modules"; //NON-NLS
|
||||
private static final String LAST_FILE_INGEST_FILTER_KEY = "Last_File_Ingest_Filter";
|
||||
private static final String LAST_FILE_INGEST_FILTER_KEY = "Last_File_Ingest_Filter"; //NON-NLS
|
||||
private static final String MODULE_SETTINGS_FOLDER = "IngestModuleSettings"; //NON-NLS
|
||||
private static final String MODULE_SETTINGS_FOLDER_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), IngestJobSettings.MODULE_SETTINGS_FOLDER).toAbsolutePath().toString();
|
||||
private static final String MODULE_SETTINGS_FILE_EXT = ".settings"; //NON-NLS
|
||||
private static final Logger LOGGER = Logger.getLogger(IngestJobSettings.class.getName());
|
||||
private FilesSet fileIngestFilter;
|
||||
private final String executionContext;
|
||||
private String executionContext;
|
||||
private final IngestType ingestType;
|
||||
private String moduleSettingsFolderPath;
|
||||
private static final CharSequence pythonModuleSettingsPrefixCS = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); //NON-NLS
|
||||
@ -66,15 +66,15 @@ public class IngestJobSettings {
|
||||
private final List<String> warnings;
|
||||
|
||||
/**
|
||||
* Gets the last selected FileIngestFilter saved in settings which is represented
|
||||
* by a FilesSet, if the last selected filter is null
|
||||
* the default filter will be returned.
|
||||
* Gets the last selected FileIngestFilter saved in settings which is
|
||||
* represented by a FilesSet, if the last selected filter is null the
|
||||
* default filter will be returned.
|
||||
*
|
||||
* @return FilesSet which represents the FileIngestFilter
|
||||
*/
|
||||
FilesSet getFileIngestFilter() {
|
||||
if (fileIngestFilter==null){
|
||||
fileIngestFilter=FilesSetsManager.getDefaultFilter();
|
||||
if (fileIngestFilter == null) {
|
||||
fileIngestFilter = FilesSetsManager.getDefaultFilter();
|
||||
}
|
||||
return fileIngestFilter;
|
||||
}
|
||||
@ -111,7 +111,7 @@ public class IngestJobSettings {
|
||||
/**
|
||||
* Constructs an ingest job settings object for a given execution context.
|
||||
* Examples of execution contexts include the add data source wizard and the
|
||||
* run ingest modules dialog. Different execution conterxts may have
|
||||
* run ingest modules dialog. Different execution contexts may have
|
||||
* different ingest job settings.
|
||||
*
|
||||
* @param executionContext The ingest execution context identifier.
|
||||
@ -128,7 +128,7 @@ public class IngestJobSettings {
|
||||
/**
|
||||
* Constructs an ingest job settings object for a given context. Examples of
|
||||
* execution contexts include the add data source wizard and the run ingest
|
||||
* modules dialog. Different execution conterxts may have different ingest
|
||||
* modules dialog. Different execution contexts may have different ingest
|
||||
* job settings.
|
||||
*
|
||||
* @param context The context identifier string.
|
||||
@ -157,10 +157,23 @@ public class IngestJobSettings {
|
||||
this.store();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the settings with a new context name removing the old profile
|
||||
* folder
|
||||
*
|
||||
* @param executionContext will be used to name the new folder for storing
|
||||
* the settings
|
||||
*/
|
||||
void saveAs(String executionContext) {
|
||||
this.executionContext = executionContext;
|
||||
this.createSavedModuleSettingsFolder();
|
||||
this.store();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ingest execution context identifier. Examples of execution
|
||||
* contexts include the add data source wizard and the run ingest modules
|
||||
* dialog. Different execution conterxts may have different ingest job
|
||||
* dialog. Different execution contexts may have different ingest job
|
||||
* settings.
|
||||
*
|
||||
* @return The execution context identifier.
|
||||
@ -246,6 +259,18 @@ public class IngestJobSettings {
|
||||
return Paths.get(IngestJobSettings.MODULE_SETTINGS_FOLDER_PATH, executionContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to the ingest module settings folder from a static
|
||||
* manner.
|
||||
*
|
||||
* @param context specify the context of the folder you wish to get
|
||||
*
|
||||
* @return path to the module settings folder
|
||||
*/
|
||||
static Path getSavedModuleSettingsFolder(String context) {
|
||||
return Paths.get(IngestJobSettings.MODULE_SETTINGS_FOLDER_PATH, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the folder for saving the individual ingest module settings part
|
||||
* of these ingest job settings.
|
||||
@ -292,8 +317,8 @@ public class IngestJobSettings {
|
||||
* Get the enabled/disabled ingest modules settings for this context. By
|
||||
* default, all loaded modules are enabled.
|
||||
*/
|
||||
HashSet<String> enabledModuleNames = getModulesNamesFromSetting(IngestJobSettings.ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(loadedModuleNames));
|
||||
HashSet<String> disabledModuleNames = getModulesNamesFromSetting(IngestJobSettings.DISABLED_MODULES_KEY, ""); //NON-NLS
|
||||
HashSet<String> enabledModuleNames = getModulesNamesFromSetting(executionContext, IngestJobSettings.ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(loadedModuleNames));
|
||||
HashSet<String> disabledModuleNames = getModulesNamesFromSetting(executionContext, IngestJobSettings.DISABLED_MODULES_KEY, ""); //NON-NLS
|
||||
|
||||
/**
|
||||
* Check for missing modules and create warnings if any are found.
|
||||
@ -352,9 +377,9 @@ public class IngestJobSettings {
|
||||
ModuleSettings.setConfigSetting(this.executionContext, IngestJobSettings.LAST_FILE_INGEST_FILTER_KEY, FilesSetsManager.getDefaultFilter().getName());
|
||||
}
|
||||
try {
|
||||
Map<String,FilesSet> fileIngestFilters = FilesSetsManager.getInstance()
|
||||
Map<String, FilesSet> fileIngestFilters = FilesSetsManager.getInstance()
|
||||
.getCustomFileIngestFilters();
|
||||
for (FilesSet fSet : FilesSetsManager.getStandardFileIngestFilters()){
|
||||
for (FilesSet fSet : FilesSetsManager.getStandardFileIngestFilters()) {
|
||||
fileIngestFilters.put(fSet.getName(), fSet);
|
||||
}
|
||||
this.fileIngestFilter = fileIngestFilters.get(ModuleSettings.getConfigSetting(
|
||||
@ -373,12 +398,12 @@ public class IngestJobSettings {
|
||||
*
|
||||
* @return The list of module names associated with the key.
|
||||
*/
|
||||
private HashSet<String> getModulesNamesFromSetting(String key, String defaultSetting) {
|
||||
if (ModuleSettings.settingExists(this.executionContext, key) == false) {
|
||||
ModuleSettings.setConfigSetting(this.executionContext, key, defaultSetting);
|
||||
private static HashSet<String> getModulesNamesFromSetting(String context, String key, String defaultSetting) {
|
||||
if (ModuleSettings.settingExists(context, key) == false) {
|
||||
ModuleSettings.setConfigSetting(context, key, defaultSetting);
|
||||
}
|
||||
HashSet<String> moduleNames = new HashSet<>();
|
||||
String modulesSetting = ModuleSettings.getConfigSetting(this.executionContext, key);
|
||||
String modulesSetting = ModuleSettings.getConfigSetting(context, key);
|
||||
if (!modulesSetting.isEmpty()) {
|
||||
String[] settingNames = modulesSetting.split(", ");
|
||||
for (String name : settingNames) {
|
||||
@ -406,6 +431,18 @@ public class IngestJobSettings {
|
||||
return moduleNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a set which contains all the names of enabled modules for the
|
||||
* specified context.
|
||||
*
|
||||
* @param context -the execution context (profile name) to check
|
||||
*
|
||||
* @return the names of the enabled modules
|
||||
*/
|
||||
static List<String> getEnabledModules(String context) {
|
||||
return new ArrayList<>(getModulesNamesFromSetting(context, ENABLED_MODULES_KEY, ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the moduleSettingsFilePath is that of a serialized jython
|
||||
* instance. Serialized Jython instances (settings saved on the disk)
|
||||
@ -489,8 +526,8 @@ public class IngestJobSettings {
|
||||
disabledModuleNames.add(moduleName);
|
||||
}
|
||||
}
|
||||
ModuleSettings.setConfigSetting(this.executionContext, ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(enabledModuleNames));
|
||||
ModuleSettings.setConfigSetting(this.executionContext, DISABLED_MODULES_KEY, makeCommaSeparatedValuesList(disabledModuleNames));
|
||||
ModuleSettings.setConfigSetting(this.executionContext, IngestJobSettings.ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(enabledModuleNames));
|
||||
ModuleSettings.setConfigSetting(this.executionContext, IngestJobSettings.DISABLED_MODULES_KEY, makeCommaSeparatedValuesList(disabledModuleNames));
|
||||
|
||||
/**
|
||||
* Save the last used File Ingest Filter setting for this context.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -185,6 +185,10 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
|
||||
pastJobsButton.setEnabled(!dataSources.isEmpty() && !ingestJobs.isEmpty());
|
||||
}
|
||||
|
||||
void setPastJobsButtonVisible(boolean isVisible) {
|
||||
pastJobsButton.setVisible(isVisible);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.4" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<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="false"/>
|
||||
<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" alignment="0" attributes="0">
|
||||
<Component id="tabbedPane" pref="824" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="tabbedPane" pref="543" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JTabbedPane" name="tabbedPane">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
225
Core/src/org/sleuthkit/autopsy/ingest/IngestOptionsPanel.java
Normal file
@ -0,0 +1,225 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel;
|
||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.PANEL_TYPE;
|
||||
|
||||
/**
|
||||
* Global options panel for keyword searching.
|
||||
*/
|
||||
public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
|
||||
|
||||
@NbBundle.Messages({"IngestOptionsPanel.settingsTab.text=Settings",
|
||||
"IngestOptionsPanel.settingsTab.toolTipText=Settings regarding resources available to ingest.",
|
||||
"IngestOptionsPanel.fileFiltersTab.text=File Filters",
|
||||
"IngestOptionsPanel.fileFiltersTab.toolTipText=Settings for creating and editing ingest file filters.",
|
||||
"IngestOptionsPanel.profilesTab.text=Profiles",
|
||||
"IngestOptionsPanel.profilesTab.toolTipText=Settings for creating and editing profiles."})
|
||||
|
||||
private FilesSetDefsPanel filterPanel;
|
||||
private final static int INDEX_OF_FILTER_PANEL = 0;
|
||||
private IngestSettingsPanel settingsPanel;
|
||||
private final static int INDEX_OF_SETTINGS_PANEL = 2;
|
||||
private ProfileSettingsPanel profilePanel;
|
||||
private final static int INDEX_OF_PROFILE_PANEL = 1;
|
||||
/**
|
||||
* 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
|
||||
* running. This is done to prevent changes to user-defined types while the
|
||||
* type definitions are in use.
|
||||
*/
|
||||
IngestJobEventPropertyChangeListener ingestJobEventsListener;
|
||||
|
||||
public IngestOptionsPanel() {
|
||||
initComponents();
|
||||
customizeComponents();
|
||||
}
|
||||
|
||||
private void customizeComponents() {
|
||||
filterPanel = new FilesSetDefsPanel(PANEL_TYPE.FILE_INGEST_FILTERS);
|
||||
settingsPanel = new IngestSettingsPanel();
|
||||
profilePanel = new ProfileSettingsPanel();
|
||||
|
||||
tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.fileFiltersTab.text"), null,
|
||||
filterPanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.fileFiltersTab.toolTipText"), INDEX_OF_FILTER_PANEL);
|
||||
tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.profilesTab.text"), null,
|
||||
profilePanel, NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.profilesTab.toolTipText"), INDEX_OF_PROFILE_PANEL);
|
||||
tabbedPane.insertTab(NbBundle.getMessage(IngestOptionsPanel.class, "IngestOptionsPanel.settingsTab.text"), null,
|
||||
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
|
||||
//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.
|
||||
tabbedPane.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
if (e.getSource() instanceof JTabbedPane) {
|
||||
//because we can have two filterPanels open at the same time
|
||||
//we need to save the settings when we change tabs otherwise
|
||||
//they could be overwritten with out of date
|
||||
if (tabbedPane.getSelectedIndex() == INDEX_OF_FILTER_PANEL) {
|
||||
filterPanel.load();
|
||||
}
|
||||
else {
|
||||
filterPanel.saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
addIngestJobEventsListener();
|
||||
enableTabs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a property change listener that listens to ingest job events to
|
||||
* disable the buttons on the panel if ingest is running. This is done to
|
||||
* prevent changes to user-defined types while the type definitions are in
|
||||
* use.
|
||||
*/
|
||||
private void addIngestJobEventsListener() {
|
||||
ingestJobEventsListener = new IngestJobEventPropertyChangeListener();
|
||||
IngestManager.getInstance().addIngestJobEventListener(ingestJobEventsListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* A property change listener that listens to ingest job events.
|
||||
*/
|
||||
private class IngestJobEventPropertyChangeListener implements PropertyChangeListener {
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
enableTabs();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables tabs and options inside of tabs during Ingest, and re-enables
|
||||
* them after Ingest is complete or cancelled.
|
||||
*/
|
||||
private void enableTabs() {
|
||||
boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
|
||||
tabbedPane.setEnabled(!ingestIsRunning);
|
||||
settingsPanel.enableButtons(!ingestIsRunning);
|
||||
profilePanel.enableButtons(!ingestIsRunning);
|
||||
filterPanel.enableButtons(!ingestIsRunning);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
filterPanel.addPropertyChangeListener(l);
|
||||
settingsPanel.addPropertyChangeListener(l);
|
||||
profilePanel.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
filterPanel.removePropertyChangeListener(l);
|
||||
settingsPanel.removePropertyChangeListener(l);
|
||||
profilePanel.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
filterPanel.store();
|
||||
settingsPanel.store();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void store() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void load() {
|
||||
filterPanel.load();
|
||||
settingsPanel.load();
|
||||
profilePanel.load();
|
||||
}
|
||||
|
||||
boolean valid() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when the cancel button is clicked.
|
||||
*/
|
||||
void cancel() {
|
||||
//doesn't need to do anything
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
|
||||
tabbedPane = new javax.swing.JTabbedPane();
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JTabbedPane tabbedPane;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2016 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -16,7 +16,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.modules.interestingitems;
|
||||
package org.sleuthkit.autopsy.ingest;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
@ -26,29 +26,22 @@ import javax.swing.SwingUtilities;
|
||||
import org.netbeans.spi.options.OptionsPanelController;
|
||||
import org.openide.util.HelpCtx;
|
||||
import org.openide.util.Lookup;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
|
||||
@OptionsPanelController.TopLevelRegistration(
|
||||
categoryName = "#OptionsCategory_Name_FileIngestFilterDefinitions",
|
||||
categoryName = "#OptionsCategory_Name_IngestOptions",
|
||||
iconBase = "org/sleuthkit/autopsy/images/file_ingest_filter32x32.png",
|
||||
keywords = "#OptionsCategory_Keywords_FileIngestFilterDefinitions",
|
||||
keywordsCategory = "FileIngestFilterDefinitions",
|
||||
position = 7
|
||||
)
|
||||
position = 2,
|
||||
keywords = "#OptionsCategory_Keywords_IngestOptions",
|
||||
keywordsCategory = "IngestOptions")
|
||||
|
||||
/**
|
||||
* Class for creating an FilesSetDefsPanel which will be used for configuring
|
||||
* the FileIngestFilter.
|
||||
*/
|
||||
public final class FileIngestFilterDefsOptionsPanelController extends OptionsPanelController {
|
||||
public class IngestOptionsPanelController extends OptionsPanelController {
|
||||
|
||||
private FilesSetDefsPanel panel;
|
||||
private IngestOptionsPanel panel;
|
||||
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
private boolean changed;
|
||||
private static final Logger LOGGER = Logger.getLogger(FileIngestFilterDefsOptionsPanelController.class.getName());
|
||||
|
||||
/**
|
||||
* Component should load its data here.
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
@ -56,11 +49,28 @@ public final class FileIngestFilterDefsOptionsPanelController extends OptionsPan
|
||||
changed = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IngestOptionsPanel which is contained inside this controller.
|
||||
*
|
||||
* @return panel
|
||||
*/
|
||||
private IngestOptionsPanel getPanel() {
|
||||
if (panel == null) {
|
||||
panel = new IngestOptionsPanel();
|
||||
panel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals(OptionsPanelController.PROP_CHANGED)) {
|
||||
changed();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when both the Ok and Apply buttons are pressed. It
|
||||
* applies to any of the panels that have been opened in the process of
|
||||
* using the options pane.
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void applyChanges() {
|
||||
@ -76,71 +86,59 @@ public final class FileIngestFilterDefsOptionsPanelController extends OptionsPan
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when the Cancel button is pressed. It applies to
|
||||
* any of the panels that have been opened in the process of using the
|
||||
* options pane.
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public void cancel() {
|
||||
// need not do anything special, if no changes have been persisted yet
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true;
|
||||
getPanel().cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to determine whether any changes have been made to this controller's
|
||||
* panel.
|
||||
*
|
||||
* @return Whether or not a change has been made.
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return getPanel().valid();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public boolean isChanged() {
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public JComponent getComponent(Lookup lkp) {
|
||||
return getPanel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public HelpCtx getHelpCtx() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@Override
|
||||
public JComponent getComponent(Lookup masterLookup) {
|
||||
return getPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
pcs.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
pcs.removePropertyChangeListener(l);
|
||||
public void addPropertyChangeListener(PropertyChangeListener pl) {
|
||||
pcs.addPropertyChangeListener(pl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an interestingItemsDefPanel that will be labeled to indicate it
|
||||
* is for File Ingest Filter settings
|
||||
*
|
||||
* @return an FilesSetDefsPanel which has text and fields modified to
|
||||
* indicate it is for File Ingest Filtering.
|
||||
* @inheritDoc
|
||||
*/
|
||||
private FilesSetDefsPanel getPanel() {
|
||||
if (panel == null) {
|
||||
panel = new FilesSetDefsPanel(FilesSetDefsPanel.PANEL_TYPE.FILE_INGEST_FILTERS);
|
||||
panel.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (evt.getPropertyName().equals(OptionsPanelController.PROP_CHANGED)) {
|
||||
changed();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return panel;
|
||||
@Override
|
||||
public void removePropertyChangeListener(PropertyChangeListener pl) {
|
||||
pcs.removePropertyChangeListener(pl);
|
||||
}
|
||||
|
||||
void changed() {
|
||||
@ -150,5 +148,4 @@ public final class FileIngestFilterDefsOptionsPanelController extends OptionsPan
|
||||
}
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
|
||||
}
|
||||
|
||||
}
|
180
Core/src/org/sleuthkit/autopsy/ingest/IngestProfiles.java
Normal file
@ -0,0 +1,180 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
|
||||
/**
|
||||
* Class for managing the access to the
|
||||
*/
|
||||
public final class IngestProfiles {
|
||||
|
||||
private static final String PROFILE_FOLDER = "IngestProfiles";
|
||||
private static final String PROFILE_NAME_KEY = "Profile_Name";
|
||||
private static final String PROFILE_DESC_KEY = "Profile_Description";
|
||||
private static final String PROFILE_FILTER_KEY = "Profile_Filter";
|
||||
|
||||
/**
|
||||
* Gets the collection of profiles which currently exist.
|
||||
*
|
||||
* @return profileList
|
||||
*/
|
||||
public synchronized static List<IngestProfile> getIngestProfiles() {
|
||||
File dir = Paths.get(PlatformUtil.getUserConfigDirectory(), PROFILE_FOLDER).toFile();
|
||||
File[] directoryListing = dir.listFiles();
|
||||
List<IngestProfile> profileList = new ArrayList<>();
|
||||
if (directoryListing != null) {
|
||||
for (File child : directoryListing) {
|
||||
String name = child.getName().split("\\.")[0];
|
||||
String context = PROFILE_FOLDER + File.separator + name;
|
||||
String desc = ModuleSettings.getConfigSetting(context, PROFILE_DESC_KEY);
|
||||
String fileIngestFilter = ModuleSettings.getConfigSetting(context, PROFILE_FILTER_KEY);
|
||||
profileList.add(new IngestProfile(name, desc, fileIngestFilter));
|
||||
}
|
||||
}
|
||||
return profileList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the list of profiles which currently exist to disk.
|
||||
*/
|
||||
synchronized static void setProfiles(List<IngestProfile> profiles) {
|
||||
for (IngestProfile profile : profiles) {
|
||||
IngestProfile.saveProfile(profile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An individual Ingest Profile, consists of a name, a description, and a
|
||||
* FileIngestFilter. The name can be used to find the ModuleSettings for
|
||||
* this profile.
|
||||
*/
|
||||
public static final class IngestProfile {
|
||||
|
||||
private final String name;
|
||||
private final String description;
|
||||
private final String fileIngestFilter;
|
||||
|
||||
/**
|
||||
* Creates a new IngestProfile
|
||||
*
|
||||
* @param name - unique name of the profile
|
||||
* @param desc - optional description of profile
|
||||
* @param selectedFilter - the File Ingest Filter used for this profile
|
||||
*/
|
||||
IngestProfile(String name, String desc, String selectedFilter) {
|
||||
this.name = name;
|
||||
this.description = desc;
|
||||
this.fileIngestFilter = selectedFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* The string value of an IngestProfile is simply its name
|
||||
*
|
||||
* @return getName();
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique name field for this Ingest Profile.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The optional user defined description of this Ingest Profile.
|
||||
*
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* The file ingest filter which was selected to be used.
|
||||
*
|
||||
* @return the fileIngestFilter
|
||||
*/
|
||||
public String getFileIngestFilter() {
|
||||
return fileIngestFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all of the files which are currently storing a profile.
|
||||
*
|
||||
* @param selectedProfile
|
||||
*/
|
||||
synchronized static void deleteProfile(IngestProfile selectedProfile) {
|
||||
try {
|
||||
Files.deleteIfExists(Paths.get(PlatformUtil.getUserConfigDirectory(), PROFILE_FOLDER, selectedProfile.getName() + ".properties"));
|
||||
Files.deleteIfExists(Paths.get(PlatformUtil.getUserConfigDirectory(), selectedProfile.getName() + ".properties"));
|
||||
FileUtils.deleteDirectory(IngestJobSettings.getSavedModuleSettingsFolder(selectedProfile.getName() + File.separator).toFile());
|
||||
} catch (IOException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renames the files and directories associated with a profile
|
||||
*
|
||||
* @param oldName the name of the profile you want to rename
|
||||
* @param newName the name which you want the profile to have
|
||||
*/
|
||||
synchronized static void renameProfile(String oldName, String newName) {
|
||||
if (!oldName.equals(newName)) { //if renameProfile was called with the new name being the same as the old name, it is complete already
|
||||
File oldFile = Paths.get(PlatformUtil.getUserConfigDirectory(), PROFILE_FOLDER, oldName + ".properties").toFile();
|
||||
File newFile = Paths.get(PlatformUtil.getUserConfigDirectory(), PROFILE_FOLDER, newName + ".properties").toFile();
|
||||
oldFile.renameTo(newFile);
|
||||
oldFile = Paths.get(PlatformUtil.getUserConfigDirectory(), oldName + ".properties").toFile();
|
||||
newFile = Paths.get(PlatformUtil.getUserConfigDirectory(), newName + ".properties").toFile();
|
||||
oldFile.renameTo(newFile);
|
||||
oldFile = IngestJobSettings.getSavedModuleSettingsFolder(oldName + File.separator).toFile();
|
||||
newFile = IngestJobSettings.getSavedModuleSettingsFolder(newName + File.separator).toFile();
|
||||
oldFile.renameTo(newFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a Ingest profile file in the profile folder.
|
||||
*
|
||||
* @param profile
|
||||
*/
|
||||
synchronized static void saveProfile(IngestProfile profile) {
|
||||
String context = PROFILE_FOLDER + File.separator + profile.getName();
|
||||
ModuleSettings.setConfigSetting(context, PROFILE_NAME_KEY, profile.getName());
|
||||
ModuleSettings.setConfigSetting(context, PROFILE_DESC_KEY, profile.getDescription());
|
||||
ModuleSettings.setConfigSetting(context, PROFILE_FILTER_KEY, profile.getFileIngestFilter());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2014 Basis Technology Corp.
|
||||
*
|
||||
* 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.
|
||||
@ -38,7 +38,7 @@ import org.openide.windows.WindowManager;
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
|
205
Core/src/org/sleuthkit/autopsy/ingest/IngestSettingsPanel.form
Normal file
@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<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>
|
||||
<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">
|
||||
<Component id="jScrollPane1" alignment="0" pref="691" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<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>
|
||||
<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">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Component id="numberOfFileIngestThreadsComboBox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="restartRequiredLabel" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabelNumThreads" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelSetProcessTimeOut" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Component id="jCheckBoxEnableProcTimeout" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jFormattedTextFieldProcTimeOutHrs" min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabelProcessTimeOutUnits" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="213" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="52" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
|
||||
<Component id="jLabelNumThreads" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="numberOfFileIngestThreadsComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="restartRequiredLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabelSetProcessTimeOut" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jCheckBoxEnableProcTimeout" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="jFormattedTextFieldProcTimeOutHrs" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabelProcessTimeOutUnits" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="257" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabelNumThreads">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.jLabelNumThreads.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="numberOfFileIngestThreadsComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="numberOfFileIngestThreadsComboBoxActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<Integer>"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="restartRequiredLabel">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/corecomponents/warning16.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.restartRequiredLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelSetProcessTimeOut">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.jLabelSetProcessTimeOut.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="jCheckBoxEnableProcTimeout">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.jCheckBoxEnableProcTimeout.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBoxEnableProcTimeoutActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JFormattedTextField" name="jFormattedTextFieldProcTimeOutHrs">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.jFormattedTextFieldProcTimeOutHrs.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jFormattedTextFieldProcTimeOutHrsActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new JFormattedTextField(NumberFormat.getIntegerInstance());"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabelProcessTimeOutUnits">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.jLabelProcessTimeOutUnits.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="ingestWarningLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="false" component="ingestWarningLabel" property="font" relativeSize="false" size="11"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestSettingsPanel.ingestWarningLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
283
Core/src/org/sleuthkit/autopsy/ingest/IngestSettingsPanel.java
Normal file
@ -0,0 +1,283 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2013-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;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JFormattedTextField;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.event.DocumentListener;
|
||||
import org.netbeans.spi.options.OptionsPanelController;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
|
||||
/**
|
||||
* Options panel that allow users to set application preferences.
|
||||
*/
|
||||
final class IngestSettingsPanel extends IngestModuleGlobalSettingsPanel {
|
||||
|
||||
IngestSettingsPanel() {
|
||||
initComponents();
|
||||
int availableProcessors = Runtime.getRuntime().availableProcessors();
|
||||
Integer fileIngestThreadCountChoices[];
|
||||
int recommendedFileIngestThreadCount;
|
||||
|
||||
if (availableProcessors >= 6) {
|
||||
fileIngestThreadCountChoices = new Integer[]{1, 2, 4, 6};
|
||||
recommendedFileIngestThreadCount = 4;
|
||||
} else if (availableProcessors >= 4 && availableProcessors <= 5) {
|
||||
fileIngestThreadCountChoices = new Integer[]{1, 2, 4};
|
||||
recommendedFileIngestThreadCount = 2;
|
||||
} else if (availableProcessors >= 2 && availableProcessors <= 3) {
|
||||
fileIngestThreadCountChoices = new Integer[]{1, 2};
|
||||
recommendedFileIngestThreadCount = 1;
|
||||
} else {
|
||||
fileIngestThreadCountChoices = new Integer[]{1};
|
||||
recommendedFileIngestThreadCount = 1;
|
||||
}
|
||||
numberOfFileIngestThreadsComboBox.setModel(new DefaultComboBoxModel<>(fileIngestThreadCountChoices));
|
||||
restartRequiredLabel.setText(NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.restartRequiredLabel.text", recommendedFileIngestThreadCount));
|
||||
// TODO listen to changes in form fields and call controller.changed()
|
||||
DocumentListener docListener = new DocumentListener() {
|
||||
|
||||
@Override
|
||||
public void insertUpdate(DocumentEvent e) {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUpdate(DocumentEvent e) {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}
|
||||
};
|
||||
this.jFormattedTextFieldProcTimeOutHrs.getDocument().addDocumentListener(docListener);
|
||||
this.ingestWarningLabel.setVisible(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the existing settings.
|
||||
*/
|
||||
void load() {
|
||||
numberOfFileIngestThreadsComboBox.setSelectedItem(UserPreferences.numberOfFileIngestThreads());
|
||||
if (UserPreferences.getIsTimeOutEnabled()) {
|
||||
// user specified time out
|
||||
jCheckBoxEnableProcTimeout.setSelected(true);
|
||||
jFormattedTextFieldProcTimeOutHrs.setEditable(true);
|
||||
int timeOutHrs = UserPreferences.getProcessTimeOutHrs();
|
||||
jFormattedTextFieldProcTimeOutHrs.setValue((long) timeOutHrs);
|
||||
} else {
|
||||
// never time out
|
||||
jCheckBoxEnableProcTimeout.setSelected(false);
|
||||
jFormattedTextFieldProcTimeOutHrs.setEditable(false);
|
||||
int timeOutHrs = UserPreferences.getProcessTimeOutHrs();
|
||||
jFormattedTextFieldProcTimeOutHrs.setValue((long) timeOutHrs);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the existing settings.
|
||||
*/
|
||||
void store() {
|
||||
UserPreferences.setNumberOfFileIngestThreads((Integer) numberOfFileIngestThreadsComboBox.getSelectedItem());
|
||||
|
||||
UserPreferences.setIsTimeOutEnabled(jCheckBoxEnableProcTimeout.isSelected());
|
||||
if (jCheckBoxEnableProcTimeout.isSelected()) {
|
||||
// only store time out if it is enabled
|
||||
long timeOutHrs = (long) jFormattedTextFieldProcTimeOutHrs.getValue();
|
||||
UserPreferences.setProcessTimeOutHrs((int) timeOutHrs);
|
||||
}
|
||||
}
|
||||
|
||||
boolean valid() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable or Disable buttons based on whether Ingest is running.
|
||||
*
|
||||
* @param isEnabled
|
||||
*/
|
||||
void enableButtons(boolean isEnabled) {
|
||||
numberOfFileIngestThreadsComboBox.setEnabled(isEnabled);
|
||||
jFormattedTextFieldProcTimeOutHrs.setEnabled(isEnabled);
|
||||
jCheckBoxEnableProcTimeout.setEnabled(isEnabled);
|
||||
ingestWarningLabel.setVisible(!isEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jLabelNumThreads = new javax.swing.JLabel();
|
||||
numberOfFileIngestThreadsComboBox = new javax.swing.JComboBox<>();
|
||||
restartRequiredLabel = new javax.swing.JLabel();
|
||||
jLabelSetProcessTimeOut = new javax.swing.JLabel();
|
||||
jCheckBoxEnableProcTimeout = new javax.swing.JCheckBox();
|
||||
jFormattedTextFieldProcTimeOutHrs = new JFormattedTextField(NumberFormat.getIntegerInstance());
|
||||
jLabelProcessTimeOutUnits = new javax.swing.JLabel();
|
||||
ingestWarningLabel = new javax.swing.JLabel();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(693, 413));
|
||||
|
||||
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
|
||||
|
||||
numberOfFileIngestThreadsComboBox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
numberOfFileIngestThreadsComboBoxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
restartRequiredLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/warning16.png"))); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(restartRequiredLabel, org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.restartRequiredLabel.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabelSetProcessTimeOut, org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.jLabelSetProcessTimeOut.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxEnableProcTimeout, org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.jCheckBoxEnableProcTimeout.text")); // NOI18N
|
||||
jCheckBoxEnableProcTimeout.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jCheckBoxEnableProcTimeoutActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jFormattedTextFieldProcTimeOutHrs.setText(org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.jFormattedTextFieldProcTimeOutHrs.text")); // NOI18N
|
||||
jFormattedTextFieldProcTimeOutHrs.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jFormattedTextFieldProcTimeOutHrsActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabelProcessTimeOutUnits, org.openide.util.NbBundle.getMessage(IngestSettingsPanel.class, "IngestSettingsPanel.jLabelProcessTimeOutUnits.text")); // NOI18N
|
||||
|
||||
ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||
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(IngestSettingsPanel.class, "IngestSettingsPanel.ingestWarningLabel.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(numberOfFileIngestThreadsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(restartRequiredLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabelNumThreads)
|
||||
.addComponent(jLabelSetProcessTimeOut)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(jCheckBoxEnableProcTimeout)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jFormattedTextFieldProcTimeOutHrs, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabelProcessTimeOutUnits)))
|
||||
.addGap(213, 213, 213)))
|
||||
.addContainerGap(52, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(ingestWarningLabel)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(30, 30, 30)
|
||||
.addComponent(jLabelNumThreads)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(numberOfFileIngestThreadsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(restartRequiredLabel))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabelSetProcessTimeOut)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jCheckBoxEnableProcTimeout)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jFormattedTextFieldProcTimeOutHrs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabelProcessTimeOutUnits)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(ingestWarningLabel)
|
||||
.addContainerGap(257, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jScrollPane1.setViewportView(jPanel1);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1)
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void jFormattedTextFieldProcTimeOutHrsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_jFormattedTextFieldProcTimeOutHrsActionPerformed
|
||||
|
||||
private void jCheckBoxEnableProcTimeoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxEnableProcTimeoutActionPerformed
|
||||
jFormattedTextFieldProcTimeOutHrs.setEditable(jCheckBoxEnableProcTimeout.isSelected());
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_jCheckBoxEnableProcTimeoutActionPerformed
|
||||
|
||||
private void numberOfFileIngestThreadsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numberOfFileIngestThreadsComboBoxActionPerformed
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_numberOfFileIngestThreadsComboBoxActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel ingestWarningLabel;
|
||||
private javax.swing.JCheckBox jCheckBoxEnableProcTimeout;
|
||||
private javax.swing.JFormattedTextField jFormattedTextFieldProcTimeOutHrs;
|
||||
private javax.swing.JLabel jLabelNumThreads;
|
||||
private javax.swing.JLabel jLabelProcessTimeOutUnits;
|
||||
private javax.swing.JLabel jLabelSetProcessTimeOut;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JComboBox<Integer> numberOfFileIngestThreadsComboBox;
|
||||
private javax.swing.JLabel restartRequiredLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
this.store();
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2012-2016 Basis Technology Corp.
|
||||
* Copyright 2012-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
108
Core/src/org/sleuthkit/autopsy/ingest/ProfilePanel.form
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<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 min="-2" pref="6" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="profileDescLabel" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="366" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="profileDescPane" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="profileNameField" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileNameLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileNameField" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileDescLabel" min="-2" pref="22" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileDescPane" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="21" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="profileDescPane">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="profileDescArea">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="wrapStyleWord" type="boolean" value="true"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[10, 22]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[14, 40]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="profileDescLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/profiles/Bundle.properties" key="ProfilePanel.profileDescLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="profileNameLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/profiles/Bundle.properties" key="ProfilePanel.profileNameLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="profileNameField">
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
241
Core/src/org/sleuthkit/autopsy/ingest/ProfilePanel.java
Normal file
@ -0,0 +1,241 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
|
||||
|
||||
/**
|
||||
* Panel to display options for profile creation and editing.
|
||||
*/
|
||||
class ProfilePanel extends IngestModuleGlobalSettingsPanel {
|
||||
|
||||
@NbBundle.Messages({"ProfilePanel.profileDescLabel.text=Profile Description:",
|
||||
"ProfilePanel.profileNameLabel.text=Profile Name:",
|
||||
"ProfilePanel.newProfileText=NewEmptyProfile",
|
||||
"ProfilePanel.messages.profilesMustBeNamed=Ingest profile must be named.",
|
||||
"ProfilePanel.messages.profileNameContainsIllegalCharacter=Profile name contains an illegal character"})
|
||||
|
||||
private final IngestJobSettingsPanel ingestSettingsPanel;
|
||||
private final IngestJobSettings settings;
|
||||
private IngestProfile profile;
|
||||
private final static String NEW_PROFILE_NAME = NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.newProfileText");
|
||||
private static final List<String> ILLEGAL_NAME_CHARS = Collections.unmodifiableList(new ArrayList<>(Arrays.asList("\\", "/", ":", "*", "?", "\"", "<", ">")));
|
||||
|
||||
/**
|
||||
* Creates new form ProfilePanel
|
||||
*/
|
||||
ProfilePanel() {
|
||||
initComponents();
|
||||
settings = new IngestJobSettings(NEW_PROFILE_NAME);
|
||||
ingestSettingsPanel = new IngestJobSettingsPanel(settings);
|
||||
ingestSettingsPanel.setPastJobsButtonVisible(false);
|
||||
jPanel1.add(ingestSettingsPanel, 0);
|
||||
|
||||
}
|
||||
|
||||
ProfilePanel(IngestProfile selectedProfile) {
|
||||
initComponents();
|
||||
profile = selectedProfile;
|
||||
profileDescArea.setText(profile.getDescription());
|
||||
profileNameField.setText(profile.getName());
|
||||
settings = new IngestJobSettings(selectedProfile.getName());
|
||||
ingestSettingsPanel = new IngestJobSettingsPanel(settings);
|
||||
ingestSettingsPanel.setPastJobsButtonVisible(false);
|
||||
jPanel1.add(ingestSettingsPanel, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the profile.
|
||||
*
|
||||
* The name will not contain any trailing or leading spaces.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getProfileName() {
|
||||
return profileNameField.getText().trim();
|
||||
}
|
||||
|
||||
String getProfileDesc() {
|
||||
return profileDescArea.getText();
|
||||
}
|
||||
|
||||
IngestJobSettings getSettings() {
|
||||
return ingestSettingsPanel.getSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
profileDescPane = new javax.swing.JScrollPane();
|
||||
profileDescArea = new javax.swing.JTextArea();
|
||||
profileDescLabel = new javax.swing.JLabel();
|
||||
profileNameLabel = new javax.swing.JLabel();
|
||||
profileNameField = new javax.swing.JTextField();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
|
||||
profileDescArea.setColumns(20);
|
||||
profileDescArea.setLineWrap(true);
|
||||
profileDescArea.setRows(5);
|
||||
profileDescArea.setWrapStyleWord(true);
|
||||
profileDescArea.setMinimumSize(new java.awt.Dimension(10, 22));
|
||||
profileDescArea.setPreferredSize(new java.awt.Dimension(14, 40));
|
||||
profileDescPane.setViewportView(profileDescArea);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(profileDescLabel, org.openide.util.NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.profileDescLabel.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(profileNameLabel, org.openide.util.NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.profileNameLabel.text")); // NOI18N
|
||||
|
||||
jPanel1.setLayout(new java.awt.BorderLayout());
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(6, 6, 6)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(profileDescLabel)
|
||||
.addComponent(profileNameLabel))
|
||||
.addContainerGap(366, Short.MAX_VALUE))))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(profileDescPane, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(profileNameField))
|
||||
.addGap(6, 6, 6))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(profileNameLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(profileNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(profileDescLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(profileDescPane)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(21, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
@Override
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
ingestSettingsPanel.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
ingestSettingsPanel.addPropertyChangeListener(l);
|
||||
}
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JTextArea profileDescArea;
|
||||
private javax.swing.JLabel profileDescLabel;
|
||||
private javax.swing.JScrollPane profileDescPane;
|
||||
private javax.swing.JTextField profileNameField;
|
||||
private javax.swing.JLabel profileNameLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
/**
|
||||
* Save a new or edited profile.
|
||||
*/
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
if (profile == null) {
|
||||
IngestProfile.renameProfile(settings.getExecutionContext(), getProfileName());
|
||||
} else if (!profile.getName().equals(getProfileName())) {
|
||||
IngestProfile.renameProfile(profile.getName(), getProfileName());
|
||||
}
|
||||
profile = new IngestProfile(getProfileName(), profileDescArea.getText(), ingestSettingsPanel.getSettings().getFileIngestFilter().getName());
|
||||
IngestProfile.saveProfile(profile);
|
||||
ingestSettingsPanel.getSettings().saveAs(getProfileName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a new or edited profile.
|
||||
*/
|
||||
void store() {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
void load() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that information entered constitutes a valid ingest profile.
|
||||
*
|
||||
* @return true for valid, false for invalid.
|
||||
*/
|
||||
boolean isValidDefinition() {
|
||||
if (getProfileName().isEmpty()) {
|
||||
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
||||
NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.messages.profilesMustBeNamed"),
|
||||
NotifyDescriptor.WARNING_MESSAGE);
|
||||
DialogDisplayer.getDefault().notify(notifyDesc);
|
||||
return false;
|
||||
}
|
||||
if (!containsOnlyLegalChars(getProfileName(), ILLEGAL_NAME_CHARS)) {
|
||||
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
|
||||
NbBundle.getMessage(ProfilePanel.class, "ProfilePanel.messages.profileNameContainsIllegalCharacter"),
|
||||
NotifyDescriptor.WARNING_MESSAGE);
|
||||
DialogDisplayer.getDefault().notify(notifyDesc);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks an input string for the use of illegal characters.
|
||||
*
|
||||
* @param toBeChecked The input string.
|
||||
* @param illegalChars The characters deemed to be illegal.
|
||||
*
|
||||
* @return True if the string does not contain illegal characters, false
|
||||
* otherwise.
|
||||
*/
|
||||
private static boolean containsOnlyLegalChars(String toBeChecked, List<String> illegalChars) {
|
||||
for (String illegalChar : illegalChars) {
|
||||
if (toBeChecked.contains(illegalChar)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
344
Core/src/org/sleuthkit/autopsy/ingest/ProfileSettingsPanel.form
Normal file
@ -0,0 +1,344 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.4" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[800, 488]"/>
|
||||
</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" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="profileListLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="profileListPane" alignment="1" min="-2" pref="339" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="newProfileButton" linkSize="5" min="-2" pref="107" max="-2" 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>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<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="102" alignment="0" attributes="0">
|
||||
<Component id="filterNameLabel" min="-2" pref="36" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="filterNameText" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="filterDescLabel" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="selectedModulesLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileDescLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="filterDescPane" alignment="1" pref="413" max="32767" attributes="0"/>
|
||||
<Component id="profileDescPane" alignment="1" pref="413" max="32767" attributes="0"/>
|
||||
<Component id="selectedModulesPane" alignment="1" pref="413" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" 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">
|
||||
<Component id="profileListLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="profileDescLabel" alignment="3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="profileDescPane" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="filterNameLabel" max="32767" attributes="0"/>
|
||||
<Component id="filterNameText" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="filterDescLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="filterDescPane" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
<Component id="selectedModulesLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="selectedModulesPane" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="profileListPane" pref="415" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="newProfileButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="editProfileButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="deleteProfileButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="ingestWarningLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jSeparator2" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="profileListPane">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JList" name="profileList">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
<Property name="selectionMode" type="int" value="0"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<IngestProfile>"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</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/Bundle.properties" key="ProfileSettingsPanel.profileListLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="newProfileButton">
|
||||
<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">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.newProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</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">
|
||||
<Dimension value="[97, 23]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[97, 23]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[97, 23]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newProfileButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="editProfileButton">
|
||||
<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">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.editProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</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">
|
||||
<Dimension value="[97, 23]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[97, 23]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[97, 23]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="editProfileButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="deleteProfileButton">
|
||||
<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">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.deleteProfileButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</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>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteProfileButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="profileDescPane">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="profileDescArea">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="f0" green="f0" red="f0" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[10, 22]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[14, 40]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="profileDescLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.profileDescLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="filterNameLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.filterNameLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="filterNameText">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="filterDescLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.filterDescLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="filterDescPane">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="filterDescArea">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="f0" green="f0" red="f0" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[10, 40]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[14, 42]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="selectedModulesPane">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="selectedModulesArea">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="f0" green="f0" red="f0" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="selectedModulesLabel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.selectedModulesLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="ingestWarningLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="false" component="ingestWarningLabel" property="font" relativeSize="false" size="11"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="ProfileSettingsPanel.ingestWarningLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSeparator" name="jSeparator2">
|
||||
<Properties>
|
||||
<Property name="orientation" type="int" value="1"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
448
Core/src/org/sleuthkit/autopsy/ingest/ProfileSettingsPanel.java
Normal file
@ -0,0 +1,448 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import javax.swing.DefaultListModel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import org.netbeans.spi.options.OptionsPanelController;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
|
||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
|
||||
|
||||
class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
|
||||
|
||||
@NbBundle.Messages({"ProfileSettingsPanel.title=Profile Settings",
|
||||
"ProfileSettingsPanel.profileListLabel.text=Profiles:",
|
||||
"ProfileSettingsPanel.profileDescLabel.text=Profile Description:",
|
||||
"ProfileSettingsPanel.filterNameLabel.text=Filter:",
|
||||
"ProfileSettingsPanel.filterDescLabel.text=Filter Description:",
|
||||
"ProfileSettingsPanel.selectedModulesLabel.text=Selected Ingest Modules:",
|
||||
"ProfileSettingsPanel.newProfileButton.text=New Profile",
|
||||
"ProfileSettingsPanel.editProfileButton.text=Edit Profile",
|
||||
"ProfileSettingsPanel.deleteProfileButton.text=Delete Profile",
|
||||
"ProfileSettingsPanel.messages.filterLoadFailed=Failed to load file ingest filter",
|
||||
"# {0} - profile name",
|
||||
"ProfileSettingsPanel.doFileSetsDialog.duplicateProfile.text=Profile with name {0} already exists."
|
||||
})
|
||||
|
||||
private final DefaultListModel<IngestProfile> profilesListModel;
|
||||
private Map<String, IngestProfile> profiles;
|
||||
private ProfilePanel panel;
|
||||
|
||||
/**
|
||||
* Creates new form ProfileOptionsPanel
|
||||
*/
|
||||
ProfileSettingsPanel() {
|
||||
this.profilesListModel = new DefaultListModel<>();
|
||||
initComponents();
|
||||
this.profileList.setModel(profilesListModel);
|
||||
this.profileList.addListSelectionListener(new ProfileSettingsPanel.ProfileListSelectionListener());
|
||||
ingestWarningLabel.setVisible(false);
|
||||
editProfileButton.setEnabled(false);
|
||||
deleteProfileButton.setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
profileListPane = new javax.swing.JScrollPane();
|
||||
profileList = new javax.swing.JList<>();
|
||||
profileListLabel = new javax.swing.JLabel();
|
||||
newProfileButton = new javax.swing.JButton();
|
||||
editProfileButton = new javax.swing.JButton();
|
||||
deleteProfileButton = new javax.swing.JButton();
|
||||
profileDescPane = new javax.swing.JScrollPane();
|
||||
profileDescArea = new javax.swing.JTextArea();
|
||||
profileDescLabel = new javax.swing.JLabel();
|
||||
filterNameLabel = new javax.swing.JLabel();
|
||||
filterNameText = new javax.swing.JLabel();
|
||||
filterDescLabel = new javax.swing.JLabel();
|
||||
filterDescPane = new javax.swing.JScrollPane();
|
||||
filterDescArea = new javax.swing.JTextArea();
|
||||
selectedModulesPane = new javax.swing.JScrollPane();
|
||||
selectedModulesArea = new javax.swing.JTextArea();
|
||||
selectedModulesLabel = new javax.swing.JLabel();
|
||||
ingestWarningLabel = new javax.swing.JLabel();
|
||||
jSeparator2 = new javax.swing.JSeparator();
|
||||
|
||||
setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
setPreferredSize(new java.awt.Dimension(800, 488));
|
||||
|
||||
profileList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
profileListPane.setViewportView(profileList);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(profileListLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.profileListLabel.text")); // NOI18N
|
||||
|
||||
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
|
||||
newProfileButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
|
||||
newProfileButton.setMaximumSize(new java.awt.Dimension(97, 23));
|
||||
newProfileButton.setMinimumSize(new java.awt.Dimension(97, 23));
|
||||
newProfileButton.setPreferredSize(new java.awt.Dimension(97, 23));
|
||||
newProfileButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
newProfileButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
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
|
||||
editProfileButton.setMargin(new java.awt.Insets(2, 8, 2, 8));
|
||||
editProfileButton.setMaximumSize(new java.awt.Dimension(97, 23));
|
||||
editProfileButton.setMinimumSize(new java.awt.Dimension(97, 23));
|
||||
editProfileButton.setPreferredSize(new java.awt.Dimension(97, 23));
|
||||
editProfileButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
editProfileButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
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
|
||||
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() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
deleteProfileButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
profileDescArea.setEditable(false);
|
||||
profileDescArea.setBackground(new java.awt.Color(240, 240, 240));
|
||||
profileDescArea.setColumns(20);
|
||||
profileDescArea.setLineWrap(true);
|
||||
profileDescArea.setRows(5);
|
||||
profileDescArea.setMinimumSize(new java.awt.Dimension(10, 22));
|
||||
profileDescArea.setPreferredSize(new java.awt.Dimension(14, 40));
|
||||
profileDescPane.setViewportView(profileDescArea);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(profileDescLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.profileDescLabel.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(filterNameLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.filterNameLabel.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(filterDescLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.filterDescLabel.text")); // NOI18N
|
||||
|
||||
filterDescArea.setEditable(false);
|
||||
filterDescArea.setBackground(new java.awt.Color(240, 240, 240));
|
||||
filterDescArea.setColumns(20);
|
||||
filterDescArea.setRows(5);
|
||||
filterDescArea.setMinimumSize(new java.awt.Dimension(10, 40));
|
||||
filterDescArea.setPreferredSize(new java.awt.Dimension(14, 42));
|
||||
filterDescPane.setViewportView(filterDescArea);
|
||||
|
||||
selectedModulesArea.setEditable(false);
|
||||
selectedModulesArea.setBackground(new java.awt.Color(240, 240, 240));
|
||||
selectedModulesArea.setColumns(20);
|
||||
selectedModulesArea.setLineWrap(true);
|
||||
selectedModulesArea.setRows(5);
|
||||
selectedModulesPane.setViewportView(selectedModulesArea);
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(selectedModulesLabel, org.openide.util.NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.selectedModulesLabel.text")); // NOI18N
|
||||
|
||||
ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||
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
|
||||
|
||||
jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
|
||||
|
||||
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(profileListLabel)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.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)
|
||||
.addComponent(editProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(deleteProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.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.createSequentialGroup()
|
||||
.addComponent(filterNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(filterNameText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(filterDescLabel)
|
||||
.addComponent(selectedModulesLabel)
|
||||
.addComponent(profileDescLabel))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(8, 8, 8)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(ingestWarningLabel)
|
||||
.addGap(0, 0, 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, javax.swing.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE)
|
||||
.addComponent(selectedModulesPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE))))
|
||||
.addGap(12, 12, 12))
|
||||
);
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteProfileButton, editProfileButton, newProfileButton});
|
||||
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(profileListLabel)
|
||||
.addComponent(profileDescLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(profileDescPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(filterNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(filterNameText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(filterDescLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(filterDescPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(selectedModulesLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(selectedModulesPane))
|
||||
.addComponent(profileListPane, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE))
|
||||
.addGap(4, 4, 4)
|
||||
.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(editProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(deleteProfileButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(ingestWarningLabel))
|
||||
.addContainerGap())
|
||||
.addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING)))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void newProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newProfileButtonActionPerformed
|
||||
doProfileDialog(null);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_newProfileButtonActionPerformed
|
||||
|
||||
private void deleteProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteProfileButtonActionPerformed
|
||||
IngestProfile selectedProfile = this.profileList.getSelectedValue();
|
||||
this.profilesListModel.removeElement(selectedProfile);
|
||||
profiles.remove(selectedProfile.getName());
|
||||
IngestProfile.deleteProfile(selectedProfile);
|
||||
|
||||
// Select the first of the remaining set definitions. This will cause
|
||||
// the selection listeners to repopulate the subordinate components.
|
||||
this.resetComponents();
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_deleteProfileButtonActionPerformed
|
||||
|
||||
/**
|
||||
* Enable / disable buttons, so they can be disabled while ingest is
|
||||
* running.
|
||||
*
|
||||
* @param isEnabled
|
||||
*/
|
||||
void enableButtons(boolean isEnabled) {
|
||||
newProfileButton.setEnabled(isEnabled);
|
||||
editProfileButton.setEnabled(isEnabled);
|
||||
deleteProfileButton.setEnabled(isEnabled);
|
||||
ingestWarningLabel.setVisible(!isEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh displayed information.
|
||||
*/
|
||||
private void resetComponents() {
|
||||
if (!this.profilesListModel.isEmpty()) {
|
||||
this.profileList.setSelectedIndex(0);
|
||||
} else {
|
||||
this.profilesListModel.clear();
|
||||
this.profileDescArea.setText("");
|
||||
this.filterDescArea.setText("");
|
||||
this.filterNameText.setText("");
|
||||
this.selectedModulesArea.setText("");
|
||||
}
|
||||
refreshEditDeleteButtons();
|
||||
}
|
||||
|
||||
/**
|
||||
* When Ingest is not running this will changed enabled status of the edit
|
||||
* and delete buttons to reflect their current availability.
|
||||
*/
|
||||
private void refreshEditDeleteButtons() {
|
||||
if (newProfileButton.isEnabled()) {
|
||||
if (profilesListModel.isEmpty()) {
|
||||
editProfileButton.setEnabled(false);
|
||||
deleteProfileButton.setEnabled(false);
|
||||
} else {
|
||||
editProfileButton.setEnabled(true);
|
||||
deleteProfileButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void editProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editProfileButtonActionPerformed
|
||||
IngestProfile selectedProfile = profileList.getSelectedValue();
|
||||
doProfileDialog(selectedProfile);
|
||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||
}//GEN-LAST:event_editProfileButtonActionPerformed
|
||||
|
||||
/**
|
||||
* Open a dialog for the the creation or modification of a profile.
|
||||
*
|
||||
* @param selectedProfile
|
||||
*/
|
||||
private void doProfileDialog(IngestProfile selectedProfile) {
|
||||
// Create a files set defintion panel.
|
||||
if (selectedProfile != null) {
|
||||
// Editing an existing set definition.
|
||||
panel = new ProfilePanel(selectedProfile);
|
||||
} else {
|
||||
// Creating a new set definition.
|
||||
panel = new ProfilePanel();
|
||||
}
|
||||
// Do a dialog box with the profilePanel till the user enters a name or chooses cancel
|
||||
int option = JOptionPane.OK_OPTION;
|
||||
do {
|
||||
option = JOptionPane.showConfirmDialog(null, panel, Bundle.ProfileSettingsPanel_title(), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
|
||||
} 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.
|
||||
// In case of editing an existing profile(selectedProfile != null), following check is not performed.
|
||||
if (this.profiles.containsKey(panel.getProfileName()) && selectedProfile == null) {
|
||||
MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
|
||||
"ProfileSettingsPanel.doFileSetsDialog.duplicateProfile.text",
|
||||
panel.getProfileName()));
|
||||
return;
|
||||
}
|
||||
panel.saveSettings();
|
||||
load();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void store() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the stored profile information.
|
||||
*/
|
||||
@Override
|
||||
public void load() {
|
||||
int currentIndex = this.profileList.getSelectedIndex();
|
||||
this.profilesListModel.clear();
|
||||
this.profiles = new TreeMap<>();
|
||||
for (IngestProfile profile : IngestProfiles.getIngestProfiles()) {
|
||||
profilesListModel.addElement(profile);
|
||||
profiles.put(profile.getName(), profile);
|
||||
}
|
||||
if (currentIndex < 0 || currentIndex >= profilesListModel.getSize()) {
|
||||
currentIndex = 0;
|
||||
}
|
||||
refreshEditDeleteButtons();
|
||||
this.profileList.setSelectedIndex(currentIndex);
|
||||
}
|
||||
|
||||
private final class ProfileListSelectionListener implements ListSelectionListener {
|
||||
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
if (e.getValueIsAdjusting()) {
|
||||
return;
|
||||
}
|
||||
// Get the selected interesting files set and populate the set
|
||||
// components.
|
||||
IngestProfile selectedProfile = ProfileSettingsPanel.this.profileList.getSelectedValue();
|
||||
if (selectedProfile != null) {
|
||||
profileDescArea.setText(selectedProfile.getDescription());
|
||||
filterNameText.setText(selectedProfile.getFileIngestFilter());
|
||||
editProfileButton.setEnabled(true);
|
||||
deleteProfileButton.setEnabled(true);
|
||||
try {
|
||||
Map<String, FilesSet> fileIngestFilters = FilesSetsManager.getInstance().getCustomFileIngestFilters();
|
||||
for (FilesSet fSet : FilesSetsManager.getStandardFileIngestFilters()) {
|
||||
fileIngestFilters.put(fSet.getName(), fSet);
|
||||
}
|
||||
filterDescArea.setText(fileIngestFilters.get(selectedProfile.getFileIngestFilter()).getDescription());
|
||||
} catch (FilesSetsManager.FilesSetsManagerException ex) {
|
||||
filterDescArea.setText(NbBundle.getMessage(ProfileSettingsPanel.class, "ProfileSettingsPanel.messages.filterLoadFailed"));
|
||||
}
|
||||
selectedModulesArea.setText("");
|
||||
for (String moduleName : IngestJobSettings.getEnabledModules(selectedProfile.getName())) {
|
||||
selectedModulesArea.append(moduleName + "\n");
|
||||
}
|
||||
|
||||
} else {
|
||||
editProfileButton.setEnabled(false);
|
||||
deleteProfileButton.setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton deleteProfileButton;
|
||||
private javax.swing.JButton editProfileButton;
|
||||
private javax.swing.JTextArea filterDescArea;
|
||||
private javax.swing.JLabel filterDescLabel;
|
||||
private javax.swing.JScrollPane filterDescPane;
|
||||
private javax.swing.JLabel filterNameLabel;
|
||||
private javax.swing.JLabel filterNameText;
|
||||
private javax.swing.JLabel ingestWarningLabel;
|
||||
private javax.swing.JSeparator jSeparator2;
|
||||
private javax.swing.JButton newProfileButton;
|
||||
private javax.swing.JTextArea profileDescArea;
|
||||
private javax.swing.JLabel profileDescLabel;
|
||||
private javax.swing.JScrollPane profileDescPane;
|
||||
private javax.swing.JList<IngestProfile> profileList;
|
||||
private javax.swing.JLabel profileListLabel;
|
||||
private javax.swing.JScrollPane profileListPane;
|
||||
private javax.swing.JTextArea selectedModulesArea;
|
||||
private javax.swing.JLabel selectedModulesLabel;
|
||||
private javax.swing.JScrollPane selectedModulesPane;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2015 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -18,7 +18,9 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.ingest;
|
||||
|
||||
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenuItem;
|
||||
@ -26,34 +28,33 @@ import org.openide.awt.DynamicMenuContent;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.datamodel.Content;
|
||||
import org.sleuthkit.datamodel.Image;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
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 {
|
||||
|
||||
|
||||
/**
|
||||
* Creates main menu/popup menu items. It's called each time a popup menu
|
||||
* is constructed and just once for the main menu.
|
||||
* Main menu updates happen through the synchMenuPresenters() method.
|
||||
* Creates main menu/popup menu items. It's called each time a popup menu is
|
||||
* constructed and just once for the main menu. Main menu updates happen
|
||||
* through the synchMenuPresenters() method.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JComponent[] getMenuPresenters() {
|
||||
List<Content> dataSources = new ArrayList<>();
|
||||
|
||||
try {
|
||||
|
||||
try {
|
||||
dataSources = Case.getCurrentCase().getDataSources();
|
||||
} catch (IllegalStateException ex) {
|
||||
// No open Cases, create a disabled empty menu
|
||||
return getEmpty();
|
||||
} catch (TskCoreException e) {
|
||||
System.out.println("Exception getting images: " + e.getMessage()); //NON-NLS
|
||||
}
|
||||
}
|
||||
JComponent[] comps = new JComponent[dataSources.size()];
|
||||
|
||||
// Add Images to the component list
|
||||
@ -61,7 +62,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent {
|
||||
String action = dataSources.get(i).getName();
|
||||
JMenuItem menuItem = new JMenuItem(action);
|
||||
menuItem.setActionCommand(action.toUpperCase());
|
||||
menuItem.addActionListener(new RunIngestModulesAction(dataSources.get(i)));
|
||||
menuItem.addActionListener(new RunIngestModulesAction(Collections.<Content>singletonList(dataSources.get(i))));
|
||||
comps[i] = menuItem;
|
||||
}
|
||||
// If no dataSources are open, create a disabled empty menu
|
||||
@ -70,7 +71,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent {
|
||||
}
|
||||
return comps;
|
||||
}
|
||||
|
||||
|
||||
// returns a disabled empty menu
|
||||
private JComponent[] getEmpty() {
|
||||
JComponent[] comps = new JComponent[1];
|
||||
@ -95,5 +96,4 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent {
|
||||
return getMenuPresenters();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
IngestProfileSelectionPanel.ingestSettingsButton.text=Ingest Settings
|
||||
IngestProfileSelectionPanel.profileListLabel.text=Select Profile:
|
@ -0,0 +1 @@
|
||||
RunIngestModulesAction.name=\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8
|
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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 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;
|
||||
|
||||
/**
|
||||
* A wizard panel for configuring an ingest job.
|
||||
*/
|
||||
class IngestModulesConfigWizardPanel extends ShortcutWizardDescriptorPanel {
|
||||
|
||||
private final String executionContext;
|
||||
private final IngestJobSettings.IngestType ingestType;
|
||||
private IngestJobSettingsPanel ingestJobSettingsPanel;
|
||||
|
||||
/**
|
||||
* Constructs a wizard panel for configuring an ingest job.
|
||||
*
|
||||
* @param executionContest The execution context for the wizard.
|
||||
* @param ingestType The ingest type.
|
||||
*/
|
||||
IngestModulesConfigWizardPanel(String executionContest, IngestJobSettings.IngestType ingestType) {
|
||||
this.executionContext = executionContest;
|
||||
this.ingestType = ingestType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ingest job settings associated with this wizard panel.
|
||||
*
|
||||
* @return The settings, will be null if the panel has not been used in the
|
||||
* wizard.
|
||||
*/
|
||||
IngestJobSettings getIngestJobSettings() {
|
||||
return ingestJobSettingsPanel.getSettings();
|
||||
}
|
||||
|
||||
@NbBundle.Messages("IngestModulesConfigWizardPanel.name.text=Configure Ingest Modules")
|
||||
@Override
|
||||
public Component getComponent() {
|
||||
if (null == ingestJobSettingsPanel) {
|
||||
/*
|
||||
* Creating an ingest job settings object is expensive, so it is
|
||||
* deferred until this panel is actually used in the wizard.
|
||||
*/
|
||||
ingestJobSettingsPanel = new IngestJobSettingsPanel(new IngestJobSettings(executionContext, ingestType));
|
||||
}
|
||||
ingestJobSettingsPanel.setName(Bundle.IngestModulesConfigWizardPanel_name_text());
|
||||
return ingestJobSettingsPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpCtx getHelp() {
|
||||
return HelpCtx.DEFAULT_HELP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
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) {
|
||||
ingestJobSettingsPanel.getSettings().save();
|
||||
}
|
||||
|
||||
}
|
@ -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, "{key}")"/>
|
||||
</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, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -0,0 +1,290 @@
|
||||
/*
|
||||
* 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 long serialVersionUID = 1L;
|
||||
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();
|
||||
boolean isLastPanel = false;
|
||||
|
||||
/**
|
||||
* 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, wizardPanel.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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(wizardPanel.getDefaultContext());
|
||||
wizardPanel.fireChangeEvent();
|
||||
this.firePropertyChange("LAST_ENABLED", wasLastPanel, isLastPanel); //NON-NLS
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the currently existing ingest profiles.
|
||||
*/
|
||||
private void fetchProfileList() {
|
||||
profiles = IngestProfiles.getIngestProfiles();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
// 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
|
||||
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* 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.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;
|
||||
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
|
||||
|
||||
/**
|
||||
* The first wizard panel of the run ingest modules wizard. Displays the profile
|
||||
* selection panel and is only created when profiles exist.
|
||||
*
|
||||
*/
|
||||
public class IngestProfileSelectionWizardPanel extends ShortcutWizardDescriptorPanel {
|
||||
|
||||
@Messages("IngestProfileWizardPanel.panelName=Ingest Profile Selection")
|
||||
|
||||
private final static String LAST_PROFILE_PROPERTIES_FILE = "IngestProfileSelectionPanel"; //NON-NLS
|
||||
private final String executionContext;
|
||||
private final String lastProfilePropertyName;
|
||||
private final Set<ChangeListener> listeners = new HashSet<>(1);
|
||||
private IngestProfileSelectionPanel ingestProfileSelectionPanel;
|
||||
private String lastProfileUsed;
|
||||
|
||||
public IngestProfileSelectionWizardPanel(String executionContext, String lastProfilePropertyName) {
|
||||
this.lastProfilePropertyName = lastProfilePropertyName;
|
||||
this.executionContext = executionContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ingest job settings associated with this wizard panel.
|
||||
*
|
||||
* @return The settings, will be null if the panel has not been used in the
|
||||
* wizard.
|
||||
*/
|
||||
IngestJobSettings getIngestJobSettings() {
|
||||
return new IngestJobSettings(lastProfileUsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultContext
|
||||
*/
|
||||
String getDefaultContext() {
|
||||
return executionContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getComponent() {
|
||||
if (ingestProfileSelectionPanel == null) {
|
||||
if (!(ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName) == null)
|
||||
&& !ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName).isEmpty()) {
|
||||
lastProfileUsed = ModuleSettings.getConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName);
|
||||
} else {
|
||||
lastProfileUsed = getDefaultContext();
|
||||
}
|
||||
ingestProfileSelectionPanel = new IngestProfileSelectionPanel(this, lastProfileUsed);
|
||||
ingestProfileSelectionPanel.setName(Bundle.IngestProfileWizardPanel_panelName());
|
||||
}
|
||||
return ingestProfileSelectionPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpCtx getHelp() {
|
||||
return HelpCtx.DEFAULT_HELP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
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 = ingestProfileSelectionPanel.getLastSelectedProfile();
|
||||
ModuleSettings.setConfigSetting(LAST_PROFILE_PROPERTIES_FILE, lastProfilePropertyName, lastProfileUsed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean skipNextPanel() {
|
||||
return ingestProfileSelectionPanel.isLastPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean panelEnablesSkipping() {
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 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.Cursor;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.JOptionPane;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.WizardDescriptor;
|
||||
import org.openide.util.HelpCtx;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.util.actions.CallableSystemAction;
|
||||
import org.openide.windows.WindowManager;
|
||||
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 CallableSystemAction {
|
||||
|
||||
@Messages("RunIngestModulesAction.name=Run Ingest Modules")
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* Note that the execution context is the name of the dialog that used to be
|
||||
* used instead of this wizard and is retained for backwards compatibility.
|
||||
*/
|
||||
private static final String EXECUTION_CONTEXT = "org.sleuthkit.autopsy.ingest.RunIngestModulesDialog";
|
||||
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) {
|
||||
/**
|
||||
* Create and display a Run Ingest Modules wizard. Note that the
|
||||
* argument in the title format string will be supplied by
|
||||
* WizardDescriptor.Panel.getComponent().getName().
|
||||
*/
|
||||
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
RunIngestModulesWizardIterator wizard = new RunIngestModulesWizardIterator(EXECUTION_CONTEXT, this.ingestType);
|
||||
WizardDescriptor wiz = new WizardDescriptor(wizard);
|
||||
wiz.setTitleFormat(new MessageFormat("{0}"));
|
||||
wiz.setTitle(Bundle.RunIngestModulesAction_name());
|
||||
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
|
||||
IngestJobSettings ingestJobSettings = wizard.getIngestJobSettings();
|
||||
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(1024);
|
||||
for (String warning : warnings) {
|
||||
warningMessage.append(warning).append("\n");
|
||||
}
|
||||
JOptionPane.showMessageDialog(null, warningMessage.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performAction() {
|
||||
actionPerformed(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Bundle.RunIngestModulesAction_name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpCtx getHelpCtx() {
|
||||
return HelpCtx.DEFAULT_HELP;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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.IngestJobSettings;
|
||||
import org.sleuthkit.autopsy.ingest.IngestProfiles;
|
||||
|
||||
/**
|
||||
* A wizard that allows a user to configure an ingest job.
|
||||
*/
|
||||
final class RunIngestModulesWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
|
||||
|
||||
private final static String PROP_LASTPROFILE_NAME = "RIMW_LASTPROFILE_NAME"; //NON-NLS
|
||||
private final IngestJobSettings.IngestType ingestType;
|
||||
private final List<ShortcutWizardDescriptorPanel> panels;
|
||||
private int currentPanelIndex;
|
||||
|
||||
/**
|
||||
* Constructs a wizard that allows a user to configure an ingest job.
|
||||
*
|
||||
* @param executionContext The execution context for this wizard. Ingest job
|
||||
* settings can differ by execution context.
|
||||
* @param ingestType The type of ingest to be configured.
|
||||
*/
|
||||
RunIngestModulesWizardIterator(String executionContext, IngestJobSettings.IngestType ingestType) {
|
||||
this.ingestType = ingestType;
|
||||
panels = new ArrayList<>();
|
||||
List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles();
|
||||
if (!profiles.isEmpty() && IngestJobSettings.IngestType.FILES_ONLY != this.ingestType) {
|
||||
panels.add(new IngestProfileSelectionWizardPanel(executionContext, PROP_LASTPROFILE_NAME));
|
||||
}
|
||||
|
||||
panels.add(new IngestModulesConfigWizardPanel(executionContext, this.ingestType));
|
||||
String[] steps = new String[panels.size()];
|
||||
for (int i = 0; i < panels.size(); i++) {
|
||||
Component c = panels.get(i).getComponent();
|
||||
steps[i] = c.getName();
|
||||
if (c instanceof JComponent) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IngestJobSettings getIngestJobSettings() {
|
||||
ShortcutWizardDescriptorPanel panel = current();
|
||||
if (panel instanceof IngestProfileSelectionWizardPanel) {
|
||||
return ((IngestProfileSelectionWizardPanel) panel).getIngestJobSettings();
|
||||
} else {
|
||||
return ((IngestModulesConfigWizardPanel) panel).getIngestJobSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortcutWizardDescriptorPanel current() {
|
||||
return panels.get(currentPanelIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return currentPanelIndex + 1 + ". from " + panels.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return (currentPanelIndex < panels.size() - 1
|
||||
&& !(current().panelEnablesSkipping() && current().skipNextPanel()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPrevious() {
|
||||
return currentPanelIndex > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void nextPanel() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
currentPanelIndex++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void previousPanel() {
|
||||
if (!hasPrevious()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
currentPanelIndex--;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangeListener(ChangeListener l) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeChangeListener(ChangeListener l) {
|
||||
}
|
||||
|
||||
}
|
@ -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.
|
||||
*/
|
||||
}
|
||||
}
|
@ -1,6 +1,20 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
* 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.modules.fileextmismatch;
|
||||
|
||||
@ -16,7 +30,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@OptionsPanelController.TopLevelRegistration(
|
||||
categoryName = "#OptionsCategory_Name_FileExtMismatchOptions",
|
||||
iconBase = "org/sleuthkit/autopsy/modules/fileextmismatch/options-icon.png",
|
||||
position = 5,
|
||||
position = 7,
|
||||
keywords = "#OptionsCategory_FileExtMismatch",
|
||||
keywordsCategory = "KeywordSearchOptions")
|
||||
public final class FileExtMismatchOptionsPanelController extends OptionsPanelController {
|
||||
|
@ -1,15 +1,15 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
*
|
||||
* 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.
|
||||
@ -32,7 +32,7 @@ import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import org.openide.util.NbBundle;
|
||||
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;
|
||||
|
||||
/**
|
||||
@ -43,7 +43,7 @@ final class AddFileTypeSignatureDialog extends JDialog {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
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 BUTTON_PRESSED result;
|
||||
|
||||
|
@ -1,7 +1,20 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
* 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.modules.filetypeid;
|
||||
|
||||
@ -18,7 +31,7 @@ import org.openide.util.Lookup;
|
||||
iconBase = "org/sleuthkit/autopsy/modules/filetypeid/user-defined-file-types-settings.png",
|
||||
keywords = "#OptionsCategory_Keywords_FileTypeId",
|
||||
keywordsCategory = "FileTypeId",
|
||||
position = 6
|
||||
position = 8
|
||||
)
|
||||
public final class FileTypeIdOptionsPanelController extends OptionsPanelController {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -30,7 +30,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@OptionsPanelController.TopLevelRegistration(
|
||||
categoryName = "#OptionsCategory_Name_HashDatabase",
|
||||
iconBase = "org/sleuthkit/autopsy/modules/hashdatabase/options_icon.png",
|
||||
position = 4,
|
||||
position = 6,
|
||||
keywords = "#OptionsCategory_Keywords_HashDatabase",
|
||||
keywordsCategory = "HashDatabase",
|
||||
id = "HashDatabase")
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2014 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -30,16 +30,17 @@ import javax.swing.JTable;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import javax.swing.table.TableColumn;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
||||
/**
|
||||
* Ingest job settings panel for hash lookup file ingest modules.
|
||||
*/
|
||||
public final class HashLookupModuleSettingsPanel extends IngestModuleIngestJobSettingsPanel implements PropertyChangeListener {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final HashDbManager hashDbManager = HashDbManager.getInstance();
|
||||
private final List<HashSetModel> knownHashSetModels = new ArrayList<>();
|
||||
private final HashSetsTableModel knownHashSetsTableModel = new HashSetsTableModel(knownHashSetModels);
|
||||
@ -216,6 +217,7 @@ public final class HashLookupModuleSettingsPanel extends IngestModuleIngestJobSe
|
||||
|
||||
private static final class HashSetsTableModel extends AbstractTableModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final List<HashSetModel> hashSets;
|
||||
|
||||
HashSetsTableModel(List<HashSetModel> hashSets) {
|
||||
|
@ -79,4 +79,5 @@ FilesSetDefsPanel.filesRadioButton.text=Files
|
||||
FilesSetRulePanel.allRadioButton.text=All
|
||||
FilesSetDefsPanel.ingoreUnallocCheckbox.text=Ignore Unallocated Space
|
||||
FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText=Ignores unallocated space, such as deleted files. May run faster but produce less complete results.
|
||||
FilesSetDefsPanel.allRadioButton.text=All
|
||||
FilesSetDefsPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes.
|
||||
FilesSetDefsPanel.allRadioButton.text=All
|
@ -48,3 +48,4 @@ FilesSetDefsPanel.fileNameExtensionRadioButton.text=\u62e1\u5f35\u5b50\u306e\u30
|
||||
FilesSetDefsPanel.rulesListLabel.text=\u30eb\u30fc\u30eb\uff1a
|
||||
FilesSetDefsPanel.editRuleButton.text=\u30eb\u30fc\u30eb\u3092\u7de8\u96c6
|
||||
FilesSetDefsPanel.filesRadioButton.text=\u30d5\u30a1\u30a4\u30eb
|
||||
FilesSetDefsPanel.ingestWarningLabel.text=\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u3067\u3059\u3002\u5b8c\u4e86\u3059\u308b\u307e\u3067\u4e00\u90e8\u306e\u8a2d\u5b9a\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2014 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -84,7 +84,7 @@ public final class FilesSet implements Serializable {
|
||||
*
|
||||
* @return A description string, possibly the empty string.
|
||||
*/
|
||||
String getDescription() {
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
|
@ -120,8 +120,14 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="ingoreUnallocCheckbox" min="-2" pref="158" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
@ -195,10 +201,18 @@
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="setDescScrollPanel" min="-2" pref="45" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
@ -839,6 +853,21 @@
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="ingestWarningLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="false" component="ingestWarningLabel" property="font" relativeSize="false" size="11"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/modules/hashdatabase/warning16.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="FilesSetDefsPanel.ingestWarningLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -38,6 +38,8 @@ import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
|
||||
import org.sleuthkit.autopsy.ingest.IngestProfiles;
|
||||
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
|
||||
import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
|
||||
|
||||
/**
|
||||
@ -45,7 +47,9 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
|
||||
*/
|
||||
public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
|
||||
|
||||
@NbBundle.Messages({
|
||||
@NbBundle.Messages({"# {0} - filter name",
|
||||
"# {1} - profile name",
|
||||
"FilesSetDefsPanel.ingest.fileFilterInUseError=The selected file filter, {0}, is being used by a profile, {1}, and cannot be deleted until after the profile.",
|
||||
"FilesSetDefsPanel.bytes=Bytes",
|
||||
"FilesSetDefsPanel.kiloBytes=Kilobytes",
|
||||
"FilesSetDefsPanel.megaBytes=Megabytes",
|
||||
@ -65,6 +69,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
private final JButton cancelButton = new JButton("Cancel");
|
||||
private final PANEL_TYPE panelType;
|
||||
private final String ruleDialogTitle;
|
||||
private boolean canBeEnabled = true;
|
||||
|
||||
// The following is a map of interesting files set names to interesting
|
||||
// files set definitions. It is a snapshot of the files set definitions
|
||||
@ -86,7 +91,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
this.setsList.addListSelectionListener(new FilesSetDefsPanel.SetsListSelectionListener());
|
||||
this.rulesList.setModel(rulesListModel);
|
||||
this.rulesList.addListSelectionListener(new FilesSetDefsPanel.RulesListSelectionListener());
|
||||
|
||||
this.ingestWarningLabel.setVisible(false);
|
||||
if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) { //Hide the mimetype settings when this is displaying FileSet rules instead of interesting item rules
|
||||
this.mimeTypeComboBox.setVisible(false);
|
||||
this.jLabel7.setVisible(false);
|
||||
@ -171,6 +176,17 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
}
|
||||
}
|
||||
|
||||
public void enableButtons(boolean isEnabled) {
|
||||
canBeEnabled = isEnabled;
|
||||
newRuleButton.setEnabled(isEnabled);
|
||||
newSetButton.setEnabled(isEnabled);
|
||||
editRuleButton.setEnabled(isEnabled);
|
||||
editSetButton.setEnabled(isEnabled);
|
||||
deleteRuleButton.setEnabled(isEnabled);
|
||||
deleteSetButton.setEnabled(isEnabled);
|
||||
ingestWarningLabel.setVisible(!isEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@ -224,7 +240,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
this.setDescriptionTextArea.setText("");
|
||||
this.ignoreKnownFilesCheckbox.setSelected(true);
|
||||
this.ingoreUnallocCheckbox.setSelected(true);
|
||||
this.newSetButton.setEnabled(true);
|
||||
this.newSetButton.setEnabled(true && canBeEnabled);
|
||||
this.editSetButton.setEnabled(false);
|
||||
this.deleteSetButton.setEnabled(false);
|
||||
}
|
||||
@ -244,7 +260,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
this.equalitySignComboBox.setSelectedIndex(2);
|
||||
this.fileSizeUnitComboBox.setSelectedIndex(1);
|
||||
this.fileSizeSpinner.setValue(0);
|
||||
this.newRuleButton.setEnabled(!this.setsListModel.isEmpty());
|
||||
this.newRuleButton.setEnabled(!this.setsListModel.isEmpty() && canBeEnabled);
|
||||
this.editRuleButton.setEnabled(false);
|
||||
this.deleteRuleButton.setEnabled(false);
|
||||
}
|
||||
@ -273,9 +289,9 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
FilesSetDefsPanel.this.ignoreKnownFilesCheckbox.setSelected(selectedSet.ignoresKnownFiles());
|
||||
FilesSetDefsPanel.this.ingoreUnallocCheckbox.setSelected(selectedSet.ingoresUnallocatedSpace());
|
||||
// Enable the new, edit and delete set buttons.
|
||||
FilesSetDefsPanel.this.newSetButton.setEnabled(true);
|
||||
FilesSetDefsPanel.this.editSetButton.setEnabled(true);
|
||||
FilesSetDefsPanel.this.deleteSetButton.setEnabled(true);
|
||||
FilesSetDefsPanel.this.newSetButton.setEnabled(true && canBeEnabled);
|
||||
FilesSetDefsPanel.this.editSetButton.setEnabled(true && canBeEnabled);
|
||||
FilesSetDefsPanel.this.deleteSetButton.setEnabled(true && canBeEnabled);
|
||||
|
||||
// Populate the rule definitions list, sorted by name.
|
||||
TreeMap<String, FilesSet.Rule> rules = new TreeMap<>(selectedSet.getRules());
|
||||
@ -361,9 +377,9 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
}
|
||||
|
||||
// Enable the new, edit and delete rule buttons.
|
||||
FilesSetDefsPanel.this.newRuleButton.setEnabled(true);
|
||||
FilesSetDefsPanel.this.editRuleButton.setEnabled(true);
|
||||
FilesSetDefsPanel.this.deleteRuleButton.setEnabled(true);
|
||||
FilesSetDefsPanel.this.newRuleButton.setEnabled(true && canBeEnabled);
|
||||
FilesSetDefsPanel.this.editRuleButton.setEnabled(true && canBeEnabled);
|
||||
FilesSetDefsPanel.this.deleteRuleButton.setEnabled(true && canBeEnabled);
|
||||
} else {
|
||||
FilesSetDefsPanel.this.resetRuleComponents();
|
||||
}
|
||||
@ -566,6 +582,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
fileSizeSpinner = new javax.swing.JSpinner();
|
||||
fileSizeUnitComboBox = new javax.swing.JComboBox<String>();
|
||||
ingoreUnallocCheckbox = new javax.swing.JCheckBox();
|
||||
ingestWarningLabel = new javax.swing.JLabel();
|
||||
|
||||
setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||
|
||||
@ -764,6 +781,10 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
ingoreUnallocCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingoreUnallocCheckbox.toolTipText")); // NOI18N
|
||||
ingoreUnallocCheckbox.setEnabled(false);
|
||||
|
||||
ingestWarningLabel.setFont(ingestWarningLabel.getFont().deriveFont(ingestWarningLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||
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(FilesSetDefsPanel.class, "FilesSetDefsPanel.ingestWarningLabel.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
@ -815,8 +836,12 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
.addComponent(ignoreKnownFilesCheckbox)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(ingoreUnallocCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6)))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(ingestWarningLabel))))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(29, 29, 29)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@ -874,10 +899,15 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
.addComponent(editSetButton)
|
||||
.addComponent(deleteSetButton)))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel6)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel5)
|
||||
.addGap(1, 1, 1)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel6)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel5)
|
||||
.addGap(1, 1, 1))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(ingestWarningLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
|
||||
.addComponent(setDescScrollPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(6, 6, 6)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
@ -972,9 +1002,19 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
|
||||
private void deleteSetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSetButtonActionPerformed
|
||||
FilesSet selectedSet = this.setsList.getSelectedValue();
|
||||
if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) {
|
||||
for (IngestProfile profile : IngestProfiles.getIngestProfiles()) {
|
||||
if (profile.getFileIngestFilter().equals(selectedSet.getName())) {
|
||||
MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
|
||||
"FilesSetDefsPanel.ingest.fileFilterInUseError",
|
||||
selectedSet.getName(), profile.toString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.filesSets.remove(selectedSet.getName());
|
||||
this.setsListModel.removeElement(selectedSet);
|
||||
|
||||
// Select the first of the remaining set definitions. This will cause
|
||||
// the selection listeners to repopulate the subordinate components.
|
||||
if (!this.filesSets.isEmpty()) {
|
||||
@ -1017,6 +1057,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
|
||||
private javax.swing.JComboBox<String> fileSizeUnitComboBox;
|
||||
private javax.swing.JRadioButton filesRadioButton;
|
||||
private javax.swing.JCheckBox ignoreKnownFilesCheckbox;
|
||||
private javax.swing.JLabel ingestWarningLabel;
|
||||
private javax.swing.JCheckBox ingoreUnallocCheckbox;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2014 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -32,7 +32,7 @@ import org.openide.util.Lookup;
|
||||
iconBase = "org/sleuthkit/autopsy/images/interesting_item_32x32.png",
|
||||
keywords = "#OptionsCategory_Keywords_InterestingItemDefinitions",
|
||||
keywordsCategory = "InterestingItemDefinitions",
|
||||
position = 7
|
||||
position = 9
|
||||
)
|
||||
public final class InterestingItemDefsOptionsPanelController extends OptionsPanelController {
|
||||
|
||||
|
@ -157,7 +157,7 @@ class PhotoRecCarverOutputParser {
|
||||
}
|
||||
return fileManager.addCarvedFiles(new CarvingResult(af, carvedFiles));
|
||||
} catch (NumberFormatException | TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Error parsing PhotoRec output and inserting it into the database: {0}", ex); //NON-NLS
|
||||
logger.log(Level.SEVERE, "Error parsing PhotoRec output and inserting it into the database", ex); //NON-NLS
|
||||
}
|
||||
|
||||
List<LayoutFile> empty = Collections.emptyList();
|
||||
|
@ -18,10 +18,8 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.report.testfixtures;
|
||||
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
import org.sleuthkit.autopsy.coreutils.Version;
|
||||
import org.sleuthkit.autopsy.ingest.FileIngestModule;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||
|
||||
@ -31,8 +29,8 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||
* annotation to activate this test fixture.
|
||||
*/
|
||||
//@ServiceProvider(service = IngestModuleFactory.class)
|
||||
public final class CustomArtifactsCreatorIngestModuleFactory extends IngestModuleFactoryAdapter {
|
||||
|
||||
public final class CustomArtifactsCreatorIngestModuleFactory extends IngestModuleFactoryAdapter {
|
||||
|
||||
@Override
|
||||
public String getModuleDisplayName() {
|
||||
return getModuleName();
|
||||
@ -57,8 +55,8 @@ public final class CustomArtifactsCreatorIngestModuleFactory extends IngestModu
|
||||
public FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings) {
|
||||
return new CustomArtifactsCreatorIngestModule();
|
||||
}
|
||||
|
||||
static String getModuleName() {
|
||||
|
||||
static String getModuleName() {
|
||||
return "Custom Artifacts Creator";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
* @param inStartup True if we're doing the initial population of the UI
|
||||
*/
|
||||
final void load(boolean inStartup) {
|
||||
|
||||
|
||||
// multi user mode must be enabled
|
||||
if (!UserPreferences.getIsMultiUserModeEnabled()) {
|
||||
tbOops.setText(MULTI_USER_SETTINGS_MUST_BE_ENABLED);
|
||||
@ -123,23 +123,25 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
cbJoinAutoIngestCluster.setSelected(AutoIngestUserPreferences.getJoinAutoModeCluster());
|
||||
cbJoinAutoIngestCluster.setEnabled(UserPreferences.getIsMultiUserModeEnabled());
|
||||
|
||||
|
||||
if (inStartup) {
|
||||
AutoIngestUserPreferences.SelectedMode storedMode = AutoIngestUserPreferences.getMode();
|
||||
inputPathTextField.requestFocusInWindow();
|
||||
if (null != storedMode) switch (storedMode) {
|
||||
case REVIEW:
|
||||
jRadioButtonReview.setSelected(true);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.REVIEW);
|
||||
break;
|
||||
case AUTOMATED:
|
||||
jRadioButtonAutomated.setSelected(true);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.AIM);
|
||||
break;
|
||||
default:
|
||||
cbJoinAutoIngestCluster.setSelected(false);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.STANDALONE);
|
||||
break;
|
||||
if (null != storedMode) {
|
||||
switch (storedMode) {
|
||||
case REVIEW:
|
||||
jRadioButtonReview.setSelected(true);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.REVIEW);
|
||||
break;
|
||||
case AUTOMATED:
|
||||
jRadioButtonAutomated.setSelected(true);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.AIM);
|
||||
break;
|
||||
default:
|
||||
cbJoinAutoIngestCluster.setSelected(false);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.STANDALONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,11 +208,11 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
void store() {
|
||||
boolean needsRestart = false;
|
||||
AutoIngestUserPreferences.SelectedMode storedMode = AutoIngestUserPreferences.getMode();
|
||||
|
||||
|
||||
if (AutoIngestUserPreferences.getJoinAutoModeCluster() != cbJoinAutoIngestCluster.isSelected()) {
|
||||
needsRestart = true;
|
||||
}
|
||||
|
||||
|
||||
AutoIngestUserPreferences.setJoinAutoModeCluster(cbJoinAutoIngestCluster.isSelected());
|
||||
if (!cbJoinAutoIngestCluster.isSelected()) {
|
||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.STANDALONE);
|
||||
@ -224,8 +226,8 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (jRadioButtonAutomated.isSelected()) {
|
||||
if (storedMode != AutoIngestUserPreferences.SelectedMode.AUTOMATED) {
|
||||
needsRestart = true;
|
||||
@ -261,7 +263,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.REVIEW);
|
||||
String resultsFolderPath = getNormalizedFolderPath(outputPathTextField.getText().trim());
|
||||
AutoIngestUserPreferences.setAutoModeResultsFolder(resultsFolderPath);
|
||||
AutoIngestUserPreferences.setAutoModeResultsFolder(resultsFolderPath);
|
||||
}
|
||||
if (needsRestart) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
@ -303,11 +305,11 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
* Validate current panel settings.
|
||||
*/
|
||||
boolean valid() {
|
||||
|
||||
|
||||
if (!cbJoinAutoIngestCluster.isSelected()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
boolean isValidNodePanel = true;
|
||||
|
||||
switch (getModeFromRadioButtons()) {
|
||||
@ -333,13 +335,13 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (jRadioButtonAutomated.isSelected()) {
|
||||
if (sharedConfigCheckbox.isEnabled() && sharedConfigCheckbox.isSelected() && !validSharedConfigSettings()) {
|
||||
isValidNodePanel = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isValidNodePanel;
|
||||
}
|
||||
|
||||
@ -593,10 +595,10 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
private void enableOptionsBasedOnMode(OptionsUiMode mode) {
|
||||
if (mode != OptionsUiMode.DOWNLOADING_CONFIGURATION) {
|
||||
if (mode != OptionsUiMode.DOWNLOADING_CONFIGURATION) {
|
||||
jRadioButtonAutomated.setEnabled(cbJoinAutoIngestCluster.isSelected());
|
||||
jRadioButtonReview.setEnabled(cbJoinAutoIngestCluster.isSelected());
|
||||
|
||||
|
||||
jLabelSelectInputFolder.setEnabled(mode == OptionsUiMode.AIM);
|
||||
inputPathTextField.setEnabled(mode == OptionsUiMode.AIM);
|
||||
browseInputFolderButton.setEnabled(mode == OptionsUiMode.AIM);
|
||||
@ -629,7 +631,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
if (!cbJoinAutoIngestCluster.isSelected()) {
|
||||
return OptionsUiMode.STANDALONE;
|
||||
}
|
||||
|
||||
|
||||
if (jRadioButtonAutomated.isSelected()) {
|
||||
return OptionsUiMode.AIM;
|
||||
} else if (jRadioButtonReview.isSelected()) {
|
||||
@ -1269,9 +1271,9 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
private void bnAdvancedSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnAdvancedSettingsActionPerformed
|
||||
AdvancedAutoIngestSettingsPanel advancedAutoIngestSettingsPanel = new AdvancedAutoIngestSettingsPanel(getModeFromRadioButtons());
|
||||
if (JOptionPane.showConfirmDialog(null, advancedAutoIngestSettingsPanel,
|
||||
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.AdvancedAutoIngestSettingsPanel.Title"),
|
||||
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
|
||||
advancedAutoIngestSettingsPanel.store();
|
||||
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.AdvancedAutoIngestSettingsPanel.Title"),
|
||||
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
|
||||
advancedAutoIngestSettingsPanel.store();
|
||||
}
|
||||
}//GEN-LAST:event_bnAdvancedSettingsActionPerformed
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
|
||||
@OptionsPanelController.TopLevelRegistration(categoryName = "#OptionsCategory_Name_Auto_Ingest",
|
||||
iconBase = "org/sleuthkit/autopsy/experimental/images/autoIngest32.png",
|
||||
position = 3,
|
||||
position = 4,
|
||||
keywords = "#OptionsCategory_Keywords_Auto_Ingest_Settings",
|
||||
keywordsCategory = "Auto Ingest")
|
||||
public final class AutoIngestSettingsPanelController extends OptionsPanelController {
|
||||
|
@ -34,7 +34,7 @@ import org.openide.util.Lookup;
|
||||
iconBase = "org/sleuthkit/autopsy/imagegallery/images/btn_icon_image_gallery_32.png",
|
||||
keywords = "#OptionsCategory_Keywords_Options",
|
||||
keywordsCategory = "Options",
|
||||
position = 10
|
||||
position = 12
|
||||
)
|
||||
@org.openide.util.NbBundle.Messages({"OptionsCategory_Name_Options=Image / Video Gallery", "OptionsCategory_Keywords_Options=image video gallery category "})
|
||||
public final class ImageGalleryOptionsPanelController extends OptionsPanelController {
|
||||
|
@ -30,7 +30,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@OptionsPanelController.TopLevelRegistration(
|
||||
categoryName = "#OptionsCategory_Name_KeywordSearchOptions",
|
||||
iconBase = "org/sleuthkit/autopsy/keywordsearch/options-icon.png",
|
||||
position = 3,
|
||||
position = 5,
|
||||
keywords = "#OptionsCategory_Keywords_KeywordSearchOptions",
|
||||
keywordsCategory = "KeywordSearchOptions")
|
||||
public final class KeywordSearchOptionsPanelController extends OptionsPanelController {
|
||||
|
@ -6,6 +6,41 @@
|
||||
<code-name-base>org.sleuthkit.autopsy.testing</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.libs.junit4</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.14</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.jellytools.platform</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>3</release-version>
|
||||
<specification-version>3.28.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.jemmy</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>3</release-version>
|
||||
<specification-version>3.26.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.nbjunit</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>1.86.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.sleuthkit.autopsy.core</code-name-base>
|
||||
<build-prerequisite/>
|
||||
@ -63,7 +98,9 @@
|
||||
</test-dependency>
|
||||
</test-type>
|
||||
</test-dependencies>
|
||||
<public-packages/>
|
||||
<public-packages>
|
||||
<package>org.sleuthkit.autopsy.testing</package>
|
||||
</public-packages>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
|
303
Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java
Executable file
@ -0,0 +1,303 @@
|
||||
/*
|
||||
* 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.testing;
|
||||
|
||||
import java.awt.AWTException;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import org.netbeans.jellytools.MainWindowOperator;
|
||||
import org.netbeans.jellytools.NbDialogOperator;
|
||||
import org.netbeans.jellytools.WizardOperator;
|
||||
import org.netbeans.jemmy.Timeout;
|
||||
import org.netbeans.jemmy.operators.JButtonOperator;
|
||||
import org.netbeans.jemmy.operators.JCheckBoxOperator;
|
||||
import org.netbeans.jemmy.operators.JComboBoxOperator;
|
||||
import org.netbeans.jemmy.operators.JDialogOperator;
|
||||
import org.netbeans.jemmy.operators.JFileChooserOperator;
|
||||
import org.netbeans.jemmy.operators.JLabelOperator;
|
||||
import org.netbeans.jemmy.operators.JListOperator;
|
||||
import org.netbeans.jemmy.operators.JTabbedPaneOperator;
|
||||
import org.netbeans.jemmy.operators.JTableOperator;
|
||||
import org.netbeans.jemmy.operators.JTextFieldOperator;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
|
||||
public class AutopsyTestCases {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(AutopsyTestCases.class.getName());
|
||||
private long start;
|
||||
/**
|
||||
* This method is used to escape file/directory path. Example:
|
||||
* \\NetworkLocation\foo\bar get escaped to \\\\NetworkLocation\foo\bar so
|
||||
* that it can be used as intended.
|
||||
*
|
||||
* @param path
|
||||
*
|
||||
* @return escaped path the the file/directory location.
|
||||
*/
|
||||
public static String getEscapedPath(String path) {
|
||||
if (path.startsWith("\\\\")) { //already has escaped to \\\\NetworkLocation
|
||||
return path;
|
||||
}
|
||||
if (path.startsWith("\\")) {
|
||||
return "\\" + path;
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
public AutopsyTestCases () {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
public void testNewCaseWizardOpen(String title) {
|
||||
logger.info("New Case");
|
||||
NbDialogOperator nbdo = new NbDialogOperator(title);
|
||||
JButtonOperator jbo = new JButtonOperator(nbdo, 0); // the "New Case" button
|
||||
jbo.pushNoBlock();
|
||||
}
|
||||
|
||||
public void testNewCaseWizard() {
|
||||
logger.info("New Case Wizard");
|
||||
WizardOperator wo = new WizardOperator("New Case Information");
|
||||
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 1);
|
||||
jtfo0.typeText("AutopsyTestCase"); // Name the case "AutopsyTestCase"
|
||||
JTextFieldOperator jtfo1 = new JTextFieldOperator(wo, 2);
|
||||
jtfo1.typeText(getEscapedPath(System.getProperty("out_path")));
|
||||
wo.btNext().clickMouse();
|
||||
JTextFieldOperator jtfo2 = new JTextFieldOperator(wo, 0);
|
||||
jtfo2.typeText("000"); // Set the case number
|
||||
JTextFieldOperator jtfo3 = new JTextFieldOperator(wo, 1);
|
||||
jtfo3.typeText("Examiner 1"); // Set the case examiner
|
||||
start = System.currentTimeMillis();
|
||||
wo.btFinish().clickMouse();
|
||||
}
|
||||
|
||||
public void testStartAddImageFileDataSource() {
|
||||
logger.info("Starting Add Image process");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0);
|
||||
String img_path = getEscapedPath(System.getProperty("img_path"));
|
||||
String imageDir = img_path;
|
||||
((JTextComponent) jtfo0.getSource()).setText(imageDir);
|
||||
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo, 1);
|
||||
comboBoxOperator.setSelectedItem("(GMT-5:00) America/New_York");
|
||||
wo.btNext().clickMouse();
|
||||
}
|
||||
|
||||
public void testStartAddLogicalFilesDataSource() {
|
||||
logger.info("Starting Add Logical Files process");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo);
|
||||
// select the item indexed 2 (Logical Files) from the drop-down list.
|
||||
comboBoxOperator.selectItem(2);
|
||||
JButtonOperator addButtonOperator = new JButtonOperator(wo, "Add");
|
||||
addButtonOperator.pushNoBlock();
|
||||
JFileChooserOperator fileChooserOperator = new JFileChooserOperator();
|
||||
fileChooserOperator.setCurrentDirectory(new File(getEscapedPath(System.getProperty("img_path"))));
|
||||
// set the current directory one level above the directory containing logicalFileSet folder.
|
||||
fileChooserOperator.goUpLevel();
|
||||
fileChooserOperator.chooseFile(new File(getEscapedPath(System.getProperty("img_path"))).getName());
|
||||
wo.btNext().clickMouse();
|
||||
}
|
||||
|
||||
public void testAddSourceWizard1() {
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
while (!wo.btFinish().isEnabled()) {
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.log(Level.INFO, "Add image took {0}ms", (System.currentTimeMillis() - start));
|
||||
wo.btFinish().clickMouse();
|
||||
}
|
||||
|
||||
public void testConfigureIngest1() {
|
||||
/*
|
||||
* This timeout is to allow the setup for the ingest job settings panel
|
||||
* to complete.
|
||||
*/
|
||||
new Timeout("pausing", 10000).sleep();
|
||||
|
||||
logger.info("Looking for hash lookup module in ingest job settings panel");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTableOperator jto = new JTableOperator(wo, 0);
|
||||
int row = jto.findCellRow("Hash Lookup", 2, 0);
|
||||
jto.clickOnCell(row, 1);
|
||||
logger.info("Selected hash lookup module in ingest job settings panel");
|
||||
JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");
|
||||
jbo1.pushNoBlock();
|
||||
logger.info("Pushed Global Settings button for hash lookup module in ingest job settings panel");
|
||||
}
|
||||
|
||||
public void testConfigureHash() {
|
||||
logger.info("Hash Configure");
|
||||
JDialog hashMainDialog = JDialogOperator.waitJDialog("Global Hash Lookup Settings", false, false);
|
||||
JDialogOperator hashMainDialogOperator = new JDialogOperator(hashMainDialog);
|
||||
List<String> databases = new ArrayList<>();
|
||||
databases.add(getEscapedPath(System.getProperty("nsrl_path")));
|
||||
databases.add(getEscapedPath(System.getProperty("known_bad_path")));
|
||||
databases.stream().map((database) -> {
|
||||
JButtonOperator importButtonOperator = new JButtonOperator(hashMainDialogOperator, "Import");
|
||||
importButtonOperator.pushNoBlock();
|
||||
JDialog addDatabaseDialog = JDialogOperator.waitJDialog("Import Hash Database", false, false);
|
||||
JDialogOperator addDatabaseDialogOperator = new JDialogOperator(addDatabaseDialog);
|
||||
JButtonOperator browseButtonOperator = new JButtonOperator(addDatabaseDialogOperator, "Open...", 0);
|
||||
browseButtonOperator.pushNoBlock();
|
||||
JFileChooserOperator fileChooserOperator = new JFileChooserOperator();
|
||||
fileChooserOperator.chooseFile(database);
|
||||
JButtonOperator okButtonOperator = new JButtonOperator(addDatabaseDialogOperator, "OK", 0);
|
||||
return okButtonOperator;
|
||||
}).map((okButtonOperator) -> {
|
||||
okButtonOperator.pushNoBlock();
|
||||
return okButtonOperator;
|
||||
}).forEach((_item) -> {
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
});
|
||||
// Used if the database has no index
|
||||
//JDialog jd3 = JDialogOperator.waitJDialog("No Index Exists", false, false);
|
||||
//JDialogOperator jdo3 = new JDialogOperator(jd3);
|
||||
//JButtonOperator jbo3 = new JButtonOperator(jdo3, "Yes", 0);
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
//jbo3.pushNoBlock();
|
||||
JButtonOperator jbo4 = new JButtonOperator(hashMainDialogOperator, "OK", 0);
|
||||
jbo4.pushNoBlock();
|
||||
}
|
||||
|
||||
public void testConfigureIngest2() {
|
||||
logger.info("Looking for keyword search module in ingest job settings panel");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTableOperator jto = new JTableOperator(wo, 0);
|
||||
int row = jto.findCellRow("Keyword Search", 2, 0);
|
||||
jto.clickOnCell(row, 1);
|
||||
logger.info("Selected keyword search module in ingest job settings panel");
|
||||
JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");
|
||||
jbo1.pushNoBlock();
|
||||
logger.info("Pushed Global Settings button for keyword search module in ingest job settings panel");
|
||||
}
|
||||
|
||||
public void testConfigureSearch() {
|
||||
logger.info("Search Configure");
|
||||
JDialog jd = JDialogOperator.waitJDialog("Global Keyword Search Settings", false, false);
|
||||
JDialogOperator jdo = new JDialogOperator(jd);
|
||||
String words = getEscapedPath(System.getProperty("keyword_path"));
|
||||
JButtonOperator jbo0 = new JButtonOperator(jdo, "Import List", 0);
|
||||
jbo0.pushNoBlock();
|
||||
JFileChooserOperator jfco0 = new JFileChooserOperator();
|
||||
jfco0.chooseFile(words);
|
||||
JTableOperator jto = new JTableOperator(jdo, 0);
|
||||
jto.clickOnCell(0, 0);
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to process
|
||||
if (Boolean.parseBoolean(System.getProperty("mugen_mode"))) {
|
||||
JTabbedPaneOperator jtpo = new JTabbedPaneOperator(jdo);
|
||||
jtpo.selectPage("String Extraction");
|
||||
JCheckBoxOperator jcbo0 = new JCheckBoxOperator(jtpo, "Arabic (Arabic)");
|
||||
jcbo0.doClick();
|
||||
JCheckBoxOperator jcbo1 = new JCheckBoxOperator(jtpo, "Han (Chinese, Japanese, Korean)");
|
||||
jcbo1.doClick();
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to process
|
||||
}
|
||||
JButtonOperator jbo2 = new JButtonOperator(jdo, "OK", 0);
|
||||
jbo2.pushNoBlock();
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
new Timeout("pausing", 10000).sleep(); // let things catch up
|
||||
wo.btNext().clickMouse();
|
||||
}
|
||||
|
||||
public void testIngest() {
|
||||
logger.info("Ingest 3");
|
||||
new Timeout("pausing", 10000).sleep(); // wait for ingest to actually start
|
||||
long startIngest = System.currentTimeMillis();
|
||||
IngestManager man = IngestManager.getInstance();
|
||||
while (man.isIngestRunning()) {
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.log(Level.INFO, "Ingest (including enqueue) took {0}ms", (System.currentTimeMillis() - startIngest));
|
||||
// allow keyword search to finish saving artifacts, just in case
|
||||
// but randomize the timing so that we don't always get the same error
|
||||
// consistently, making it seem like default behavior
|
||||
Random rand = new Random();
|
||||
new Timeout("pausing", 10000 + (rand.nextInt(15000) + 5000)).sleep();
|
||||
screenshot("Finished Ingest");
|
||||
|
||||
}
|
||||
|
||||
public void testGenerateReportToolbar() {
|
||||
logger.info("Generate Report Toolbars");
|
||||
MainWindowOperator mwo = MainWindowOperator.getDefault();
|
||||
JButtonOperator jbo = new JButtonOperator(mwo, "Generate Report");
|
||||
jbo.pushNoBlock();
|
||||
new Timeout("pausing", 5000).sleep();
|
||||
}
|
||||
|
||||
public void testGenerateReportButton() throws IOException {
|
||||
logger.info("Generate Report Button");
|
||||
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
|
||||
JDialogOperator reportDialogOperator = new JDialogOperator(reportDialog);
|
||||
JListOperator listOperator = new JListOperator(reportDialogOperator);
|
||||
JButtonOperator jbo0 = new JButtonOperator(reportDialogOperator, "Next");
|
||||
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
|
||||
Date date = new Date();
|
||||
String datenotime = dateFormat.format(date);
|
||||
listOperator.clickOnItem(0, 1);
|
||||
new Timeout("pausing", 1000).sleep();
|
||||
jbo0.pushNoBlock();
|
||||
new Timeout("pausing", 1000).sleep();
|
||||
JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator, "Finish");
|
||||
jbo1.pushNoBlock();
|
||||
new Timeout("pausing", 500).sleep();
|
||||
JDialog previewDialog = JDialogOperator.waitJDialog("Progress", false, false);
|
||||
screenshot("Progress");
|
||||
JDialogOperator previewDialogOperator = new JDialogOperator(previewDialog);
|
||||
JLabelOperator.waitJLabel(previewDialog, "Complete", false, false);
|
||||
JButtonOperator jbo2 = new JButtonOperator(previewDialogOperator, "Close");
|
||||
jbo2.pushNoBlock();
|
||||
new Timeout("pausing", 10000).sleep();
|
||||
System.setProperty("ReportStr", datenotime);
|
||||
screenshot("Done Testing");
|
||||
}
|
||||
|
||||
public void screenshot(String name) {
|
||||
logger.info("Taking screenshot.");
|
||||
try {
|
||||
Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
||||
BufferedImage capture = new Robot().createScreenCapture(screenRect);
|
||||
String outPath = getEscapedPath(System.getProperty("out_path"));
|
||||
ImageIO.write(capture, "png", new File(outPath + "\\" + name + ".png"));
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to save
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "IOException taking screenshot.", ex);
|
||||
} catch (AWTException ex) {
|
||||
logger.log(Level.WARNING, "AWTException taking screenshot.", ex);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2016 Basis Technology Corp.
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -18,43 +18,13 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.testing;
|
||||
|
||||
import java.awt.AWTException;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JTextField;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import org.netbeans.jellytools.MainWindowOperator;
|
||||
import org.netbeans.jellytools.NbDialogOperator;
|
||||
import org.netbeans.jellytools.WizardOperator;
|
||||
import org.netbeans.jemmy.Timeout;
|
||||
import org.netbeans.jemmy.Timeouts;
|
||||
import org.netbeans.jemmy.operators.JButtonOperator;
|
||||
import org.netbeans.jemmy.operators.JCheckBoxOperator;
|
||||
import org.netbeans.jemmy.operators.JComboBoxOperator;
|
||||
import org.netbeans.jemmy.operators.JDialogOperator;
|
||||
import org.netbeans.jemmy.operators.JFileChooserOperator;
|
||||
import org.netbeans.jemmy.operators.JLabelOperator;
|
||||
import org.netbeans.jemmy.operators.JListOperator;
|
||||
import org.netbeans.jemmy.operators.JTabbedPaneOperator;
|
||||
import org.netbeans.jemmy.operators.JTableOperator;
|
||||
import org.netbeans.jemmy.operators.JTextFieldOperator;
|
||||
import org.netbeans.junit.NbModuleSuite;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
|
||||
/**
|
||||
* This test expects the following system properties to be set: img_path: The
|
||||
@ -71,7 +41,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
public class RegressionTest extends TestCase {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RegressionTest.class.getName());
|
||||
long start;
|
||||
private static final AutopsyTestCases autopsyTests = new AutopsyTestCases();
|
||||
|
||||
/**
|
||||
* Constructor required by JUnit
|
||||
@ -80,32 +50,12 @@ public class RegressionTest extends TestCase {
|
||||
super(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to escape file/directory path. Example:
|
||||
* \\NetworkLocation\foo\bar get escaped to \\\\NetworkLocation\foo\bar so
|
||||
* that it can be used as intended.
|
||||
*
|
||||
* @param path
|
||||
*
|
||||
* @return escaped path the the file/directory location.
|
||||
*/
|
||||
private static String getEscapedPath(String path) {
|
||||
if (path.startsWith("\\\\")) { //already has escaped to \\\\NetworkLocation
|
||||
return path;
|
||||
}
|
||||
else if (path.startsWith("\\")) {
|
||||
return "\\" + path;
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates suite from particular test cases.
|
||||
*/
|
||||
public static Test suite() {
|
||||
// run tests with specific configuration
|
||||
File img_path = new File(getEscapedPath(System.getProperty("img_path")));
|
||||
File img_path = new File(AutopsyTestCases.getEscapedPath(System.getProperty("img_path")));
|
||||
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(RegressionTest.class).
|
||||
clusters(".*").
|
||||
enableModules(".*");
|
||||
@ -146,8 +96,7 @@ public class RegressionTest extends TestCase {
|
||||
*/
|
||||
@Override
|
||||
public void setUp() {
|
||||
|
||||
logger.info("######## " + getEscapedPath(System.getProperty("img_path")) + " #######");
|
||||
logger.info("######## " + AutopsyTestCases.getEscapedPath(System.getProperty("img_path")) + " #######");
|
||||
Timeouts.setDefault("ComponentOperator.WaitComponentTimeout", 1000000);
|
||||
}
|
||||
|
||||
@ -159,219 +108,50 @@ public class RegressionTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testNewCaseWizardOpen() {
|
||||
logger.info("New Case");
|
||||
NbDialogOperator nbdo = new NbDialogOperator("Welcome");
|
||||
JButtonOperator jbo = new JButtonOperator(nbdo, 0); // the "New Case" button
|
||||
jbo.pushNoBlock();
|
||||
autopsyTests.testNewCaseWizardOpen("Welcome");
|
||||
}
|
||||
|
||||
public void testNewCaseWizard() {
|
||||
logger.info("New Case Wizard");
|
||||
WizardOperator wo = new WizardOperator("New Case Information");
|
||||
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 1);
|
||||
jtfo0.typeText("AutopsyTestCase"); // Name the case "AutopsyTestCase"
|
||||
JTextFieldOperator jtfo1 = new JTextFieldOperator(wo, 2);
|
||||
jtfo1.typeText(getEscapedPath(System.getProperty("out_path")));
|
||||
wo.btNext().clickMouse();
|
||||
JTextFieldOperator jtfo2 = new JTextFieldOperator(wo, 0);
|
||||
jtfo2.typeText("000"); // Set the case number
|
||||
JTextFieldOperator jtfo3 = new JTextFieldOperator(wo, 1);
|
||||
jtfo3.typeText("Examiner 1"); // Set the case examiner
|
||||
start = System.currentTimeMillis();
|
||||
wo.btFinish().clickMouse();
|
||||
autopsyTests.testNewCaseWizard();
|
||||
}
|
||||
|
||||
|
||||
public void testStartAddImageFileDataSource() {
|
||||
logger.info("Starting Add Image process");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0);
|
||||
String img_path = getEscapedPath(System.getProperty("img_path"));
|
||||
String imageDir = img_path;
|
||||
((JTextField) jtfo0.getSource()).setText(imageDir);
|
||||
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo, 1);
|
||||
comboBoxOperator.setSelectedItem("(GMT-5:00) America/New_York");
|
||||
wo.btNext().clickMouse();
|
||||
autopsyTests.testStartAddImageFileDataSource();
|
||||
}
|
||||
|
||||
public void testStartAddLogicalFilesDataSource() {
|
||||
logger.info("Starting Add Logical Files process");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo);
|
||||
// select the item indexed 2 (Logical Files) from the drop-down list.
|
||||
comboBoxOperator.selectItem(2);
|
||||
JButtonOperator addButtonOperator = new JButtonOperator(wo, "Add");
|
||||
addButtonOperator.pushNoBlock();
|
||||
JFileChooserOperator fileChooserOperator = new JFileChooserOperator();
|
||||
fileChooserOperator.setCurrentDirectory(new File(getEscapedPath(System.getProperty("img_path"))));
|
||||
// set the current directory one level above the directory containing logicalFileSet folder.
|
||||
fileChooserOperator.goUpLevel();
|
||||
fileChooserOperator.chooseFile(new File(getEscapedPath(System.getProperty("img_path"))).getName());
|
||||
wo.btNext().clickMouse();
|
||||
autopsyTests.testStartAddLogicalFilesDataSource();
|
||||
}
|
||||
|
||||
public void testAddSourceWizard1() {
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
while (!wo.btFinish().isEnabled()) {
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.info("Add image took " + (System.currentTimeMillis() - start) + "ms");
|
||||
wo.btFinish().clickMouse();
|
||||
autopsyTests.testAddSourceWizard1();
|
||||
}
|
||||
|
||||
public void testConfigureIngest1() {
|
||||
/*
|
||||
* This timeout is to allow the setup for the ingest job settings panel
|
||||
* to complete.
|
||||
*/
|
||||
new Timeout("pausing", 10000).sleep();
|
||||
|
||||
logger.info("Looking for hash lookup module in ingest job settings panel");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTableOperator jto = new JTableOperator(wo, 0);
|
||||
int row = jto.findCellRow("Hash Lookup", 2, 0);
|
||||
jto.clickOnCell(row, 1);
|
||||
logger.info("Selected hash lookup module in ingest job settings panel");
|
||||
JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");
|
||||
jbo1.pushNoBlock();
|
||||
logger.info("Pushed Global Settings button for hash lookup module in ingest job settings panel");
|
||||
autopsyTests.testConfigureIngest1();
|
||||
}
|
||||
|
||||
public void testConfigureHash() {
|
||||
logger.info("Hash Configure");
|
||||
JDialog hashMainDialog = JDialogOperator.waitJDialog("Global Hash Lookup Settings", false, false);
|
||||
JDialogOperator hashMainDialogOperator = new JDialogOperator(hashMainDialog);
|
||||
List<String> databases = new ArrayList<String>();
|
||||
databases.add(getEscapedPath(System.getProperty("nsrl_path")));
|
||||
databases.add(getEscapedPath(System.getProperty("known_bad_path")));
|
||||
for (String database : databases) {
|
||||
JButtonOperator importButtonOperator = new JButtonOperator(hashMainDialogOperator, "Import");
|
||||
importButtonOperator.pushNoBlock();
|
||||
JDialog addDatabaseDialog = JDialogOperator.waitJDialog("Import Hash Database", false, false);
|
||||
JDialogOperator addDatabaseDialogOperator = new JDialogOperator(addDatabaseDialog);
|
||||
JButtonOperator browseButtonOperator = new JButtonOperator(addDatabaseDialogOperator, "Open...", 0);
|
||||
browseButtonOperator.pushNoBlock();
|
||||
JFileChooserOperator fileChooserOperator = new JFileChooserOperator();
|
||||
fileChooserOperator.chooseFile(database);
|
||||
JButtonOperator okButtonOperator = new JButtonOperator(addDatabaseDialogOperator, "OK", 0);
|
||||
okButtonOperator.pushNoBlock();
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
// Used if the database has no index
|
||||
//JDialog jd3 = JDialogOperator.waitJDialog("No Index Exists", false, false);
|
||||
//JDialogOperator jdo3 = new JDialogOperator(jd3);
|
||||
//JButtonOperator jbo3 = new JButtonOperator(jdo3, "Yes", 0);
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
//jbo3.pushNoBlock();
|
||||
JButtonOperator jbo4 = new JButtonOperator(hashMainDialogOperator, "OK", 0);
|
||||
jbo4.pushNoBlock();
|
||||
autopsyTests.testConfigureHash();
|
||||
}
|
||||
|
||||
public void testConfigureIngest2() {
|
||||
logger.info("Looking for keyword search module in ingest job settings panel");
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
JTableOperator jto = new JTableOperator(wo, 0);
|
||||
int row = jto.findCellRow("Keyword Search", 2, 0);
|
||||
jto.clickOnCell(row, 1);
|
||||
logger.info("Selected keyword search module in ingest job settings panel");
|
||||
JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");
|
||||
jbo1.pushNoBlock();
|
||||
logger.info("Pushed Global Settings button for keyword search module in ingest job settings panel");
|
||||
autopsyTests.testConfigureIngest2();
|
||||
}
|
||||
|
||||
public void testConfigureSearch() {
|
||||
logger.info("Search Configure");
|
||||
JDialog jd = JDialogOperator.waitJDialog("Global Keyword Search Settings", false, false);
|
||||
JDialogOperator jdo = new JDialogOperator(jd);
|
||||
String words = getEscapedPath(System.getProperty("keyword_path"));
|
||||
JButtonOperator jbo0 = new JButtonOperator(jdo, "Import List", 0);
|
||||
jbo0.pushNoBlock();
|
||||
JFileChooserOperator jfco0 = new JFileChooserOperator();
|
||||
jfco0.chooseFile(words);
|
||||
JTableOperator jto = new JTableOperator(jdo, 0);
|
||||
jto.clickOnCell(0, 0);
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to process
|
||||
if (Boolean.parseBoolean(System.getProperty("mugen_mode"))) {
|
||||
JTabbedPaneOperator jtpo = new JTabbedPaneOperator(jdo);
|
||||
jtpo.selectPage("String Extraction");
|
||||
JCheckBoxOperator jcbo0 = new JCheckBoxOperator(jtpo, "Arabic (Arabic)");
|
||||
jcbo0.doClick();
|
||||
JCheckBoxOperator jcbo1 = new JCheckBoxOperator(jtpo, "Han (Chinese, Japanese, Korean)");
|
||||
jcbo1.doClick();
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to process
|
||||
}
|
||||
JButtonOperator jbo2 = new JButtonOperator(jdo, "OK", 0);
|
||||
jbo2.pushNoBlock();
|
||||
WizardOperator wo = new WizardOperator("Add Data");
|
||||
new Timeout("pausing", 10000).sleep(); // let things catch up
|
||||
wo.btNext().clickMouse();
|
||||
autopsyTests.testConfigureSearch();
|
||||
}
|
||||
|
||||
public void testIngest() {
|
||||
logger.info("Ingest 3");
|
||||
new Timeout("pausing", 10000).sleep(); // wait for ingest to actually start
|
||||
long startIngest = System.currentTimeMillis();
|
||||
IngestManager man = IngestManager.getInstance();
|
||||
while (man.isIngestRunning()) {
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
logger.log(Level.INFO, "Ingest (including enqueue) took {0}ms", (System.currentTimeMillis() - startIngest));
|
||||
// allow keyword search to finish saving artifacts, just in case
|
||||
// but randomize the timing so that we don't always get the same error
|
||||
// consistently, making it seem like default behavior
|
||||
Random rand = new Random();
|
||||
new Timeout("pausing", 10000 + (rand.nextInt(15000) + 5000)).sleep();
|
||||
screenshot("Finished Ingest");
|
||||
|
||||
autopsyTests.testIngest();
|
||||
}
|
||||
|
||||
public void testGenerateReportToolbar() {
|
||||
logger.info("Generate Report Toolbars");
|
||||
MainWindowOperator mwo = MainWindowOperator.getDefault();
|
||||
JButtonOperator jbo = new JButtonOperator(mwo, "Generate Report");
|
||||
jbo.pushNoBlock();
|
||||
new Timeout("pausing", 5000).sleep();
|
||||
autopsyTests.testGenerateReportToolbar();
|
||||
}
|
||||
|
||||
public void testGenerateReportButton() throws IOException {
|
||||
logger.info("Generate Report Button");
|
||||
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
|
||||
JDialogOperator reportDialogOperator = new JDialogOperator(reportDialog);
|
||||
JListOperator listOperator = new JListOperator(reportDialogOperator);
|
||||
JButtonOperator jbo0 = new JButtonOperator(reportDialogOperator, "Next");
|
||||
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
|
||||
Date date = new Date();
|
||||
String datenotime = dateFormat.format(date);
|
||||
listOperator.clickOnItem(0, 1);
|
||||
new Timeout("pausing", 1000).sleep();
|
||||
jbo0.pushNoBlock();
|
||||
new Timeout("pausing", 1000).sleep();
|
||||
JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator, "Finish");
|
||||
jbo1.pushNoBlock();
|
||||
new Timeout("pausing", 500).sleep();
|
||||
JDialog previewDialog = JDialogOperator.waitJDialog("Progress", false, false);
|
||||
screenshot("Progress");
|
||||
JDialogOperator previewDialogOperator = new JDialogOperator(previewDialog);
|
||||
JLabelOperator.waitJLabel(previewDialog, "Complete", false, false);
|
||||
JButtonOperator jbo2 = new JButtonOperator(previewDialogOperator, "Close");
|
||||
jbo2.pushNoBlock();
|
||||
new Timeout("pausing", 10000).sleep();
|
||||
System.setProperty("ReportStr", datenotime);
|
||||
screenshot("Done Testing");
|
||||
}
|
||||
|
||||
public void screenshot(String name) {
|
||||
logger.info("Taking screenshot.");
|
||||
try {
|
||||
Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
||||
BufferedImage capture = new Robot().createScreenCapture(screenRect);
|
||||
String outPath = getEscapedPath(System.getProperty("out_path"));
|
||||
ImageIO.write(capture, "png", new File(outPath + "\\" + name + ".png"));
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second to save
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "IOException taking screenshot.", ex);
|
||||
} catch (AWTException ex) {
|
||||
logger.log(Level.WARNING, "AWTException taking screenshot.", ex);
|
||||
|
||||
}
|
||||
autopsyTests.testGenerateReportButton();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#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
|
||||
SPLASH_HEIGHT=314
|
||||
SPLASH_WIDTH=538
|
||||
|
@ -1,4 +1,4 @@
|
||||
#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_No_Project=Autopsy 4.3.0
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 11 KiB |
BIN
docs/doxygen-user/images/updatedSolr_cmd.PNG
Normal file
After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 1017 B |
BIN
docs/doxygen-user/images/zooDir.PNG
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
docs/doxygen-user/images/zooPurge.PNG
Normal file
After Width: | Height: | Size: 6.8 KiB |
@ -1,5 +1,5 @@
|
||||
/*! \page install_solr Install and Configure Solr
|
||||
A central Solr server is needed to store keyword indexes. To install Solr, perform the following steps:
|
||||
/*! \page install_solr Install and Configure Solr and Zookeeper
|
||||
A central Solr server is needed to store keyword indexes. Zookeeper is used to manage Solr configuration and as a coordination service for Autopsy. It is installed as part of Bitnami Solr package, but has to be configured separately. To install Solr, perform the following steps:
|
||||
|
||||
|
||||
|
||||
@ -7,95 +7,131 @@ A central Solr server is needed to store keyword indexes. To install Solr, perfo
|
||||
|
||||
You will need:
|
||||
- 64-bit version of the Java Runtime Environment (JRE) from http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html.
|
||||
- Download the Apache Solr 4.10.3-0 installation package from https://sourceforge.net/projects/autopsy/files/CollaborativeServices/Solr or <a href="https://sourceforge.net/projects/autopsy/files/CollaborativeServices/Solr/bitnami-solr-4.10.3-0-windows-installer.exe/download">Direct Download Link</a>
|
||||
- Download the latest Solr 6 installation package from https://bitnami.com/stack/solr/installer#windows. For the purposes of this guide that was the Bitnami Solr 6.2.1-2.
|
||||
- Access to an installed version of Autopsy so that you can copy files from it.
|
||||
- A network-accessible machine to install Solr upon. Note that the Solr process will need to write data out to the main shared storage drive, and needs adequate permissions to write to this location, which may be across a network.
|
||||
|
||||
\section install_solr_install Installation
|
||||
|
||||
\subsection install_solr_install_java JRE Installation
|
||||
Install the Java JRE if needed. You can test this by running _where java_ from the command line. If you see output like the yellow results below, you have a JRE.
|
||||
1. Install the Java JRE if needed. You can test this by running _where java_ from the command line. If you see output like the yellow results below, you have a JRE.
|
||||
<br><br>
|
||||
\image html wherejava.PNG
|
||||
\image html symlinkjava.PNG
|
||||
<br><br>
|
||||
If you need the JRE, install it with the default settings.
|
||||
|
||||
2. Create a Windows environment variable for your <i>JavaHome</i> with the path to your 64-bit version of the JRE. If you do not know the path, the correct _JavaHome_ path can be obtained by running the command _where java_ from the Windows command line. An example is shown below. Do not include the <i>"bin"</i> folder in the path you place into the _JavaHome_ variable. A correct example of the final result will look something like this:
|
||||
<i>JavaHome="C:\Program Files\Java\jre1.8.0_111"</i>
|
||||
<br><br>
|
||||
\image html wherejava.PNG
|
||||
<br><br>
|
||||
<br><br>
|
||||
Note that if you get something like the following when running the <i>"where java"</i> command, it is a symbolic link to the Java installation and you need to trace it to the proper folder as explained below.
|
||||
<br><br>
|
||||
\image html symlinkjava.PNG
|
||||
<br><br>
|
||||
To trace a symbolic link to the proper folder, use Windows Explorer to navigate to the path shown (<i>C:\\ProgramData\\Oracle\\Java\\javapath</i> for the example above), then right click on _java.exe_ and Click on _Properties_. You will see the path you should use in the _Location_ field, shown in the screenshot below. Do not include the <i>"bin"</i> folder in the path you place into the _JavaHome_ variable.
|
||||
<br><br>
|
||||
\image html javaproperties.PNG
|
||||
<br><br>
|
||||
|
||||
\subsection install_solr_install_solr Solr Installation
|
||||
|
||||
The following steps will configure Solr to run using an account that will have access to the network storage.
|
||||
|
||||
1. Run the Bitnami installer, <i>bitnami-solr-4.10.3-0-windows-installer.exe</i>
|
||||
1. Run the Bitnami installer, <i>"bitnami-solr-6.2.1-2-windows-installer.exe"</i>
|
||||
2. If Windows prompts with User Account Control, click _Yes_
|
||||
3. Follow the prompts through to completion. You do not need to "Learn more about Bitnami cloud hosting" so you can clear the check box.
|
||||
3. Follow the prompts through to completion. You do not need to <i>"Learn more about Bitnami cloud hosting"</i> so you can clear the check box.
|
||||
4. If you see an error dialog like the following, you may safely ignore it.
|
||||
<br><br>
|
||||
\image html apachebadmessage.PNG
|
||||
<br>
|
||||
5. When the installation completes, clear the "Launch Bitnami Apache Solr Stack Now?" checkbox and click _Finish_.
|
||||
5. When the installation completes, clear the <i>"Launch Bitnami Apache Solr Stack Now?"</i> checkbox and click _Finish_.
|
||||
|
||||
\subsection install_solr_config Solr Configuration
|
||||
1. Stop the _solrJetty_ service by pressing _Start_, typing _services.msc_, pressing _Enter_, and locating the _solrJetty_ Windows service. Select the service and press _Stop the service_. If the service is already stopped and there is no _Stop the service_ available, this is okay.
|
||||
2. Edit the <i>C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat</i> script. You need administrator permission to change this file. The easiest way around this is to save a copy on the Desktop, edit the Desktop version, and copy the new one back over the top of the old. Windows will ask for permission to overwrite the old file; allow it. You should make the following changes to this file:
|
||||
2. Edit the <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\scripts\serviceinstall.bat"</i> script. You need administrator permission to change this file. The easiest way around this is to save a copy on the Desktop, edit the Desktop version, and copy the new one back over the top of the old. Windows will ask for permission to overwrite the old file; allow it. You should make the following changes to this file:
|
||||
<br>
|
||||
<br>
|
||||
- Add the following options in the _JvmOptions_ section of the line that begins with <i>"C:\Bitnami\solr-4.10.3-0/apache-solr\scripts\prunsrv.exe"</i> :
|
||||
+ <i>++JvmOptions=-Dcollection.configName=AutopsyConfig</i>
|
||||
+ <i>++JvmOptions=-Dbootstrap_confdir="C:\Bitnami\solr-4.10.3-0\apache-solr\solr\configsets\AutopsyConfig\conf"</i>
|
||||
- Replace the path to <i>JavaHome</i> with the path to your 64-bit version of the JRE. If you do not know the path, the correct _JavaHome_ path can be obtained by running the command <i>"where java"</i> from the Windows command line. An example is shown below. The text in yellow is what we are interested in. Do not include the <i>"bin"</i> folder in the path you place into the _JavaHome_ variable. A correct example of the final result will look something like this: <i>--JavaHome="C:\Program Files\Java\jre1.8.0_45"</i>
|
||||
<br><br>
|
||||
\image html wherejava.PNG
|
||||
<br><br>
|
||||
Note that if you get something like the following when running the <i>"where java"</i> command, it is a symbolic link to the Java installation and you need to trace it to the proper folder as explained below.
|
||||
<br><br>
|
||||
\image html symlinkjava.PNG
|
||||
<br><br>
|
||||
To trace a symbolic link to the proper folder, use Windows Explorer to navigate to the path shown (<i>C:\\ProgramData\\Oracle\\Java\\javapath</i> for the example above), then right click on _java.exe_ and Click on _Properties_. You will see the path you should use in the _Target_ field, shown in the screenshot below. Do not include the <i>"bin"</i> folder in the path you place into the _JavaHome_ variable.
|
||||
<br><br>
|
||||
\image html javaproperties.PNG
|
||||
<br><br>
|
||||
A portion of an updated _serviceinstall.bat_ is shown below, with the changes marked in yellow.
|
||||
<br><br>
|
||||
\image html updatedServiceInstall.PNG
|
||||
<br><br>
|
||||
3. Edit <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\solr\solr.xml"</i> to set the _transientCacheSize_ to the maximum number of cases expected to be open concurrently. If you expect ten concurrent cases, the text to add is
|
||||
<i>\<int name="transientCacheSize">10\</int></i>
|
||||
<br><br>
|
||||
The added part is highlighted in yellow below. Ensure that it is inside the <i>\<solr></i> tag as follows:
|
||||
<br>
|
||||
\image html transientcache.PNG
|
||||
<br><br>
|
||||
4. Edit <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\resources/log4j.properties"</i> to configure Solr log settings:
|
||||
- Increase the log rotation size threshold (_log4j\.appender\.file\.MaxFileSize_) from 4MB to 100MB.
|
||||
- Remove the _CONSOLE_ appender from the _log4j\.rootLogger_ line.
|
||||
<br><br>
|
||||
Again you may have trouble saving to the file in the current location. If so, just save it out to the desktop and copy the edited file back over the top of the original.
|
||||
<br><br>
|
||||
The log file should end up looking like this (modified lines are highlighted in yellow):
|
||||
<br><br>
|
||||
\image html log4j.PNG
|
||||
<br><br>
|
||||
5. From an Autopsy installation, copy the folder <i>"C:\Program Files\Autopsy-4.1\autopsy\solr\solr\configsets"</i> to <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\solr"</i>.
|
||||
6. From an Autopsy installation, copy the folder <i>"C:\Program Files\Autopsy-4.1\autopsy\solr\solr\lib"</i> to <i>"C:\Bitnami\solr-4.10.3-0\apache-solr\solr"</i>.
|
||||
7. Start a Windows command prompt as administrator by pressing _Start_, typing _command_, right clicking on _Command Prompt_, and clicking on _Run as administrator_. Then run the following command to install the _solrJetty_ service:
|
||||
<br><br>
|
||||
<i>cmd /c C:\\Bitnami\\solr-4.10.3-0\\apache-solr\\scripts\\serviceinstall.bat INSTALL</i>
|
||||
<br><br>
|
||||
Note the argument "INSTALL" is case sensitive. Your command prompt should look like the screenshot below. Very likely it will say "The solrJetty service could not be started." This is okay.
|
||||
<br><br>
|
||||
\image html solrinstall1.PNG
|
||||
<br><br>
|
||||
8. Press _Start_, type _services.msc_, and press _Enter_. Find _solrJetty_. If the service is running, press _Stop the service_, then double click it, and switch to the _Log On_ tab to change the logon credentials to a user who will have access to read and write the primary shared drive. Note that selecting "Local System account" will work only if Solr service and case output folders are on the same machine. Using "Local System account" to run Solr service and having case output folders on a different machine will result in Solr being unable to create index files.
|
||||
<br>If the machine is on a domain, the Account Name will be in the form of _DOMAINNAME\\username_ as shown in the example below. Note that in the screenshot below, the domain name is _DOMAIN_ and the user name is _username_. These are just examples, not real values.
|
||||
<br><br>
|
||||
\image html solrinstall2.PNG
|
||||
<br>
|
||||
If the machine is on a domain, **make sure** to select the domain with the mouse by going to the _Log On_ tab, clicking _Browse_, then clicking _Locations_ and selecting the domain of interest. Then enter the user name desired and press _Check Names_. When that completes, press _OK_, type in the password once for each box and press _OK_. You may see "The user has been granted the log on as a service right."
|
||||
- Add the following options in the line that begins with <i>"-StartParams"</i> :
|
||||
+ <i>-StartParams="start;-c;-Dbootstrap_confdir=C:\Bitnami\solr-6.2.1-2\apache-solr\server\solr\configsets\AutopsyConfig\conf;-Dcollection.configName=AutopsyConfig" ^</i>
|
||||
<br>
|
||||
A portion of an updated _serviceinstall.bat_ is shown below, with the changes marked in yellow.
|
||||
<br><br>
|
||||
\image html updatedServiceInstall.PNG
|
||||
<br><br>
|
||||
3. Edit <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\bin\solr.cmd"</i> and point _JAVA_HOME_ to _JavaHome_ path on your machine.
|
||||
Changes in _solr.cmd_ are highlighted in yellow
|
||||
<br><br>
|
||||
\image html updatedSolr_cmd.PNG
|
||||
<br><br>
|
||||
4. Edit <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\server\solr\solr.xml"</i> to set the _transientCacheSize_ to the maximum number of cases expected to be open concurrently. If you expect ten concurrent cases, the text to add is
|
||||
<i>\<int name="transientCacheSize">10\</int></i>
|
||||
<br><br>
|
||||
The added part is highlighted in yellow below. Ensure that it is inside the <i>\<solr></i> tag as follows:
|
||||
<br>
|
||||
\image html transientcache.PNG
|
||||
<br><br>
|
||||
5. Edit <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\server\resources\log4j.properties"</i> to configure Solr log settings:
|
||||
- Increase the log rotation size threshold (_log4j\.appender\.file\.MaxFileSize_) from 4MB to 100MB.
|
||||
- Remove the _CONSOLE_ appender from the _log4j\.rootLogger_ line.
|
||||
<br><br>
|
||||
The log file should end up looking like this (modified lines are highlighted in yellow
|
||||
<br><br>
|
||||
\image html log4j.PNG
|
||||
<br><br>
|
||||
6. From an Autopsy installation, copy the folder <i>"C:\Program Files\Autopsy-XXX(current version)\autopsy\solr\solr\configsets"</i> to <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\server\solr\configsets"</i>.
|
||||
7. From an Autopsy installation, copy the folder <i>"C:\Program Files\Autopsy-XXX(current version)\autopsy\solr\solr\lib"</i> to <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\server\solr\lib"</i>.
|
||||
\subsection configure_Zookeeper Zookeeper Configuration
|
||||
|
||||
9. You should be able to see the Solr service in a web browser via the URL <i>http://localhost:8983/solr/#/</i> as shown in the screenshot below.
|
||||
<br><br>
|
||||
\image html solrinstall3.PNG
|
||||
<br><br>
|
||||
The following steps will configure Zookeeper.
|
||||
1. Stop the <i>solrJetty</i> service by pressing <i>Start</i>, typing <i>services.msc</i>, pressing Enter, and locating the <i>solrJetty</i> Windows service. Select the service and press <i>Stop the service</i>. If the service is already stopped and there is no <i>Stop the service</i> available, this is okay.
|
||||
2. Start a Windows command prompt as administrator by pressing Start, typing <i>command</i>, right clicking on <i>Command Prompt</i>, and clicking on <i>Run as administrator</i>. Then run the following command to uninstall the solrJetty service:
|
||||
|
||||
cmd /c C:\Bitnami\solr-6.2.1-2\apache-solr\scripts\serviceinstall.bat UNINSTALL
|
||||
|
||||
You will very likely see a result that says "The solrJetty service is not started." This is okay.
|
||||
|
||||
3. Create a folder <i>"C:\Bitnami\zookeeper"</i> if it does not exist.
|
||||
4. Edit <i>"C:\Bitnami\solr-6.2.1-2\apache-solr\server\solr\zoo.cfg"</i> to include the text <i>dataDir=C:/Bitnami/zookeeper</i> as shown in the screenshot below
|
||||
<br><br>
|
||||
\image html zooDir.PNG
|
||||
<br>
|
||||
5. Edit <i> "C:\Bitnami\solr-6.2.1-2\apache-solr\server\solr\zoo.cfg"</i> to include the text
|
||||
<br>
|
||||
<br>
|
||||
- <i>autopurge.snapRetainCount=3</i>
|
||||
<br> # ZooKeeper auto purge feature retains the autopurge.snapRetainCount most recent snapshots and the corresponding transaction logs in the dataDir and dataLogDir respectively and deletes the rest. Defaults to 3. Minimum value is 3.
|
||||
<br>
|
||||
- <i>autopurge.purgeInterval=24</i>
|
||||
<br> # The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging. Defaults to 0.
|
||||
<br>
|
||||
<br>
|
||||
as shown in yellow in the screenshot below
|
||||
<br><br>
|
||||
\image html zooPurge.PNG
|
||||
<br>
|
||||
6. Start a Windows command prompt as administrator by pressing Start, typing <i>command</i>, right clicking on <i>Command Prompt</i>, and clicking on <i>Run as administrator</i>. Then run the following command to install the solrJetty service:
|
||||
|
||||
cmd /c C:\Bitnami\solr-6.2.1-2\apache-solr\scripts\serviceinstall.bat INSTALL
|
||||
<br> Note the argument "INSTALL" is case sensitive. Your command prompt should look like the screenshot below. Very likely your command prompt will say "The solrJetty service could not be started." This is okay.
|
||||
<br><br>
|
||||
\image html solrinstall1.PNG
|
||||
<br><br>
|
||||
\subsection start_solr Start Solr
|
||||
1. You should be able to see the Solr service in a web browser via the URL http://localhost:8983/solr/#/ as shown in the screenshot below. If you can, you should skip the next step. If you cannot, proceed to the next step.
|
||||
|
||||
2. Press _Start_, type _services.msc_, and press _Enter_. Find _solrJetty_. If the service is running, press _Stop the service_, then double click it, and switch to the _Log On_ tab to change the logon credentials to a user who will have access to read and write the primary shared drive. Note that selecting "Local System account" will work only if Solr service and case output folders are on the same machine. Using "Local System account" to run Solr service and having case output folders on a different machine will result in Solr being unable to create index files.
|
||||
<br>If the machine is on a domain, the Account Name will be in the form of _DOMAINNAME\\username_ as shown in the example below. Note that in the screenshot below, the domain name is _DOMAIN_ and the user name is _username_. These are just examples, not real values.
|
||||
<br><br>
|
||||
\image html solrinstall2.PNG
|
||||
<br>
|
||||
If the machine is on a domain, **make sure** to select the domain with the mouse by going to the _Log On_ tab, clicking _Browse_, then clicking _Locations_ and selecting the domain of interest. Then enter the user name desired and press _Check Names_. When that completes, press _OK_, type in the password once for each box and press _OK_. You may see "The user has been granted the log on as a service right."
|
||||
|
||||
3. You should be able to see the Solr service in a web browser via the URL <i>http://localhost:8983/solr/#/</i> as shown in the screenshot below.
|
||||
<br><br>
|
||||
\image html solrinstall3.PNG
|
||||
<br><br>
|
||||
If the service is appropriately started and you are unable to see the screenshot above, contact your network administrator to open ports in the firewall.
|
||||
<br><br>
|
||||
<b>Warning: The Solr process must have adequate permissions to write data to the main shared storage drive where case output will be stored.</b>
|
||||
|
@ -34,6 +34,7 @@ Autopsy will generate events as the application runs and modules may want to lis
|
||||
- Case change events occur when a case is opened, closed, or changed. The org.sleuthkit.autopsy.casemodule.Case.addPropertyChangeListener() method can be used for this.
|
||||
- IngestManager events occur when new results are available. The org.sleuthkit.autopsy.ingest.IngestManager.addPropertyChangeListener() method can be used for this.
|
||||
|
||||
Preventing a user from modifying settings during ingest can be accomplished by listening for Ingest Job Events, and when there is an event setting the enabled status of those settings based off the opposite of IngestManager.getInstance().isIngestRunning(), which returns a boolean.
|
||||
|
||||
|
||||
*/
|
||||
|
@ -404,7 +404,7 @@ class TestRunner(object):
|
||||
test_data.ant = ["ant"]
|
||||
test_data.ant.append("-v")
|
||||
test_data.ant.append("-f")
|
||||
test_data.ant.append(make_local_path(test_data.main_config.build_path))
|
||||
test_data.ant.append(make_local_path(test_data.main_config.build_path, "build.xml"))
|
||||
test_data.ant.append("regression-test")
|
||||
test_data.ant.append("-l")
|
||||
test_data.ant.append(test_data.antlog_dir)
|
||||
@ -1485,7 +1485,7 @@ def copy_logs(test_data):
|
||||
shutil.copytree(log_dir, test_data.logs_dir)
|
||||
|
||||
# copy logs from userdir0/var/log
|
||||
log_dir = os.path.join("..", "..", "Testing","build","test","qa-functional","work","userdir0","var","log/")
|
||||
log_dir = os.path.join(test_data.main_config.build_path,"build","test","qa-functional","work","userdir0","var","log/")
|
||||
for log in os.listdir(log_dir):
|
||||
if log.find("log"):
|
||||
new_name = log_dir + "userdir0." + log
|
||||
|