From 7cf2d5406cc0a9b52a3f3b5bf6533bbe8106fec1 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 1 Oct 2013 13:07:22 -0400 Subject: [PATCH 01/39] Added infrastructure for EnCase style file reporting. --- .../autopsy/report/FILE_REPORT_INFO.java | 104 +++++++ .../autopsy/report/FileReportModule.java | 63 ++++ .../autopsy/report/FileReportText.java | 169 +++++++++++ .../report/ReportWizardFileOptionsPanel.java | 96 +++++++ .../ReportWizardFileOptionsVisualPanel.form | 110 +++++++ .../ReportWizardFileOptionsVisualPanel.java | 269 ++++++++++++++++++ 6 files changed, 811 insertions(+) create mode 100755 Core/src/org/sleuthkit/autopsy/report/FILE_REPORT_INFO.java create mode 100755 Core/src/org/sleuthkit/autopsy/report/FileReportModule.java create mode 100755 Core/src/org/sleuthkit/autopsy/report/FileReportText.java create mode 100755 Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java create mode 100755 Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.form create mode 100755 Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/report/FILE_REPORT_INFO.java b/Core/src/org/sleuthkit/autopsy/report/FILE_REPORT_INFO.java new file mode 100755 index 0000000000..760ec79c5d --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/FILE_REPORT_INFO.java @@ -0,0 +1,104 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit 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.report; + +import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * Represents Column Headers for FileList Reports. + * + * Encapsulates functionality for getting column values from Files. + * + * @author jwallace + */ +public enum FILE_REPORT_INFO { + + NAME("Name") { + @Override + public String getValue(AbstractFile file) { + return file.getName(); + } + }, + FILE_EXT("File Extension") { + @Override + public String getValue(AbstractFile file) { + String name = file.getName(); + int extIndex = name.lastIndexOf("."); + return (extIndex == -1 ? "" : name.substring(extIndex)); + } + }, + A_TIME("Last Accessed") { + @Override + public String getValue(AbstractFile file) { + return file.getAtimeAsDate(); + } + }, + CR_TIME("File Created") { + @Override + public String getValue(AbstractFile file) { + return file.getCrtimeAsDate(); + } + }, + M_TIME("Last Modified") { + @Override + public String getValue(AbstractFile file) { + return file.getMtimeAsDate(); + } + }, + SIZE("Size") { + @Override + public String getValue(AbstractFile file) { + return String.valueOf(file.getSize()); + } + }, + HASH_VALUE("Hash Value") { + @Override + public String getValue(AbstractFile file) { + return file.getMd5Hash(); + } + }, + FULL_PATH("Full Path") { + @Override + public String getValue(AbstractFile file) { + try { + return file.getUniquePath(); + } catch (TskCoreException ex) { + return ""; + } + } + }; + + private String name; + + FILE_REPORT_INFO(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + /** + * Get the value of the column from the file. + * + * @return + */ + public abstract String getValue(AbstractFile file); +} diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportModule.java b/Core/src/org/sleuthkit/autopsy/report/FileReportModule.java new file mode 100755 index 0000000000..93494e5bf6 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportModule.java @@ -0,0 +1,63 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit 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.report; + +import java.util.List; +import org.sleuthkit.datamodel.AbstractFile; + +/** + * A Report Module that reports information on files in a case. + * + * @author jwallace + */ +public interface FileReportModule extends ReportModule { + + public void generateReport(String reportPath, ReportProgressPanel progress, List enabled); + + /** + * Initialize the report which will be stored at the given path. + * @param path + */ + public void startReport(String path); + + /** + * End the report. + * Will be called after the entire report has been written. + */ + public void endReport(); + + /** + * Start the file list table. + * @param headers The columns that should be included in the table. + */ + public void startTable(List headers); + + /** + * Add the given AbstractFile as a row in the table. + * Guaranteed to be called between startTable and endTable. + * @param toAdd the AbstractFile to be added. + * @param columns the columns that should be included + */ + public void addRow(AbstractFile toAdd, List columns); + + /** + * Close the table. + */ + public void endTable(); +} diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java new file mode 100755 index 0000000000..eef652b27d --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java @@ -0,0 +1,169 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit 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.report; + +import java.io.BufferedWriter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.openide.util.Exceptions; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.SleuthkitCase; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * A Tab-delimited text report of the files in the case. + * + * @author jwallace + */ +public class FileReportText implements FileReportModule { + private static final Logger logger = Logger.getLogger(FileReportText.class.getName()); + private String reportPath; + private Writer out; + + private static FileReportText instance; + + // Get the default implementation of this report + public static synchronized FileReportText getDefault() { + if (instance == null) { + instance = new FileReportText(); + } + return instance; + } + + @Override + public void startReport(String path) { + this.reportPath = path + "report.txt"; + try { + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.reportPath))); + } catch (IOException ex) { + logger.log(Level.WARNING, "Failed to create report text file", ex); + } + } + + @Override + public void endReport() { + if (out != null) { + try { + out.close(); + } catch (IOException ex) { + logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); + } + } + } + + private String getTabDelimitedList(List list) { + StringBuilder output = new StringBuilder(); + Iterator it = list.iterator(); + while(it.hasNext()) { + output.append(it.next()).append((it.hasNext() ? "\t" : System.lineSeparator())); + } + return output.toString(); + } + + @Override + public void startTable(List headers) { + List titles = new ArrayList<>(); + for(FILE_REPORT_INFO col : headers) { + titles.add(col.getName()); + } + try { + out.write(getTabDelimitedList(titles)); + } catch (IOException ex) { + logger.log(Level.WARNING, "Error when writing headers to report file: {0}", ex); + } + } + + @Override + public void addRow(AbstractFile toAdd, List columns) { + List cells = new ArrayList<>(); + for(FILE_REPORT_INFO type : columns) { + cells.add(type.getValue(toAdd)); + } + try { + out.write(getTabDelimitedList(cells)); + } catch (IOException ex) { + logger.log(Level.WARNING, "Error when writing row to report file: {0}", ex); + } + } + + @Override + public void endTable() { + try { + out.write(System.lineSeparator()); + } catch (IOException ex) { + logger.log(Level.WARNING, "Error when closing table: {0}", ex); + } + } + + @Override + public String getName() { + return "File Report"; + } + + @Override + public String getDescription() { + return "A tab delimited text file containing information about files in the case."; + } + + @Override + public String getExtension() { + return ".txt"; + } + + @Override + public String getFilePath() { + return "report.txt"; + } + + @Override + public void generateReport(String reportPath, ReportProgressPanel progress, List enabled) { + progress.setIndeterminate(false); + progress.start(); + progress.updateStatusLabel("querying database"); + List absFiles; + try { + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); + absFiles = skCase.findAllFilesWhere("NOT meta_type = 2"); + } catch (TskCoreException ex) { + Exceptions.printStackTrace(ex); + return; + } + progress.setMaximumProgress(absFiles.size()); + startReport(reportPath); + startTable(enabled); + for (AbstractFile file: absFiles) { + progress.increment(); + progress.updateStatusLabel("Now processing " + file.getName()); + addRow(file, enabled); + } + endTable(); + endReport(); + progress.complete(); + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java new file mode 100755 index 0000000000..2e09b0d5bd --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java @@ -0,0 +1,96 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit 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.report; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.JButton; +import javax.swing.event.ChangeListener; +import org.openide.WizardDescriptor; +import org.openide.util.HelpCtx; + +/** + * Wizard panel that allows configuration of File Report options. + * + * @author jwallace + */ +public class ReportWizardFileOptionsPanel implements WizardDescriptor.FinishablePanel{ + private WizardDescriptor wiz; + private ReportWizardFileOptionsVisualPanel component; + private JButton finishButton; + + ReportWizardFileOptionsPanel() { + finishButton = new JButton("Finish"); + finishButton.setEnabled(false); + + finishButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + wiz.doFinishClick(); + }; + }); + } + + public void setFinish(boolean enable) { + finishButton.setEnabled(enable); + } + + @Override + public boolean isFinishPanel() { + return true; + } + + @Override + public ReportWizardFileOptionsVisualPanel getComponent() { + if (component == null) { + component = new ReportWizardFileOptionsVisualPanel(this); + } + return component; + } + + @Override + public HelpCtx getHelp() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public void readSettings(WizardDescriptor data) { + this.wiz = data; + wiz.setOptions(new Object[] {WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, finishButton, WizardDescriptor.CANCEL_OPTION}); + } + + @Override + public void storeSettings(WizardDescriptor data) { + data.putProperty("fileReportOptions", getComponent().getFileReportOptions()); + } + + @Override + public boolean isValid() { + return true; + } + + @Override + public void addChangeListener(ChangeListener cl) { + } + + @Override + public void removeChangeListener(ChangeListener cl) { + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.form b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.form new file mode 100755 index 0000000000..dedff72c78 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.form @@ -0,0 +1,110 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.java new file mode 100755 index 0000000000..759b923608 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsVisualPanel.java @@ -0,0 +1,269 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit 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.report; + +import java.awt.Component; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.ListCellRenderer; +import javax.swing.ListModel; +import javax.swing.event.ListDataListener; + +/** + * Visual component of the File Report Configuration panel of the Report Wizard. + * + * @author jwallace + */ +public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel { + private List options; + private Map optionStates = new EnumMap<>(FILE_REPORT_INFO.class); + private ListModel model; + private ReportWizardFileOptionsPanel wizPanel; + + + public ReportWizardFileOptionsVisualPanel(ReportWizardFileOptionsPanel wizPanel) { + this.wizPanel = wizPanel; + initComponents(); + initOptionsList(); + } + + @Override + public String getName() { + return "Configure File Report"; + } + + /** + * Populate the list of File Report Information that can be selected. + */ + private void initOptionsList() { + options = Arrays.asList(FILE_REPORT_INFO.values()); + for(FILE_REPORT_INFO col : options) { + optionStates.put(col, Boolean.FALSE); + } + + model = new OptionsListModel(); + optionsList.setModel(model); + optionsList.setCellRenderer(new OptionsListRenderer()); + optionsList.setVisibleRowCount(-1); + + selectAllButton.setEnabled(true); + deselectAllButton.setEnabled(false); + + // Add the ability to enable and disable Tag checkboxes to the list + optionsList.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent evt) { + JList list = (JList) evt.getSource(); + int index = list.locationToIndex(evt.getPoint()); + FILE_REPORT_INFO value = (FILE_REPORT_INFO) model.getElementAt(index); + optionStates.put(value, !optionStates.get(value)); + list.repaint(); + boolean anySelected = anySelected(); + deselectAllButton.setEnabled(anySelected); + wizPanel.setFinish(anySelected); + selectAllButton.setEnabled(notAllSelected()); + } + }); + } + + /** + * Are any options selected? + * @return + */ + private boolean anySelected() { + for (Boolean b : optionStates.values()) { + if (b) { + return true; + } + } + return false; + } + + /** + * Are no options selected? + * @return + */ + private boolean notAllSelected() { + for (Boolean b : optionStates.values()) { + if (!b) { + return true; + } + } + return false; + } + + /** + * Get the user-selected settings. + * @return + */ + Map getFileReportOptions() { + return optionStates; + } + /** + * 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") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + optionsList = new javax.swing.JList(); + selectAllButton = new javax.swing.JButton(); + deselectAllButton = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + + optionsList.setModel(new javax.swing.AbstractListModel() { + String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; + public int getSize() { return strings.length; } + public Object getElementAt(int i) { return strings[i]; } + }); + jScrollPane1.setViewportView(optionsList); + + org.openide.awt.Mnemonics.setLocalizedText(selectAllButton, org.openide.util.NbBundle.getMessage(ReportWizardFileOptionsVisualPanel.class, "ReportWizardFileOptionsVisualPanel.selectAllButton.text")); // NOI18N + selectAllButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + selectAllButtonActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(deselectAllButton, org.openide.util.NbBundle.getMessage(ReportWizardFileOptionsVisualPanel.class, "ReportWizardFileOptionsVisualPanel.deselectAllButton.text")); // NOI18N + deselectAllButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + deselectAllButtonActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ReportWizardFileOptionsVisualPanel.class, "ReportWizardFileOptionsVisualPanel.jLabel1.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) + .addGroup(layout.createSequentialGroup() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(deselectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(selectAllButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deselectAllButton) + .addGap(0, 202, Short.MAX_VALUE)) + .addComponent(jScrollPane1)) + .addContainerGap()) + ); + }// //GEN-END:initComponents + + private void selectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectAllButtonActionPerformed + for (FILE_REPORT_INFO option : options) { + optionStates.put(option, Boolean.TRUE); + } + optionsList.repaint(); + selectAllButton.setEnabled(false); + deselectAllButton.setEnabled(true); + wizPanel.setFinish(true); + }//GEN-LAST:event_selectAllButtonActionPerformed + + private void deselectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deselectAllButtonActionPerformed + for (FILE_REPORT_INFO option : options) { + optionStates.put(option, Boolean.FALSE); + } + optionsList.repaint(); + selectAllButton.setEnabled(true); + deselectAllButton.setEnabled(false); + wizPanel.setFinish(false); + }//GEN-LAST:event_deselectAllButtonActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton deselectAllButton; + private javax.swing.JLabel jLabel1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JList optionsList; + private javax.swing.JButton selectAllButton; + // End of variables declaration//GEN-END:variables + + private class OptionsListModel implements ListModel { + + @Override + public int getSize() { + return options.size(); + } + + @Override + public Object getElementAt(int index) { + return options.get(index); + } + + @Override + public void addListDataListener(ListDataListener l) { + } + + @Override + public void removeListDataListener(ListDataListener l) { + } + } + + /** + * Render each item in the list to be a selectable check box. + */ + private class OptionsListRenderer extends JCheckBox implements ListCellRenderer { + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + if (value != null) { + FILE_REPORT_INFO col = (FILE_REPORT_INFO) value; + setEnabled(list.isEnabled()); + setSelected(optionStates.get(col)); + setFont(list.getFont()); + setBackground(list.getBackground()); + setForeground(list.getForeground()); + setText(col.getName()); + return this; + } + return new JLabel(); + } + + } + +} From 9b9e3c6f90bd474c6980d258b31365de5d1dc029 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 1 Oct 2013 13:08:56 -0400 Subject: [PATCH 02/39] Updated configuration wizard to include File Report configuration. --- .../autopsy/report/ReportGenerator.java | 111 +++++++++++++++++- .../autopsy/report/ReportVisualPanel1.java | 42 +++++-- .../autopsy/report/ReportVisualPanel2.form | 18 +-- .../autopsy/report/ReportVisualPanel2.java | 16 +-- .../autopsy/report/ReportWizardAction.java | 5 +- .../autopsy/report/ReportWizardIterator.java | 1 + .../autopsy/report/ReportWizardPanel1.java | 1 + .../autopsy/report/ReportWizardPanel2.java | 11 ++ 8 files changed, 177 insertions(+), 28 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 2d027b0bd8..cb09bd33ff 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -47,6 +47,7 @@ import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.SwingWorker; import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.Logger; @@ -77,13 +78,14 @@ public class ReportGenerator { private Map tableProgress; private Map generalProgress; + private Map fileProgress; private String reportPath; private ReportGenerationPanel panel = new ReportGenerationPanel(); static final String REPORTS_DIR = "Reports"; - ReportGenerator(Map tableModuleStates, Map generalModuleStates) { + ReportGenerator(Map tableModuleStates, Map generalModuleStates, Map fileListModuleStates) { // Create the root reports directory path of the form: /Reports/ / DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss"); Date date = new Date(); @@ -100,7 +102,8 @@ public class ReportGenerator { // Initialize the progress panels generalProgress = new HashMap<>(); tableProgress = new HashMap<>(); - setupProgressPanels(tableModuleStates, generalModuleStates); + fileProgress = new HashMap<>(); + setupProgressPanels(tableModuleStates, generalModuleStates, fileListModuleStates); } /** @@ -109,7 +112,7 @@ public class ReportGenerator { * @param tableModuleStates the enabled/disabled state of each TableReportModule * @param generalModuleStates the enabled/disabled state of each GeneralReportModule */ - private void setupProgressPanels(Map tableModuleStates, Map generalModuleStates) { + private void setupProgressPanels(Map tableModuleStates, Map generalModuleStates, Map fileListModuleStates) { if (null != tableModuleStates) { for (Entry entry : tableModuleStates.entrySet()) { if (entry.getValue()) { @@ -127,6 +130,15 @@ public class ReportGenerator { } } } + + if (null != fileListModuleStates) { + for(Entry entry : fileListModuleStates.entrySet()) { + if (entry.getValue()) { + FileReportModule module = entry.getKey(); + fileProgress.put(module, panel.addReport(module.getName(), reportPath + module.getFilePath())); + } + } + } } /** @@ -183,6 +195,23 @@ public class ReportGenerator { } } + /** + * Generate the FileReportModule reports in a new SwingWorker. + * + * @param enabledInfo the Information that should be included about each file + * in the report. + */ + public void generateFileListReports(Map enabledInfo) { + List enabled = new ArrayList<>(); + for (Entry e : enabledInfo.entrySet()) { + if(e.getValue()) { + enabled.add(e.getKey()); + } + } + FileReportsWorker worker = new FileReportsWorker(enabled); + worker.execute(); + } + /** * SwingWorker to generate a report on all GeneralReportModules. */ @@ -201,6 +230,82 @@ public class ReportGenerator { } + /** + * SwingWorker to generate a FileReport. + */ + private class FileReportsWorker extends SwingWorker { + private List enabledInfo = Arrays.asList(FILE_REPORT_INFO.values()); + private List fileModules = new ArrayList<>(); + + FileReportsWorker(List enabled) { + enabledInfo = enabled; + for (Entry entry : fileProgress.entrySet()) { + fileModules.add(entry.getKey()); + } + } + + @Override + protected Integer doInBackground() throws Exception { + for (FileReportModule module : fileModules) { + ReportProgressPanel progress = fileProgress.get(module); + if (progress.getStatus() != ReportStatus.CANCELED) { + progress.start(); + progress.setIndeterminate(false); + progress.updateStatusLabel("Querying database..."); + } + } + + List files = getFiles(); + int numFiles = files.size(); + for (FileReportModule module : fileModules) { + module.startReport(reportPath); + module.startTable(enabledInfo); + fileProgress.get(module).setMaximumProgress(numFiles); + } + + // Add files to report. + for (AbstractFile file : files) { + // Check to see if any reports have been cancelled. + if (fileModules.isEmpty()) { + break; + } + // Remove cancelled reports, add files to report otherwise. + Iterator iter = fileModules.iterator(); + while (iter.hasNext()) { + FileReportModule module = iter.next(); + ReportProgressPanel progress = fileProgress.get(module); + if (progress.getStatus() == ReportStatus.CANCELED) { + iter.remove(); + } else { + progress.updateStatusLabel("Now processing " + file.getName()); + module.addRow(file, enabledInfo); + progress.increment(); + } + } + } + + for (FileReportModule module : fileModules) { + module.endTable(); + module.endReport(); + fileProgress.get(module).complete(); + } + + return 0; + } + + private List getFiles() { + List absFiles; + try { + SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); + absFiles = skCase.findAllFilesWhere("NOT meta_type = 2"); + return absFiles; + } catch (TskCoreException ex) { + // TODO + return Collections.EMPTY_LIST; + } + } + } + /** * SwingWorker to generate reports on blackboard artifacts. */ diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java index fca94c5202..426ff8e300 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel1.java @@ -39,8 +39,10 @@ public final class ReportVisualPanel1 extends JPanel { private Map tableModuleStates = new LinkedHashMap(); private Map generalModuleStates = new LinkedHashMap(); + private Map fileListModuleStates = new LinkedHashMap(); private List tableModules = new ArrayList(); private List generalModules = new ArrayList(); + private List fileListModules = new ArrayList(); private ModulesTableModel modulesModel; private ModuleSelectionListener modulesListener; @@ -71,6 +73,10 @@ public final class ReportVisualPanel1 extends JPanel { generalModuleStates.put(module, Boolean.FALSE); generalModules.add(module); } + for(FileReportModule module : Lookup.getDefault().lookupAll(FileReportModule.class)) { + fileListModuleStates.put(module, Boolean.FALSE); + fileListModules.add(module); + } modulesModel = new ModulesTableModel(); modulesListener = new ModuleSelectionListener(); @@ -109,7 +115,14 @@ public final class ReportVisualPanel1 extends JPanel { Map getGeneralModuleStates() { return generalModuleStates; } - + + /** + * @return the enabled/disabled states of all FileListReportModules + */ + Map getFileListModuleStates() { + return fileListModuleStates; + } + /** * 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 @@ -204,7 +217,7 @@ public final class ReportVisualPanel1 extends JPanel { @Override public int getRowCount() { - return tableModules.size() + generalModules.size(); + return tableModules.size() + generalModules.size() + fileListModules.size(); } @Override @@ -217,13 +230,17 @@ public final class ReportVisualPanel1 extends JPanel { ReportModule module; if (rowIndex < tableModules.size()) { module = tableModules.get(rowIndex); - } else { + } else if (rowIndex >= tableModules.size() && rowIndex < tableModules.size() + generalModules.size()){ module = generalModules.get(rowIndex - tableModules.size()); + } else { + module = fileListModules.get(rowIndex - tableModules.size() - generalModules.size()); } if (columnIndex == 0 && rowIndex < tableModules.size()) { return tableModuleStates.get(tableModules.get(rowIndex)); - } else if (columnIndex == 0 && rowIndex >= tableModules.size()) { + } else if (columnIndex == 0 && rowIndex >= tableModules.size() && rowIndex < tableModules.size() + generalModules.size()) { return generalModuleStates.get(generalModules.get(rowIndex - tableModules.size())); + } else if (columnIndex == 0 && rowIndex >= tableModules.size() + generalModules.size()) { + return fileListModuleStates.get(fileListModules.get(rowIndex - tableModules.size() - generalModules.size())); } else { return module.getName(); } @@ -238,8 +255,10 @@ public final class ReportVisualPanel1 extends JPanel { public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0 && rowIndex < tableModules.size()) { tableModuleStates.put(tableModules.get(rowIndex), (Boolean) aValue); - } else if (columnIndex == 0 && rowIndex >= tableModules.size()) { + } else if (columnIndex == 0 && rowIndex >= tableModules.size() && rowIndex < tableModules.size() + generalModules.size()) { generalModuleStates.put(generalModules.get(rowIndex - tableModules.size()), (Boolean) aValue); + } else if (columnIndex == 0 && rowIndex >= tableModules.size() + generalModules.size()) { + fileListModuleStates.put(fileListModules.get(rowIndex - tableModules.size() - generalModules.size()), (Boolean) aValue); } // Check if there are any TableReportModules enabled boolean tableModuleEnabled = false; @@ -254,7 +273,13 @@ public final class ReportVisualPanel1 extends JPanel { generalModuleEnabled = true; } } - if(tableModuleEnabled) { + boolean fileListModuleEnabled = false; + for (Entry module : fileListModuleStates.entrySet()) { + if (module.getValue()) { + fileListModuleEnabled = true; + } + } + if(tableModuleEnabled || fileListModuleEnabled) { wizPanel.setNext(true); wizPanel.setFinish(false); } else if(generalModuleEnabled) { @@ -281,13 +306,16 @@ public final class ReportVisualPanel1 extends JPanel { if (rowIndex < tableModules.size()) { configurationPanel.add(new DefaultReportConfigurationPanel(), BorderLayout.CENTER); descriptionTextPane.setText(tableModules.get(rowIndex).getDescription()); - } else { + } else if (rowIndex >= tableModules.size() && rowIndex < tableModules.size() + generalModules.size()) { GeneralReportModule module = generalModules.get(rowIndex - tableModules.size()); JPanel panel = module.getConfigurationPanel(); descriptionTextPane.setText(module.getDescription()); if (panel != null) { configurationPanel.add(panel, BorderLayout.CENTER); } + } else { + configurationPanel.add(new DefaultReportConfigurationPanel(), BorderLayout.CENTER); + descriptionTextPane.setText(fileListModules.get(rowIndex - tableModules.size() - generalModules.size()).getDescription()); } configurationPanel.revalidate(); configurationPanel.repaint(); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.form b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.form index 7acec67ed7..bd00c6e2eb 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.form +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.form @@ -29,23 +29,23 @@ - - - - - - - - - + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java index d77e1438c1..cabaf3db9b 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java @@ -240,19 +240,19 @@ public final class ReportVisualPanel2 extends JPanel { .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(taggedResultsRadioButton) - .addComponent(allResultsRadioButton) - .addComponent(dataLabel)) - .addGap(0, 481, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(21, 21, 21) .addComponent(tagsScrollPane) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(advancedButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(advancedButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE) .addComponent(deselectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addComponent(selectAllButton, 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(taggedResultsRadioButton) + .addComponent(dataLabel) + .addComponent(allResultsRadioButton)) + .addGap(0, 481, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java index 11201aaaed..5ee1efde80 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java @@ -68,8 +68,11 @@ public final class ReportWizardAction extends CallableSystemAction implements P wiz.setTitleFormat(new MessageFormat("{0} {1}")); wiz.setTitle("Generate Report"); if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) { - ReportGenerator generator = new ReportGenerator((Map)wiz.getProperty("tableModuleStates"), (Map)wiz.getProperty("generalModuleStates")); + ReportGenerator generator = new ReportGenerator((Map)wiz.getProperty("tableModuleStates"), + (Map)wiz.getProperty("generalModuleStates"), + (Map)wiz.getProperty("fileListModuleStates")); generator.generateArtifactTableReports((Map)wiz.getProperty("artifactStates"), (Map)wiz.getProperty("tagStates")); + generator.generateFileListReports((Map)wiz.getProperty("fileReportOptions")); generator.generateGeneralReports(); generator.displayProgressPanels(); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java index bdd593559e..766059d8eb 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java @@ -35,6 +35,7 @@ public final class ReportWizardIterator implements WizardDescriptor.Iterator>(); panels.add(new ReportWizardPanel1()); panels.add(new ReportWizardPanel2()); + panels.add(new ReportWizardFileOptionsPanel()); String[] steps = new String[panels.size()]; for (int i = 0; i < panels.size(); i++) { Component c = panels.get(i).getComponent(); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java index 9cc18bad91..f533546e87 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java @@ -104,5 +104,6 @@ public class ReportWizardPanel1 implements WizardDescriptor.FinishablePanel { private ReportVisualPanel2 component; private JButton finishButton; + private JButton nextButton; private WizardDescriptor wiz; ReportWizardPanel2() { finishButton = new JButton("Finish"); finishButton.setEnabled(true); + nextButton = new JButton("Next >"); + nextButton.setEnabled(true); + + nextButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + wiz.doNextClick(); + } + }); + finishButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { From 8002058cd3f7a6e7c592f87575c29ad3f8293139 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 1 Oct 2013 15:06:38 -0400 Subject: [PATCH 03/39] Added guard to not run FileReport if no report modules were selected. --- .../autopsy/report/ReportGenerator.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index cb09bd33ff..38da7534ea 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -202,14 +202,16 @@ public class ReportGenerator { * in the report. */ public void generateFileListReports(Map enabledInfo) { - List enabled = new ArrayList<>(); - for (Entry e : enabledInfo.entrySet()) { - if(e.getValue()) { - enabled.add(e.getKey()); + if (!fileProgress.isEmpty() && null != enabledInfo) { + List enabled = new ArrayList<>(); + for (Entry e : enabledInfo.entrySet()) { + if(e.getValue()) { + enabled.add(e.getKey()); + } } + FileReportsWorker worker = new FileReportsWorker(enabled); + worker.execute(); } - FileReportsWorker worker = new FileReportsWorker(enabled); - worker.execute(); } /** @@ -250,7 +252,6 @@ public class ReportGenerator { ReportProgressPanel progress = fileProgress.get(module); if (progress.getStatus() != ReportStatus.CANCELED) { progress.start(); - progress.setIndeterminate(false); progress.updateStatusLabel("Querying database..."); } } @@ -260,6 +261,7 @@ public class ReportGenerator { for (FileReportModule module : fileModules) { module.startReport(reportPath); module.startTable(enabledInfo); + fileProgress.get(module).setIndeterminate(false); fileProgress.get(module).setMaximumProgress(numFiles); } From 3aa3a82b21b03046302a2b2a22351af43eddef82 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 1 Oct 2013 15:12:59 -0400 Subject: [PATCH 04/39] Added support for dynamic reporting wizard. --- .../autopsy/report/ReportWizardIterator.java | 63 +++++++++++++++++-- .../autopsy/report/ReportWizardPanel1.java | 30 ++++++++- .../autopsy/report/ReportWizardPanel2.java | 11 +++- 3 files changed, 95 insertions(+), 9 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java index 766059d8eb..f4ac4cb67c 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java @@ -19,23 +19,43 @@ package org.sleuthkit.autopsy.report; import java.awt.Component; -import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.NoSuchElementException; import javax.swing.JComponent; import javax.swing.event.ChangeListener; import org.openide.WizardDescriptor; +import org.openide.util.NbPreferences; public final class ReportWizardIterator implements WizardDescriptor.Iterator { private int index; + + private ReportWizardPanel1 firstPanel; + private ReportWizardPanel2 tableConfigPanel; + private ReportWizardFileOptionsPanel fileConfigPanel; + private List> panels; + + private WizardDescriptor.Panel[] allConfigPanels; + private String[] allConfigIndex; + private WizardDescriptor.Panel[] tableConfigPanels; + private String[] tableConfigIndex; + private WizardDescriptor.Panel[] fileConfigPanels; + private String[] fileConfigIndex; + + ReportWizardIterator() { + firstPanel = new ReportWizardPanel1(); + tableConfigPanel = new ReportWizardPanel2(); + fileConfigPanel = new ReportWizardFileOptionsPanel(); + + allConfigPanels = new WizardDescriptor.Panel[]{firstPanel, tableConfigPanel, fileConfigPanel}; + tableConfigPanels = new WizardDescriptor.Panel[]{firstPanel, tableConfigPanel}; + fileConfigPanels = new WizardDescriptor.Panel[]{firstPanel, fileConfigPanel}; + } private List> getPanels() { if (panels == null) { - panels = new ArrayList>(); - panels.add(new ReportWizardPanel1()); - panels.add(new ReportWizardPanel2()); - panels.add(new ReportWizardFileOptionsPanel()); + panels = Arrays.asList(allConfigPanels); String[] steps = new String[panels.size()]; for (int i = 0; i < panels.size(); i++) { Component c = panels.get(i).getComponent(); @@ -50,9 +70,32 @@ public final class ReportWizardIterator implements WizardDescriptor.Iterator current() { @@ -79,6 +122,16 @@ public final class ReportWizardIterator implements WizardDescriptor.Iterator { private WizardDescriptor wiz; @@ -102,8 +106,30 @@ public class ReportWizardPanel1 implements WizardDescriptor.FinishablePanel tables = getComponent().getTableModuleStates(); + Map files = getComponent().getFileListModuleStates(); + wiz.putProperty("tableModuleStates", tables); wiz.putProperty("generalModuleStates", getComponent().getGeneralModuleStates()); - wiz.putProperty("fileListModuleStates", getComponent().getFileListModuleStates()); + wiz.putProperty("fileListModuleStates", files); + + // Store preferences that WizardIterator will use to determine what + // panels need to be shown + Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class); + prefs.putBoolean("tableConfig", any(tables.values())); + prefs.putBoolean("fileConfig", any(files.values())); + } + + /** + * Are any of the given booleans true? + * @param bools + * @return + */ + private boolean any(Collection bools) { + for (Boolean b : bools) { + if (b) { + return true; + } + } + return false; } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java index 7eefd77bf5..346ae627c1 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java @@ -24,6 +24,7 @@ import javax.swing.JButton; import javax.swing.event.ChangeListener; import org.openide.WizardDescriptor; import org.openide.util.HelpCtx; +import org.openide.util.NbPreferences; public class ReportWizardPanel2 implements WizardDescriptor.Panel { private ReportVisualPanel2 component; @@ -33,7 +34,7 @@ public class ReportWizardPanel2 implements WizardDescriptor.Panel"); nextButton.setEnabled(true); @@ -80,14 +81,20 @@ public class ReportWizardPanel2 implements WizardDescriptor.Panel Date: Tue, 1 Oct 2013 15:13:42 -0400 Subject: [PATCH 05/39] Registered new Reporting module in layer.xml. Added resource strings to Bundle.properties. --- Core/src/org/sleuthkit/autopsy/core/layer.xml | 7 ++++++- .../src/org/sleuthkit/autopsy/report/Bundle.properties | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index f43b8285d6..54bec76816 100644 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -310,6 +310,11 @@ + + + + + - + @@ -183,10 +183,17 @@ + + + + + + + - + From a713b75db77a0a23ac4fa38f703e164d927ea536 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 15 Oct 2013 15:49:09 -0400 Subject: [PATCH 33/39] Fixed ant error. --- build-windows.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-windows.xml b/build-windows.xml index af2dc259ef..91e67fe68c 100644 --- a/build-windows.xml +++ b/build-windows.xml @@ -186,8 +186,7 @@ - - + From decd0840de4649bdd4c4e29bd65c6663ed204831 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 15 Oct 2013 16:24:00 -0400 Subject: [PATCH 34/39] Fixed ant error. --- build-windows.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-windows.xml b/build-windows.xml index 91e67fe68c..bdcfdec3ab 100644 --- a/build-windows.xml +++ b/build-windows.xml @@ -183,10 +183,11 @@ - + - + + From e7a3b496f7433299167d853468325385ddfdc449 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Tue, 15 Oct 2013 17:01:18 -0400 Subject: [PATCH 35/39] Fixed discrepancy between fileReportPath and actual file name for file reports. --- Core/src/org/sleuthkit/autopsy/report/FileReportText.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java index 856bdfb90b..05192e6910 100755 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java @@ -39,6 +39,7 @@ public class FileReportText implements FileReportModule { private static final Logger logger = Logger.getLogger(FileReportText.class.getName()); private String reportPath; private Writer out; + private static final String FILE_NAME = "file-report.txt"; private static FileReportText instance; @@ -52,7 +53,7 @@ public class FileReportText implements FileReportModule { @Override public void startReport(String path) { - this.reportPath = path + "report.txt"; + this.reportPath = path + FILE_NAME; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.reportPath))); } catch (IOException ex) { @@ -132,6 +133,6 @@ public class FileReportText implements FileReportModule { @Override public String getFilePath() { - return "file-report.txt"; + return FILE_NAME; } } From ee3578fa0a68b5c13a553b5aff32210c18457af5 Mon Sep 17 00:00:00 2001 From: df-test-runner Date: Tue, 15 Oct 2013 18:57:41 -0400 Subject: [PATCH 36/39] fixed ant error. --- build-windows.xml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/build-windows.xml b/build-windows.xml index bdcfdec3ab..0e084d2572 100644 --- a/build-windows.xml +++ b/build-windows.xml @@ -84,6 +84,14 @@ + + + + + + + + @@ -92,7 +100,7 @@ - + @@ -102,6 +110,14 @@ + + + + + + + + @@ -111,7 +127,7 @@ - + @@ -182,20 +198,14 @@ - - - - - - - - + From 72add0128adf50e6174f99ed73311e5b93e7d789 Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Wed, 16 Oct 2013 08:26:05 -0400 Subject: [PATCH 37/39] Removed dead code. --- build-windows.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/build-windows.xml b/build-windows.xml index 0e084d2572..09795298a4 100644 --- a/build-windows.xml +++ b/build-windows.xml @@ -197,15 +197,6 @@ - - From 2a6363757105752d3a30058c486483c77e14dd60 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Wed, 16 Oct 2013 09:23:52 -0400 Subject: [PATCH 38/39] Updated NEWS and version --- NEWS.txt | 4 ++++ nbproject/project.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.txt b/NEWS.txt index 0fd41075bf..cbcfd8338c 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,7 @@ +---------------- VERSION 3.0.8 -------------- +Bug Fixes: +- Fixed installer bug on Windows. No other code changes. + ---------------- VERSION 3.0.7 -------------- New features: diff --git a/nbproject/project.properties b/nbproject/project.properties index e70fffba4b..6446b47619 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -4,7 +4,7 @@ app.title=Autopsy ### lowercase version of above app.name=autopsy ### if left unset, version will default to today's date -app.version=3.0.7 +app.version=3.0.8 ### Build type isn't used at this point, but it may be useful ### Must be one of: DEVELOPMENT, RELEASE build.type=RELEASE From 214bd028c886a01586451131fbfa3c66e6782d4c Mon Sep 17 00:00:00 2001 From: Jeff Wallace Date: Wed, 16 Oct 2013 10:37:48 -0400 Subject: [PATCH 39/39] Added additional data types. --- .../autopsy/report/FileReportDataTypes.java | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java b/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java index d9e74474b9..8cc0b63049 100755 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.report; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; +import org.sleuthkit.datamodel.TskData; /** * Represents Column Headers for FileList Reports. @@ -44,6 +45,21 @@ public enum FileReportDataTypes { return (extIndex == -1 ? "" : name.substring(extIndex)); } }, + FILE_TYPE("File Type") { + @Override + public String getValue(AbstractFile file) { + return file.getMetaTypeAsString(); + } + }, + DELETED("Is Deleted") { + @Override + public String getValue(AbstractFile file) { + if (file.getMetaFlagsAsString().equals(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC.toString())) { + return "yes"; + } + return ""; + } + }, A_TIME("Last Accessed") { @Override public String getValue(AbstractFile file) { @@ -68,12 +84,30 @@ public enum FileReportDataTypes { return String.valueOf(file.getSize()); } }, + ADDRESS("Address") { + @Override + public String getValue(AbstractFile file) { + return String.valueOf(file.getMetaAddr()); + } + }, HASH_VALUE("Hash Value") { @Override public String getValue(AbstractFile file) { return file.getMd5Hash(); } }, + KNOWN_STATUS("Known Status") { + @Override + public String getValue(AbstractFile file) { + return file.getKnown().getName(); + } + }, + PERMISSIONS("Permissions") { + @Override + public String getValue(AbstractFile file) { + return file.getModesAsString(); + } + }, FULL_PATH("Full Path") { @Override public String getValue(AbstractFile file) { @@ -83,18 +117,6 @@ public enum FileReportDataTypes { return ""; } } - }, - PERMISSIONS("Permissions") { - @Override - public String getValue(AbstractFile file) { - return file.getModesAsString(); - } - }, - ADDRESS("Address") { - @Override - public String getValue(AbstractFile file) { - return String.valueOf(file.getMetaAddr()); - } }; private String name;