diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java index d0cc708de1..7197d0de44 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java @@ -44,10 +44,10 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.datasourceprocessors.AutoIngestDataSourceProcessor; /** - * A local/logical files and/or directories data source processor that - * implements the DataSourceProcessor service provider interface to allow - * integration with the add data source wizard. It also provides a run method - * overload to allow it to be used independently of the wizard. + * A local/logical files/logical evidence file(.lo1)/or directories data source + * processor that implements the DataSourceProcessor service provider interface + * to allow integration with the add data source wizard. It also provides a run + * method overload to allow it to be used independently of the wizard. */ @ServiceProviders(value = { @ServiceProvider(service = DataSourceProcessor.class) @@ -159,7 +159,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat if (configPanel.contentsAreL01()) { try { //if the L01 option was chosen - localFilePaths = extractL01Contents(localFilePaths); + localFilePaths = extractLogicalEvidenceFileContents(localFilePaths); } catch (L01Exception ex) { //contents of l01 could not be extracted don't add data source or run ingest List errors = new ArrayList<>(); @@ -172,11 +172,23 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat run(UUID.randomUUID().toString(), configPanel.getFileSetName(), localFilePaths, progressMonitor, callback); } - private List extractL01Contents(List l01FilePaths) throws L01Exception { + /** + * Extract the contents of the logical evidence files and return the paths + * to those extracted files. + * + * @param logicalEvidenceFilePaths + * + * @return extractedPaths - the paths to all the files extracted from the + * logical evidence files + * + * @throws + * org.sleuthkit.autopsy.casemodule.LocalFilesDSProcessor.L01Exception + */ + private List extractLogicalEvidenceFileContents(List logicalEvidenceFilePaths) throws L01Exception { List extractedPaths = new ArrayList<>(); Path ewfexportPath; ewfexportPath = locateEwfexportExecutable(); - for (String l01Path : l01FilePaths) { + for (String l01Path : logicalEvidenceFilePaths) { List command = new ArrayList<>(); command.add(ewfexportPath.toAbsolutePath().toString()); command.add("-f"); @@ -218,10 +230,22 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat return extractedPaths; } - static FileFilter getLogicalEvidenceFilter(){ + /** + * Get a file filter for logical evidence files. + * + * @return LOGICAL_EVIDENCE_FILTER + */ + static FileFilter getLogicalEvidenceFilter() { return LOGICAL_EVIDENCE_FILTER; } - + + /** + * Gets the path for the ewfexport executable. + * + * @return the path to ewfexport.exe + * + * @throws org.sleuthkit.autopsy.casemodule.LocalFilesDSProcessor.L01Exception + */ private Path locateEwfexportExecutable() throws L01Exception { // Must be running under a Windows operating system. if (!PlatformUtil.isWindowsOS()) { @@ -254,7 +278,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat if (!ewfexport.canExecute()) { throw new LocalFilesDSProcessor.L01Exception("EWF export executable can not be executed"); } - + return executablePath; } @@ -315,7 +339,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat // Local files DSP can process any file by simply adding it as a logical file. // It should return lowest possible non-zero confidence level and be treated // as the "option of last resort" for auto ingest purposes - + this.localFilePaths = Arrays.asList(new String[]{dataSourcePath.toString()}); //If there is only 1 file check if it is an L01 file and if it is extract the //contents and replace the paths, if the contents can't be extracted return 0 @@ -324,7 +348,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat if (LOGICAL_EVIDENCE_FILTER.accept(new File(path))) { try { //if the L01 option was chosen - localFilePaths = extractL01Contents(localFilePaths); + localFilePaths = extractLogicalEvidenceFileContents(localFilePaths); } catch (L01Exception ex) { logger.log(Level.WARNING, "File extension was .l01 but contents of logical evidence file were unable to be extracted", ex); //contents of l01 could not be extracted don't add data source or run ingest diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.form index 133dbbca72..2358dedb22 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.form @@ -1,23 +1,6 @@
- - - - - - - - - - - - - - - - - @@ -37,9 +20,9 @@ - + - + @@ -48,16 +31,16 @@ - + - + - + @@ -77,7 +60,7 @@ - + @@ -90,7 +73,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.java index ca6ee76867..9391617055 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalFilesDspPanel.java @@ -52,9 +52,9 @@ final class LogicalFilesDspPanel extends JPanel { */ private LogicalFilesDspPanel() { initComponents(); - jPanel1.setLayout(new BoxLayout(jPanel1, BoxLayout.Y_AXIS)); - jPanel1.add(l01panel); - jPanel1.add(localFilesPanel); + dspSubtypePanel.setLayout(new BoxLayout(dspSubtypePanel, BoxLayout.Y_AXIS)); + dspSubtypePanel.add(l01panel); + dspSubtypePanel.add(localFilesPanel); l01panel.setVisible(false); } @Override @@ -82,12 +82,12 @@ final class LogicalFilesDspPanel extends JPanel { } void select() { - jComboBox1.setSelectedIndex(0); + dspSubtypeComboBox.setSelectedIndex(0); localFilesPanel.setVisible(true); l01panel.setVisible(false); localFilesPanel.reset(); l01panel.reset(); - jPanel1.repaint(); + dspSubtypePanel.repaint(); } @Override @@ -104,34 +104,28 @@ final class LogicalFilesDspPanel extends JPanel { // //GEN-BEGIN:initComponents private void initComponents() { - jScrollPane1 = new javax.swing.JScrollPane(); - jTextArea1 = new javax.swing.JTextArea(); - jPanel1 = new javax.swing.JPanel(); - jComboBox1 = new javax.swing.JComboBox<>(); + dspSubtypePanel = new javax.swing.JPanel(); + dspSubtypeComboBox = new javax.swing.JComboBox<>(); - jTextArea1.setColumns(20); - jTextArea1.setRows(5); - jScrollPane1.setViewportView(jTextArea1); + dspSubtypePanel.setPreferredSize(new java.awt.Dimension(467, 160)); - jPanel1.setPreferredSize(new java.awt.Dimension(467, 160)); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + javax.swing.GroupLayout dspSubtypePanelLayout = new javax.swing.GroupLayout(dspSubtypePanel); + dspSubtypePanel.setLayout(dspSubtypePanelLayout); + dspSubtypePanelLayout.setHorizontalGroup( + dspSubtypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 466, Short.MAX_VALUE) ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + dspSubtypePanelLayout.setVerticalGroup( + dspSubtypePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 160, Short.MAX_VALUE) ); - jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] {Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text(), Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text()})); - jComboBox1.setMinimumSize(new java.awt.Dimension(379, 20)); - jComboBox1.setPreferredSize(new java.awt.Dimension(379, 20)); - jComboBox1.addActionListener(new java.awt.event.ActionListener() { + dspSubtypeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] {Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text(), Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text()})); + dspSubtypeComboBox.setMinimumSize(new java.awt.Dimension(379, 20)); + dspSubtypeComboBox.setPreferredSize(new java.awt.Dimension(379, 20)); + dspSubtypeComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jComboBox1ActionPerformed(evt); + dspSubtypeComboBoxActionPerformed(evt); } }); @@ -143,24 +137,24 @@ final class LogicalFilesDspPanel extends JPanel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 466, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(dspSubtypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(dspSubtypePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 466, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(dspSubtypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(dspSubtypePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents - private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed + private void dspSubtypeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dspSubtypeComboBoxActionPerformed if (evt.getSource() instanceof JComboBox) { JComboBox cb = (JComboBox) evt.getSource(); - String selectedSubType = jComboBox1.getSelectedItem().toString(); + String selectedSubType = dspSubtypeComboBox.getSelectedItem().toString(); if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text())) { localFilesPanel.setVisible(true); l01panel.setVisible(false); @@ -170,12 +164,12 @@ final class LogicalFilesDspPanel extends JPanel { } firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } - }//GEN-LAST:event_jComboBox1ActionPerformed + }//GEN-LAST:event_dspSubtypeComboBoxActionPerformed boolean validatePanel() { // display warning if there is one (but don't disable "next" button) - String selectedSubType = jComboBox1.getSelectedItem().toString(); + String selectedSubType = dspSubtypeComboBox.getSelectedItem().toString(); if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text())) { return localFilesPanel.validatePanel(); } else if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text())) { @@ -185,19 +179,17 @@ final class LogicalFilesDspPanel extends JPanel { } } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JComboBox jComboBox1; - private javax.swing.JPanel jPanel1; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JTextArea jTextArea1; + private javax.swing.JComboBox dspSubtypeComboBox; + private javax.swing.JPanel dspSubtypePanel; // End of variables declaration//GEN-END:variables boolean contentsAreL01() { - String selectedSubType = jComboBox1.getSelectedItem().toString(); + String selectedSubType = dspSubtypeComboBox.getSelectedItem().toString(); return selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text()); } List getContentPaths() { - String selectedSubType = jComboBox1.getSelectedItem().toString(); + String selectedSubType = dspSubtypeComboBox.getSelectedItem().toString(); if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text())) { return localFilesPanel.getContentPaths(); } else if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text())) { @@ -209,7 +201,7 @@ final class LogicalFilesDspPanel extends JPanel { } String getFileSetName() { - String selectedSubType = jComboBox1.getSelectedItem().toString(); + String selectedSubType = dspSubtypeComboBox.getSelectedItem().toString(); if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text())) { return localFilesPanel.getFileSetName(); } else if (selectedSubType.equals(Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text())) {