No unalloc space add image wizard option

This commit is contained in:
adam-m 2012-05-29 15:10:26 -04:00
parent ff4f10dd92
commit add3c69f4b
7 changed files with 89 additions and 30 deletions

View File

@ -71,6 +71,8 @@ public final class AddImageAction extends CallableSystemAction implements Presen
static final String LOOKUPFILES_PROP = "lookupFiles"; static final String LOOKUPFILES_PROP = "lookupFiles";
// boolean: whether or not to skip processing orphan files on FAT filesystems // boolean: whether or not to skip processing orphan files on FAT filesystems
static final String NOFATORPHANS_PROP = "nofatorphans"; static final String NOFATORPHANS_PROP = "nofatorphans";
// boolean: whether or not to skip processing of unallocated space
static final String NOUNALLOC_PROP = "nounalloc";
static final Logger logger = Logger.getLogger(AddImageAction.class.getName()); static final Logger logger = Logger.getLogger(AddImageAction.class.getName());

View File

@ -25,9 +25,10 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="noProcessUnallocSpace" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="imgPathLabel" min="-2" max="-2" attributes="0"/> <Component id="imgPathLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
@ -47,13 +48,15 @@
<Component id="multipleSelectLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="multipleSelectLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="imgInfoLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="imgInfoLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="timeZoneLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="timeZoneComboBox" min="-2" pref="253" max="-2" attributes="0"/>
</Group>
<Component id="noFatOrphansCheckbox" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" attributes="1">
<Component id="timeZoneLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="timeZoneComboBox" min="-2" pref="253" max="-2" attributes="0"/>
</Group>
<Component id="noFatOrphansCheckbox" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace pref="39" max="32767" attributes="0"/> <EmptySpace pref="39" max="32767" attributes="0"/>
</Group> </Group>
@ -80,16 +83,25 @@
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="multipleSelectLabel" min="-2" max="-2" attributes="0"/> <Component id="multipleSelectLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0"> <Group type="102" attributes="0">
<Component id="timeZoneLabel" alignment="3" min="-2" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="timeZoneComboBox" alignment="3" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0">
<Component id="timeZoneLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="timeZoneComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="28" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="noProcessUnallocSpace" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="noFatOrphansCheckbox" min="-2" max="-2" attributes="0"/> <Component id="noFatOrphansCheckbox" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
</Group> </Group>
@ -229,5 +241,15 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JCheckBox" name="noProcessUnallocSpace">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="AddImageVisualPanel1.noProcessUnallocSpace.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="noProcessUnallocSpaceActionPerformed"/>
</Events>
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -115,6 +115,14 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
boolean getNoFatOrphans() { boolean getNoFatOrphans() {
return noFatOrphansCheckbox.isSelected(); return noFatOrphansCheckbox.isSelected();
} }
/**
*
* @return true if no unalloc space processing is selected
*/
boolean getNoUnallocSpaceProcess() {
return noProcessUnallocSpace.isSelected();
}
@ -213,6 +221,7 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
timeZoneLabel = new javax.swing.JLabel(); timeZoneLabel = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel();
noFatOrphansCheckbox = new javax.swing.JCheckBox(); noFatOrphansCheckbox = new javax.swing.JCheckBox();
noProcessUnallocSpace = new javax.swing.JCheckBox();
setPreferredSize(new java.awt.Dimension(588, 308)); setPreferredSize(new java.awt.Dimension(588, 308));
@ -270,6 +279,13 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noFatOrphansCheckbox.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noFatOrphansCheckbox.text")); // NOI18N
noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText")); // NOI18N noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(noProcessUnallocSpace, org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class, "AddImageVisualPanel1.noProcessUnallocSpace.text")); // NOI18N
noProcessUnallocSpace.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
noProcessUnallocSpaceActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
@ -277,6 +293,7 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(noProcessUnallocSpace)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(imgPathLabel) .addComponent(imgPathLabel)
.addGap(18, 18, 18) .addGap(18, 18, 18)
@ -293,12 +310,13 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
.addComponent(multipleSelectLabel) .addComponent(multipleSelectLabel)
.addComponent(imgInfoLabel) .addComponent(imgInfoLabel)
.addComponent(jLabel1) .addComponent(jLabel1)
.addGroup(layout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(timeZoneLabel) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGap(18, 18, 18) .addGroup(layout.createSequentialGroup()
.addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(timeZoneLabel)
.addComponent(noFatOrphansCheckbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(noFatOrphansCheckbox, javax.swing.GroupLayout.Alignment.LEADING)))
.addContainerGap(39, Short.MAX_VALUE)) .addContainerGap(39, Short.MAX_VALUE))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
@ -321,15 +339,21 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
.addComponent(imgPathBrowserButton)) .addComponent(imgPathBrowserButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(multipleSelectLabel) .addComponent(multipleSelectLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createSequentialGroup()
.addComponent(timeZoneLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(timeZoneLabel)
.addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(noProcessUnallocSpace)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addComponent(noFatOrphansCheckbox) .addComponent(noFatOrphansCheckbox)
.addGap(18, 18, 18) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1) .addComponent(jLabel1)
.addContainerGap()) .addContainerGap())
); );
@ -442,6 +466,11 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
this.wizPanel.moveFocusToNext(); this.wizPanel.moveFocusToNext();
}//GEN-LAST:event_imgPathBrowserButtonActionPerformed }//GEN-LAST:event_imgPathBrowserButtonActionPerformed
private void noProcessUnallocSpaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noProcessUnallocSpaceActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_noProcessUnallocSpaceActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup1; private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JRadioButton encase; private javax.swing.JRadioButton encase;
@ -454,6 +483,7 @@ final class AddImageVisualPanel1 extends JPanel implements DocumentListener {
private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel2;
private javax.swing.JLabel multipleSelectLabel; private javax.swing.JLabel multipleSelectLabel;
private javax.swing.JCheckBox noFatOrphansCheckbox; private javax.swing.JCheckBox noFatOrphansCheckbox;
private javax.swing.JCheckBox noProcessUnallocSpace;
private static javax.swing.JRadioButton rawSingle; private static javax.swing.JRadioButton rawSingle;
private javax.swing.JRadioButton rawSplit; private javax.swing.JRadioButton rawSplit;
private javax.swing.JComboBox timeZoneComboBox; private javax.swing.JComboBox timeZoneComboBox;

View File

@ -214,6 +214,7 @@ class AddImageWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor>,
settings.putProperty(AddImageAction.IMGPATHS_PROP, getComponent().getImagePaths()); settings.putProperty(AddImageAction.IMGPATHS_PROP, getComponent().getImagePaths());
settings.putProperty(AddImageAction.TIMEZONE_PROP, getComponent().getSelectedTimezone()); // store the timezone settings.putProperty(AddImageAction.TIMEZONE_PROP, getComponent().getSelectedTimezone()); // store the timezone
settings.putProperty(AddImageAction.NOFATORPHANS_PROP, Boolean.valueOf(getComponent().getNoFatOrphans())); settings.putProperty(AddImageAction.NOFATORPHANS_PROP, Boolean.valueOf(getComponent().getNoFatOrphans()));
settings.putProperty(AddImageAction.NOUNALLOC_PROP, Boolean.valueOf(getComponent().getNoUnallocSpaceProcess()));
//settings.putProperty(AddImageAction.LOOKUPFILES_PROP, getComponent().getLookupFilesCheckboxChecked()); //settings.putProperty(AddImageAction.LOOKUPFILES_PROP, getComponent().getLookupFilesCheckboxChecked());
//settings.putProperty(AddImageAction.SOLR_PROP, getComponent().getIndexImageCheckboxChecked()); //settings.putProperty(AddImageAction.SOLR_PROP, getComponent().getIndexImageCheckboxChecked());

View File

@ -49,6 +49,8 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
private String timeZone; private String timeZone;
//whether to not process FAT filesystem orphans //whether to not process FAT filesystem orphans
private boolean noFatOrphans; private boolean noFatOrphans;
//whether to not process unalloc space
private boolean noUnallocSpace;
// task that will clean up the created database file if the wizard is cancelled before it finishes // task that will clean up the created database file if the wizard is cancelled before it finishes
private AddImageAction.CleanupTask cleanupImage; // initialized to null in readSettings() private AddImageAction.CleanupTask cleanupImage; // initialized to null in readSettings()
// flag to control the availiablity of next action // flag to control the availiablity of next action
@ -189,6 +191,7 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
imgPaths = (String[]) settings.getProperty(AddImageAction.IMGPATHS_PROP); imgPaths = (String[]) settings.getProperty(AddImageAction.IMGPATHS_PROP);
timeZone = settings.getProperty(AddImageAction.TIMEZONE_PROP).toString(); timeZone = settings.getProperty(AddImageAction.TIMEZONE_PROP).toString();
noFatOrphans = ((Boolean)settings.getProperty(AddImageAction.NOFATORPHANS_PROP)).booleanValue(); noFatOrphans = ((Boolean)settings.getProperty(AddImageAction.NOFATORPHANS_PROP)).booleanValue();
noUnallocSpace = ((Boolean)settings.getProperty(AddImageAction.NOUNALLOC_PROP)).booleanValue();
component.changeProgressBarTextAndColor("", 0, Color.black); component.changeProgressBarTextAndColor("", 0, Color.black);
@ -256,7 +259,7 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
}); });
process = currentCase.makeAddImageProcess(timeZone, noFatOrphans); process = currentCase.makeAddImageProcess(timeZone, !noUnallocSpace, noFatOrphans);
cancelledWhileRunning.enable(); cancelledWhileRunning.enable();
try { try {
process.run(imgPaths); process.run(imgPaths);

View File

@ -126,3 +126,4 @@ NewCaseVisualPanel2.examinerTextField.text=
NewCaseVisualPanel2.optionalLabel.text=Optional: Set Case Number and Examiner NewCaseVisualPanel2.optionalLabel.text=Optional: Set Case Number and Examiner
AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText= AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText=
AddImageVisualPanel1.noFatOrphansCheckbox.text=Disable in-depth file recovery of FAT file systems (faster results, but may miss deleted files) AddImageVisualPanel1.noFatOrphansCheckbox.text=Disable in-depth file recovery of FAT file systems (faster results, but may miss deleted files)
AddImageVisualPanel1.noProcessUnallocSpace.text=Disable recovery of unallocated space

View File

@ -172,8 +172,8 @@ public class Case {
} }
} }
AddImageProcess makeAddImageProcess(String timezone, boolean noFatOrphans) { AddImageProcess makeAddImageProcess(String timezone, boolean processUnallocSpace, boolean noFatOrphans) {
return this.db.makeAddImageProcess(timezone, true, noFatOrphans); return this.db.makeAddImageProcess(timezone, processUnallocSpace, noFatOrphans);
} }
/** /**