From 8e186293392fe13a330a514553eb48d50de8646c Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 10 Nov 2020 15:14:05 -0500 Subject: [PATCH 1/4] show NA for some fields --- .../ui/Bundle.properties-MERGED | 1 + .../datasourcesummary/ui/ContainerPanel.java | 50 ++++++++++++++----- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED index f03f55df38..173fbf513d 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED @@ -3,6 +3,7 @@ AnalysisPanel_keyColumn_title=Name AnalysisPanel_keywordSearchModuleName=Keyword Search # {0} - module name BaseDataSourceSummaryPanel_defaultNotIngestMessage=The {0} ingest module has not been run on this data source. +ContainerPanel_setFieldsForNonImageDataSource_na=N/A CTL_DataSourceSummaryAction=Data Source Summary DataSourceSummaryDialog.closeButton.text=Close ContainerPanel.displayNameLabel.text=Display Name: diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java index a852a0b886..5977ad525f 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java @@ -26,6 +26,7 @@ import java.util.Set; import java.util.logging.Level; import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.table.DefaultTableModel; +import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.datasourcesummary.datamodel.ContainerSummary; import org.sleuthkit.autopsy.datasourcesummary.uiutils.DataFetchResult.ResultType; @@ -34,6 +35,7 @@ import org.sleuthkit.autopsy.datasourcesummary.uiutils.DefaultUpdateGovernor; import org.sleuthkit.autopsy.datasourcesummary.uiutils.UpdateGovernor; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.Image; +import org.sleuthkit.datamodel.LocalFilesDataSource; import org.sleuthkit.datamodel.TskCoreException; /** @@ -52,7 +54,7 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { /** * Main constructor. * - * @param dataSource The original datasource. + * @param dataSource The original datasource. * @param unallocatedFilesSize The unallocated file size. */ ContainerPanelData(DataSource dataSource, Long unallocatedFilesSize) { @@ -165,42 +167,66 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { private void updateDetailsPanelData(DataSource selectedDataSource, Long unallocatedFilesSize) { clearTableValues(); if (selectedDataSource != null) { - unallocatedSizeValue.setText(SizeRepresentationUtil.getSizeString(unallocatedFilesSize)); - timeZoneValue.setText(selectedDataSource.getTimeZone()); displayNameValue.setText(selectedDataSource.getName()); originalNameValue.setText(selectedDataSource.getName()); deviceIdValue.setText(selectedDataSource.getDeviceId()); - try { - acquisitionDetailsTextArea.setText(selectedDataSource.getAcquisitionDetails()); - } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Unable to get aquisition details for selected data source", ex); - } - if (selectedDataSource instanceof Image) { - setFieldsForImage((Image) selectedDataSource); + setFieldsForImage((Image) selectedDataSource, unallocatedFilesSize); + } else { + setFieldsForNonImageDataSource(); } } - + this.repaint(); } + + @Messages({ + "ContainerPanel_setFieldsForNonImageDataSource_na=N/A" + }) + private void setFieldsForNonImageDataSource() { + String NA = Bundle.ContainerPanel_setFieldsForNonImageDataSource_na(); + + unallocatedSizeValue.setText(NA); + imageTypeValue.setText(NA); + sizeValue.setText(NA); + sectorSizeValue.setText(NA); + timeZoneValue.setText(NA); + + ((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{NA}); + + acquisitionDetailsTextArea.setText(NA); + md5HashValue.setText(NA); + sha1HashValue.setText(NA); + sha256HashValue.setText(NA); + } + /** * Sets text fields for an image. This should be called after * clearTableValues and before updateFieldVisibility to ensure the proper * rendering. * * @param selectedImage The selected image. + * @param unallocatedFilesSize Unallocated file size in bytes. */ - private void setFieldsForImage(Image selectedImage) { + private void setFieldsForImage(Image selectedImage, Long unallocatedFilesSize) { + unallocatedSizeValue.setText(SizeRepresentationUtil.getSizeString(unallocatedFilesSize)); imageTypeValue.setText(selectedImage.getType().getName()); sizeValue.setText(SizeRepresentationUtil.getSizeString(selectedImage.getSize())); sectorSizeValue.setText(SizeRepresentationUtil.getSizeString(selectedImage.getSsize())); + timeZoneValue.setText(selectedImage.getTimeZone()); for (String path : selectedImage.getPaths()) { ((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{path}); } + try { + acquisitionDetailsTextArea.setText(selectedImage.getAcquisitionDetails()); + } catch (TskCoreException ex) { + logger.log(Level.WARNING, "Unable to get aquisition details for selected data source", ex); + } + try { //older databases may have null as the hash values String md5String = selectedImage.getMd5(); From a90529aa4c1f43b732bab2bfa4487d7cc70ae056 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 10 Nov 2020 15:18:12 -0500 Subject: [PATCH 2/4] dependency cleanup --- .../sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java index 5977ad525f..f69f2793a3 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java @@ -35,7 +35,6 @@ import org.sleuthkit.autopsy.datasourcesummary.uiutils.DefaultUpdateGovernor; import org.sleuthkit.autopsy.datasourcesummary.uiutils.UpdateGovernor; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.Image; -import org.sleuthkit.datamodel.LocalFilesDataSource; import org.sleuthkit.datamodel.TskCoreException; /** From e0ce0e44a71488ac7779d9e68ccb10157629b40e Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 10 Nov 2020 15:37:17 -0500 Subject: [PATCH 3/4] always show acquisition details --- .../datasourcesummary/ui/ContainerPanel.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java index f69f2793a3..eda979132f 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java @@ -170,6 +170,12 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { originalNameValue.setText(selectedDataSource.getName()); deviceIdValue.setText(selectedDataSource.getDeviceId()); + try { + acquisitionDetailsTextArea.setText(selectedDataSource.getAcquisitionDetails()); + } catch (TskCoreException ex) { + logger.log(Level.WARNING, "Unable to get aquisition details for selected data source", ex); + } + if (selectedDataSource instanceof Image) { setFieldsForImage((Image) selectedDataSource, unallocatedFilesSize); } else { @@ -180,22 +186,20 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { this.repaint(); } - @Messages({ "ContainerPanel_setFieldsForNonImageDataSource_na=N/A" }) private void setFieldsForNonImageDataSource() { String NA = Bundle.ContainerPanel_setFieldsForNonImageDataSource_na(); - + unallocatedSizeValue.setText(NA); imageTypeValue.setText(NA); sizeValue.setText(NA); sectorSizeValue.setText(NA); timeZoneValue.setText(NA); - + ((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{NA}); - - acquisitionDetailsTextArea.setText(NA); + md5HashValue.setText(NA); sha1HashValue.setText(NA); sha256HashValue.setText(NA); @@ -220,12 +224,6 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { ((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{path}); } - try { - acquisitionDetailsTextArea.setText(selectedImage.getAcquisitionDetails()); - } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Unable to get aquisition details for selected data source", ex); - } - try { //older databases may have null as the hash values String md5String = selectedImage.getMd5(); From 30cd7d35acd13fc1c7521c52a096527be5501363 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 10 Nov 2020 15:38:20 -0500 Subject: [PATCH 4/4] formatting --- .../sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java index eda979132f..bc331d952b 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java @@ -175,7 +175,7 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { } catch (TskCoreException ex) { logger.log(Level.WARNING, "Unable to get aquisition details for selected data source", ex); } - + if (selectedDataSource instanceof Image) { setFieldsForImage((Image) selectedDataSource, unallocatedFilesSize); } else {