mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
1916 - adjust names and comments in LocalFilesDSProcessor
This commit is contained in:
parent
addefffabc
commit
0f7814528e
@ -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<String> errors = new ArrayList<>();
|
||||
@ -172,11 +172,23 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat
|
||||
run(UUID.randomUUID().toString(), configPanel.getFileSetName(), localFilePaths, progressMonitor, callback);
|
||||
}
|
||||
|
||||
private List<String> extractL01Contents(List<String> 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<String> extractLogicalEvidenceFileContents(List<String> logicalEvidenceFilePaths) throws L01Exception {
|
||||
List<String> extractedPaths = new ArrayList<>();
|
||||
Path ewfexportPath;
|
||||
ewfexportPath = locateEwfexportExecutable();
|
||||
for (String l01Path : l01FilePaths) {
|
||||
for (String l01Path : logicalEvidenceFilePaths) {
|
||||
List<String> 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()) {
|
||||
@ -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
|
||||
|
@ -1,23 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<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="jTextArea1">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</NonVisualComponents>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
@ -37,9 +20,9 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dspSubtypeComboBox" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel1" alignment="0" min="-2" pref="466" max="-2" attributes="0"/>
|
||||
<Component id="dspSubtypePanel" alignment="0" min="-2" pref="466" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@ -48,16 +31,16 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dspSubtypeComboBox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dspSubtypePanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Container class="javax.swing.JPanel" name="dspSubtypePanel">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[467, 160]"/>
|
||||
@ -77,7 +60,7 @@
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Container>
|
||||
<Component class="javax.swing.JComboBox" name="jComboBox1">
|
||||
<Component class="javax.swing.JComboBox" name="dspSubtypeComboBox">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new javax.swing.DefaultComboBoxModel<>(new String[] {Bundle.LogicalFilesDspPanel_subTypeComboBox_localFilesOption_text(), Bundle.LogicalFilesDspPanel_subTypeComboBox_l01FileOption_text()})" type="code"/>
|
||||
@ -90,7 +73,7 @@
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jComboBox1ActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dspSubtypeComboBoxActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
|
@ -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 {
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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))
|
||||
);
|
||||
}// </editor-fold>//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<String> jComboBox1;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JTextArea jTextArea1;
|
||||
private javax.swing.JComboBox<String> 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<String> 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())) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user