From a9884f3eff5b2efafd53414c0fabb9c603be056d Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Thu, 22 Feb 2018 16:55:08 -0500 Subject: [PATCH 1/4] Initial changes. --- .../autopsy/casemodule/Bundle.properties | 1 + .../casemodule/LocalDiskDSProcessor.java | 36 +++++++++++-- .../autopsy/casemodule/LocalDiskPanel.form | 35 +++++++++++-- .../autopsy/casemodule/LocalDiskPanel.java | 51 +++++++++++++++++-- 4 files changed, 112 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index ea7e5f9b27..75a976efa4 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -232,3 +232,4 @@ MultiUserCasesPanel.searchLabel.text=Select any case and start typing to search MultiUserCasesPanel.cancelButton.text=Cancel ImageFilePanel.pathErrorLabel.text=Error Label ImageFilePanel.sectorSizeLabel.text=Sector size: +LocalDiskPanel.sectorSizeLabel.text=Sector Size: diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java index 169c3d0f00..1df465e02a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskDSProcessor.java @@ -54,6 +54,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData */ private String deviceId; private String drivePath; + private int sectorSize; private String timeZone; private ImageWriterSettings imageWriterSettings; private boolean ignoreFatOrphanFiles; @@ -137,6 +138,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData if (!setDataSourceOptionsCalled) { deviceId = UUID.randomUUID().toString(); drivePath = configPanel.getContentPaths(); + sectorSize = configPanel.getSectorSize(); timeZone = configPanel.getTimeZone(); ignoreFatOrphanFiles = configPanel.getNoFatOrphans(); if (configPanel.getImageWriterEnabled()) { @@ -145,7 +147,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData imageWriterSettings = null; } } - addDiskTask = new AddImageTask(deviceId, drivePath, 0, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback); + addDiskTask = new AddImageTask(deviceId, drivePath, sectorSize, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback); new Thread(addDiskTask).start(); } @@ -171,7 +173,33 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData * @param callback Callback to call when processing is done. */ public void run(String deviceId, String drivePath, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { - addDiskTask = new AddImageTask(deviceId, drivePath, 0, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback); + run(deviceId, drivePath, 0, timeZone, ignoreFatOrphanFiles, progressMonitor, callback); + } + + /** + * Adds a data source to the case database using a background task in a + * separate thread and the given settings instead of those provided by the + * selection and configuration panel. Returns as soon as the background task + * is started and uses the callback object to signal task completion and + * return results. + * + * @param deviceId An ASCII-printable identifier for the device + * associated with the data source that is + * intended to be unique across multiple cases + * (e.g., a UUID). + * @param drivePath Path to the local drive. + * @param sectorSize The sector size (use '0' for autodetect). + * @param timeZone The time zone to use when processing dates + * and times for the image, obtained from + * java.util.TimeZone.getID. + * @param ignoreFatOrphanFiles Whether to parse orphans if the image has a + * FAT filesystem. + * @param progressMonitor Progress monitor for reporting progress + * during processing. + * @param callback Callback to call when processing is done. + */ + private void run(String deviceId, String drivePath, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) { + addDiskTask = new AddImageTask(deviceId, drivePath, sectorSize, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback); new Thread(addDiskTask).start(); } @@ -227,10 +255,11 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData public void process(String deviceId, Path dataSourcePath, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) throws AutoIngestDataSourceProcessorException { this.deviceId = deviceId; this.drivePath = dataSourcePath.toString(); + this.sectorSize = 0; this.timeZone = Calendar.getInstance().getTimeZone().getID(); this.ignoreFatOrphanFiles = false; setDataSourceOptionsCalled = true; - run(deviceId, drivePath, timeZone, ignoreFatOrphanFiles, progressMonitor, callBack); + run(deviceId, drivePath, sectorSize, timeZone, ignoreFatOrphanFiles, progressMonitor, callBack); } /** @@ -250,6 +279,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData public void setDataSourceOptions(String drivePath, String timeZone, boolean ignoreFatOrphanFiles) { this.deviceId = UUID.randomUUID().toString(); this.drivePath = drivePath; + this.sectorSize = 0; this.timeZone = Calendar.getInstance().getTimeZone().getID(); this.ignoreFatOrphanFiles = ignoreFatOrphanFiles; setDataSourceOptionsCalled = true; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form index 09239fe001..2daa15c1c6 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form @@ -46,9 +46,9 @@ - + @@ -64,7 +64,7 @@ - + @@ -79,6 +79,13 @@ + + + + + + + @@ -113,7 +120,12 @@ - + + + + + + @@ -286,5 +298,22 @@ + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index 15abfcf441..8f25b57b55 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -51,6 +51,7 @@ import org.sleuthkit.autopsy.imagewriter.ImageWriterSettings; final class LocalDiskPanel extends JPanel { private static final Logger logger = Logger.getLogger(LocalDiskPanel.class.getName()); + private static final String[] SECTOR_SIZE_CHOICES = {"Auto Detect", "512", "1024", "2048", "4096"}; private static LocalDiskPanel instance; private static final long serialVersionUID = 1L; private List disks; @@ -68,6 +69,7 @@ final class LocalDiskPanel extends JPanel { initComponents(); customInit(); createTimeZoneList(); + createSectorSizeList(); refreshTable(); diskTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override @@ -148,6 +150,8 @@ final class LocalDiskPanel extends JPanel { imageWriterErrorLabel = new javax.swing.JLabel(); changeDatabasePathCheckbox = new javax.swing.JCheckBox(); refreshTablebutton = new javax.swing.JButton(); + sectorSizeLabel = new javax.swing.JLabel(); + sectorSizeComboBox = new javax.swing.JComboBox<>(); setMinimumSize(new java.awt.Dimension(0, 420)); setPreferredSize(new java.awt.Dimension(485, 410)); @@ -212,6 +216,8 @@ final class LocalDiskPanel extends JPanel { } }); + org.openide.awt.Mnemonics.setLocalizedText(sectorSizeLabel, org.openide.util.NbBundle.getMessage(LocalDiskPanel.class, "LocalDiskPanel.sectorSizeLabel.text")); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -236,16 +242,16 @@ final class LocalDiskPanel extends JPanel { .addComponent(browseButton, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(imageWriterErrorLabel) .addComponent(jLabel1) - .addComponent(changeDatabasePathCheckbox)) + .addComponent(changeDatabasePathCheckbox) + .addComponent(imageWriterErrorLabel)) .addGap(0, 0, Short.MAX_VALUE))))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(timeZoneLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(timeZoneComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 475, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(refreshTablebutton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -255,6 +261,12 @@ final class LocalDiskPanel extends JPanel { .addComponent(errorLabel)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(sectorSizeLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -286,7 +298,11 @@ final class LocalDiskPanel extends JPanel { .addComponent(imageWriterErrorLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(errorLabel) - .addContainerGap(58, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(sectorSizeLabel) + .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(27, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -335,6 +351,8 @@ final class LocalDiskPanel extends JPanel { private javax.swing.JCheckBox noFatOrphansCheckbox; private javax.swing.JTextField pathTextField; private javax.swing.JButton refreshTablebutton; + private javax.swing.JComboBox sectorSizeComboBox; + private javax.swing.JLabel sectorSizeLabel; private javax.swing.JComboBox timeZoneComboBox; private javax.swing.JLabel timeZoneLabel; // End of variables declaration//GEN-END:variables @@ -364,6 +382,19 @@ final class LocalDiskPanel extends JPanel { return ""; } } + + /** + * //DLG: + */ + int getSectorSize() { + int sectorSizeSelectionIndex = sectorSizeComboBox.getSelectedIndex(); + + if (sectorSizeSelectionIndex == 0) { + return 0; + } + + return Integer.valueOf((String) sectorSizeComboBox.getSelectedItem()); + } String getTimeZone() { String tz = timeZoneComboBox.getSelectedItem().toString(); @@ -499,6 +530,16 @@ final class LocalDiskPanel extends JPanel { timeZoneComboBox.setSelectedItem(formatted); } + + /** + * //DLG: + */ + private void createSectorSizeList() { + for (String choice : SECTOR_SIZE_CHOICES) { + sectorSizeComboBox.addItem(choice); + } + sectorSizeComboBox.setSelectedIndex(0); + } /** * Table model for displaing information from LocalDisk Objects in a table. From 96aa6ff76f4b1d7832996df69609375604b5e541 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Fri, 23 Feb 2018 10:13:57 -0500 Subject: [PATCH 2/4] Block size selection fully implemented. --- .../autopsy/casemodule/AddImageTask.java | 1 + .../autopsy/casemodule/Bundle.properties | 1 + .../autopsy/casemodule/LocalDiskPanel.form | 83 ++++++++++--------- .../autopsy/casemodule/LocalDiskPanel.java | 77 ++++++++--------- 4 files changed, 85 insertions(+), 77 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index c18b2d225c..f6458e6dd0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -129,6 +129,7 @@ class AddImageTask implements Runnable { Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); + progressUpdateThread.interrupt(); commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 75a976efa4..1a49a107f4 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -233,3 +233,4 @@ MultiUserCasesPanel.cancelButton.text=Cancel ImageFilePanel.pathErrorLabel.text=Error Label ImageFilePanel.sectorSizeLabel.text=Sector size: LocalDiskPanel.sectorSizeLabel.text=Sector Size: +LocalDiskPanel.refreshTableButton.text=Refresh Local Disks diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form index 2daa15c1c6..27eeff284d 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form @@ -26,25 +26,23 @@ + - + + - - - - - + - + - + @@ -54,38 +52,45 @@ + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - - - - - - - - - - - - - - - - - - @@ -95,7 +100,7 @@ - + @@ -105,7 +110,12 @@ - + + + + + + @@ -120,12 +130,7 @@ - - - - - - + @@ -288,14 +293,14 @@ - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index 8f25b57b55..ef86a77bfa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -42,8 +42,6 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.imagewriter.ImageWriterSettings; -@NbBundle.Messages({"LocalDiskPanel.refreshTablebutton.text=Refresh Local Disks" -}) /** * ImageTypePanel for adding a local disk or partition such as PhysicalDrive0 or * C:. @@ -149,7 +147,7 @@ final class LocalDiskPanel extends JPanel { jLabel1 = new javax.swing.JLabel(); imageWriterErrorLabel = new javax.swing.JLabel(); changeDatabasePathCheckbox = new javax.swing.JCheckBox(); - refreshTablebutton = new javax.swing.JButton(); + refreshTableButton = new javax.swing.JButton(); sectorSizeLabel = new javax.swing.JLabel(); sectorSizeComboBox = new javax.swing.JComboBox<>(); @@ -209,10 +207,10 @@ final class LocalDiskPanel extends JPanel { org.openide.awt.Mnemonics.setLocalizedText(changeDatabasePathCheckbox, org.openide.util.NbBundle.getMessage(LocalDiskPanel.class, "LocalDiskPanel.changeDatabasePathCheckbox.text")); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(refreshTablebutton, org.openide.util.NbBundle.getMessage(LocalDiskPanel.class, "LocalDiskPanel.refreshTablebutton.text")); // NOI18N - refreshTablebutton.addActionListener(new java.awt.event.ActionListener() { + org.openide.awt.Mnemonics.setLocalizedText(refreshTableButton, org.openide.util.NbBundle.getMessage(LocalDiskPanel.class, "LocalDiskPanel.refreshTableButton.text")); // NOI18N + refreshTableButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - refreshTablebuttonActionPerformed(evt); + refreshTableButtonActionPerformed(evt); } }); @@ -224,15 +222,14 @@ final class LocalDiskPanel extends JPanel { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(diskLabel) .addGroup(layout.createSequentialGroup() + .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(noFatOrphansCheckbox) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(copyImageCheckbox) - .addComponent(descLabel)) + .addComponent(copyImageCheckbox) .addGroup(layout.createSequentialGroup() .addGap(21, 21, 21) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) @@ -245,28 +242,32 @@ final class LocalDiskPanel extends JPanel { .addComponent(jLabel1) .addComponent(changeDatabasePathCheckbox) .addComponent(imageWriterErrorLabel)) - .addGap(0, 0, Short.MAX_VALUE))))) + .addGap(0, 0, Short.MAX_VALUE)))) + .addComponent(errorLabel) + .addGroup(layout.createSequentialGroup() + .addComponent(sectorSizeLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(21, 21, 21) + .addComponent(descLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 182, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(noFatOrphansCheckbox) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(timeZoneLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(timeZoneComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 475, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(refreshTablebutton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(diskLabel) - .addComponent(errorLabel)) - .addGap(0, 0, Short.MAX_VALUE))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(timeZoneComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(refreshTableButton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))))))) .addContainerGap()) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(sectorSizeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -275,7 +276,7 @@ final class LocalDiskPanel extends JPanel { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(refreshTablebutton) + .addComponent(refreshTableButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(timeZoneLabel) @@ -284,7 +285,11 @@ final class LocalDiskPanel extends JPanel { .addComponent(noFatOrphansCheckbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(descLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(sectorSizeLabel) + .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) .addComponent(copyImageCheckbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) @@ -298,11 +303,7 @@ final class LocalDiskPanel extends JPanel { .addComponent(imageWriterErrorLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(errorLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(sectorSizeLabel) - .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(27, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -333,9 +334,9 @@ final class LocalDiskPanel extends JPanel { fireUpdateEvent(); }//GEN-LAST:event_browseButtonActionPerformed - private void refreshTablebuttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshTablebuttonActionPerformed + private void refreshTableButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshTableButtonActionPerformed refreshTable(); - }//GEN-LAST:event_refreshTablebuttonActionPerformed + }//GEN-LAST:event_refreshTableButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton browseButton; @@ -350,7 +351,7 @@ final class LocalDiskPanel extends JPanel { private javax.swing.JScrollPane jScrollPane1; private javax.swing.JCheckBox noFatOrphansCheckbox; private javax.swing.JTextField pathTextField; - private javax.swing.JButton refreshTablebutton; + private javax.swing.JButton refreshTableButton; private javax.swing.JComboBox sectorSizeComboBox; private javax.swing.JLabel sectorSizeLabel; private javax.swing.JComboBox timeZoneComboBox; From 739d7cbb579bcd94726bd3b083e8614039ca28c5 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Fri, 23 Feb 2018 12:06:07 -0500 Subject: [PATCH 3/4] Minor tweaks. --- .../autopsy/casemodule/LocalDiskPanel.form | 85 ++++++++----------- .../autopsy/casemodule/LocalDiskPanel.java | 78 ++++++++--------- 2 files changed, 73 insertions(+), 90 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form index 27eeff284d..afdc00e125 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form @@ -26,32 +26,21 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - @@ -59,32 +48,32 @@ + - - - - - - - + - - + + + - + - - - - - - + + + + + + + + + + @@ -97,7 +86,7 @@ - + @@ -106,23 +95,23 @@ - + - + - + - - - + + + - + @@ -130,7 +119,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index ef86a77bfa..d4e7201592 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -222,58 +222,52 @@ final class LocalDiskPanel extends JPanel { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(diskLabel) - .addGroup(layout.createSequentialGroup() - .addContainerGap() + .addComponent(diskLabel) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(refreshTableButton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(copyImageCheckbox) - .addGroup(layout.createSequentialGroup() - .addGap(21, 21, 21) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(browseButton, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(changeDatabasePathCheckbox) - .addComponent(imageWriterErrorLabel)) - .addGap(0, 0, Short.MAX_VALUE)))) .addComponent(errorLabel) .addGroup(layout.createSequentialGroup() .addComponent(sectorSizeLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))))) - .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() + .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGap(21, 21, 21) - .addComponent(descLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 182, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() + .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(browseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(noFatOrphansCheckbox) .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(timeZoneLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(timeZoneComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(refreshTableButton, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))))))) + .addComponent(timeZoneComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addGap(21, 21, 21) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(changeDatabasePathCheckbox, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(imageWriterErrorLabel, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(descLabel, javax.swing.GroupLayout.Alignment.LEADING)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(diskLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(1, 1, 1) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshTableButton) @@ -281,21 +275,21 @@ final class LocalDiskPanel extends JPanel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(timeZoneLabel) .addComponent(timeZoneComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(noFatOrphansCheckbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(descLabel) - .addGap(18, 18, 18) + .addGap(10, 10, 10) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(sectorSizeLabel) .addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(copyImageCheckbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(browseButton) - .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(browseButton)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(changeDatabasePathCheckbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1) @@ -303,7 +297,7 @@ final class LocalDiskPanel extends JPanel { .addComponent(imageWriterErrorLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(errorLabel) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(43, Short.MAX_VALUE)) ); }// //GEN-END:initComponents From 89bf08c1d12bd6269556166083d95cfa59b65ec9 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Fri, 23 Feb 2018 13:31:20 -0500 Subject: [PATCH 4/4] Cleanup. --- .../autopsy/casemodule/LocalDiskPanel.form | 42 +++++++++---------- .../autopsy/casemodule/LocalDiskPanel.java | 21 ++++++---- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form index afdc00e125..b2f822bac9 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.form @@ -38,28 +38,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -73,7 +51,25 @@ - + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index d4e7201592..bad8a9bd0f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -115,7 +115,7 @@ final class LocalDiskPanel extends JPanel { diskTable.setEnabled(false); imageWriterErrorLabel.setVisible(false); imageWriterErrorLabel.setText(""); - if(! PlatformUtil.isWindowsOS()){ + if (!PlatformUtil.isWindowsOS()) { copyImageCheckbox.setSelected(false); copyImageCheckbox.setEnabled(false); } @@ -377,17 +377,19 @@ final class LocalDiskPanel extends JPanel { return ""; } } - + /** - * //DLG: + * Get the sector size. + * + * @return 0 if autodetect; otherwise the value selected. */ int getSectorSize() { int sectorSizeSelectionIndex = sectorSizeComboBox.getSelectedIndex(); - + if (sectorSizeSelectionIndex == 0) { return 0; } - + return Integer.valueOf((String) sectorSizeComboBox.getSelectedItem()); } @@ -490,8 +492,8 @@ final class LocalDiskPanel extends JPanel { } /** - * Creates the drop down list for the time zones and then makes the local - * machine time zone to be selected. + * Creates the drop down list for the time zones and defaults the selection + * to the local machine time zone. */ public void createTimeZoneList() { // load and add all timezone @@ -525,9 +527,10 @@ final class LocalDiskPanel extends JPanel { timeZoneComboBox.setSelectedItem(formatted); } - + /** - * //DLG: + * Creates the drop down list for the sector size and defaults the selection + * to "Auto Detect". */ private void createSectorSizeList() { for (String choice : SECTOR_SIZE_CHOICES) {