From c221ea08c0e41c76ff29deac3583b5731f2a07a3 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 16 Oct 2015 16:25:31 -0400 Subject: [PATCH 01/16] better error messages when unable to create or open remote database --- .../autopsy/casemodule/Bundle.properties | 2 + .../sleuthkit/autopsy/casemodule/Case.java | 44 +++++++++++----- .../autopsy/casemodule/CaseOpenAction.java | 10 ++-- .../casemodule/NewCaseWizardAction.java | 52 ++++++++++++++----- .../casemodule/OpenRecentCasePanel.java | 11 +++- .../autopsy/casemodule/RecentItems.java | 9 +++- 6 files changed, 95 insertions(+), 33 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index cfcb914c4d..b09ffbed54 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -260,3 +260,5 @@ NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user NewCaseVisualPanel1.multiUserSettingsWarningLabel.text=Multi-user settings warning label Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} +CaseOpenException.DatabaseSettingsIssue=Database settings: +CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index a4e477fada..f1cc6fd34a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.casemodule; +import java.awt.Cursor; import java.awt.Frame; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; @@ -321,6 +322,9 @@ public class Case implements SleuthkitCase.ErrorObserver { Case oldCase = Case.currentCase; Case.currentCase = null; if (oldCase != null) { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); doCaseChange(null); //closes windows, etc if (null != oldCase.tskErrorReporter) { oldCase.tskErrorReporter.shutdown(); // stop listening for TSK errors for the old case @@ -344,7 +348,7 @@ public class Case implements SleuthkitCase.ErrorObserver { } // start listening for TSK errors for the new case currentCase.tskErrorReporter = new IntervalErrorReportData(currentCase, MIN_SECONDS_BETWEEN_ERROR_REPORTS, - NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText")); + NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText")); doCaseChange(currentCase); SwingUtilities.invokeLater(() -> { RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases @@ -369,8 +373,11 @@ public class Case implements SleuthkitCase.ErrorObserver { } else { Logger.setLogDirectory(PlatformUtil.getLogDirectory()); } + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } - + @Override public void receiveError(String context, String errorMessage) { /* NOTE: We are accessing tskErrorReporter from two different threads. @@ -452,9 +459,11 @@ public class Case implements SleuthkitCase.ErrorObserver { db = SleuthkitCase.newCase(dbName, UserPreferences.getDatabaseConnectionInfo(), caseDir); } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error creating a case: " + caseName + " in dir " + caseDir, ex); //NON-NLS - throw new CaseActionException( - NbBundle.getMessage(Case.class, "Case.create.exception.msg", caseName, caseDir), ex); + logger.log(Level.SEVERE, "Error creating a case: " + caseName + " in dir " + caseDir + " " + ex.getMessage(), ex); //NON-NLS + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); + throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage()); //NON-NLS } /** @@ -604,19 +613,29 @@ public class Case implements SleuthkitCase.ErrorObserver { Case openedCase = new Case(caseName, caseNumber, examiner, caseMetadataFilePath, xmlcm, db, caseType); changeCase(openedCase); - } catch (CaseMetadataException | TskCoreException ex) { + } catch (CaseMetadataException ex) { /** * Clean-up the case if it was actually opened. TODO: Do this * better. */ + try { + Case badCase = Case.getCurrentCase(); + badCase.closeCase(); + } catch (IllegalStateException unused) { + // Already logged. + } + throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.gen.msg") + ". " + ex.getMessage(), ex); //NON-NLS + } catch (TskCoreException ex) { try { Case badCase = Case.getCurrentCase(); badCase.closeCase(); } catch (CaseActionException | IllegalStateException unused) { // Already logged. } - - throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.gen.msg") + ". " + ex.getMessage(), ex); + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); + throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage(), ex); //NON-NLS } } @@ -643,8 +662,7 @@ public class Case implements SleuthkitCase.ErrorObserver { for (Map.Entry entry : imgPaths.entrySet()) { long obj_id = entry.getKey(); String path = entry.getValue(); - boolean fileExists = (pathExists(path) - || driveExists(path)); + boolean fileExists = (pathExists(path) || driveExists(path)); if (!fileExists) { int ret = JOptionPane.showConfirmDialog(null, NbBundle.getMessage(Case.class, @@ -675,7 +693,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * * @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and * {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and - * {@link #notifyFailedAddingDataSource(java.util.UUID)} + * {@link #notifyFailedAddingDataSource(java.util.UUID)} */ @Deprecated public Image addImage(String imgPath, long imgId, String timeZone) throws CaseActionException { @@ -690,13 +708,13 @@ public class Case implements SleuthkitCase.ErrorObserver { /** * Finishes adding new local data source to the case. Sends out event and - * reopens windows if needed. + * reopens windows if needed. * * @param newDataSource new data source added * * @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and * {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and - * {@link #notifyFailedAddingDataSource(java.util.UUID)} + * {@link #notifyFailedAddingDataSource(java.util.UUID)} */ @Deprecated void addLocalDataSource(Content newDataSource) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 7cea2ef29e..5c16b16fd2 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.casemodule; +import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -80,18 +81,22 @@ public final class CaseOpenAction implements ActionListener { } /** - * Try to open the caswe associated with the case meta data file the + * Try to open the case associated with the case meta data file the * user selected. */ final String path = fileChooser.getSelectedFile().getPath(); String dirPath = fileChooser.getSelectedFile().getParent(); ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, PROP_BASECASE, dirPath.substring(0, dirPath.lastIndexOf(File.separator))); + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); new Thread(() -> { try { Case.open(path); } catch (CaseActionException ex) { SwingUtilities.invokeLater(() -> { - JOptionPane.showMessageDialog(null, ex.getMessage(), NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage() + " " + + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } @@ -100,5 +105,4 @@ public final class CaseOpenAction implements ActionListener { }).start(); } } - } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 5e6b5e5ceb..797a074267 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -41,12 +41,20 @@ import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.datamodel.CaseDbConnectionInfo; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskData.DbType; +import java.awt.HeadlessException; +import java.util.MissingResourceException; +import java.util.concurrent.ExecutionException; +import org.openide.windows.WindowManager; +import org.sleuthkit.datamodel.TskCoreException; +import java.awt.Cursor; /** * Action to open the New Case wizard. */ final class NewCaseWizardAction extends CallableSystemAction { + private static final long serialVersionUID = 1L; + private WizardDescriptor.Panel[] panels; private static final Logger logger = Logger.getLogger(NewCaseWizardAction.class.getName()); @@ -109,29 +117,42 @@ final class NewCaseWizardAction extends CallableSystemAction { @Override protected void done() { + final String caseName = (String) wizardDescriptor.getProperty("caseName"); //NON-NLS try { get(); CaseType currentCaseType = CaseType.values()[(int) wizardDescriptor.getProperty("caseType")]; //NON-NLS CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); - if ((currentCaseType == CaseType.SINGLE_USER_CASE) || ((info.getDbType() != DbType.SQLITE) && SleuthkitCase.tryConnectOld(info.getHost(), info.getPort(), info.getUserName(), info.getPassword(), info.getDbType()))) { + + if (currentCaseType == CaseType.SINGLE_USER_CASE) { AddImageAction addImageAction = SystemAction.get(AddImageAction.class); addImageAction.actionPerformed(null); } else { - JOptionPane.showMessageDialog(null, - NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.databaseProblem1.text"), - NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.databaseProblem2.text"), - JOptionPane.ERROR_MESSAGE); - doFailedCaseCleanup(wizardDescriptor); + if (info.getDbType() != DbType.SQLITE) { + SleuthkitCase.tryConnect(info); + AddImageAction addImageAction = SystemAction.get(AddImageAction.class); + addImageAction.actionPerformed(null); + } else { + JOptionPane.showMessageDialog(null, + NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.databaseProblem1.text"), + NbBundle.getMessage(this.getClass(), "NewCaseWizardAction.databaseProblem2.text"), + JOptionPane.ERROR_MESSAGE); + doFailedCaseCleanup(wizardDescriptor); + } } - - } catch (Exception ex) { - final String caseName = (String) wizardDescriptor.getProperty("caseName"); //NON-NLS + } catch (InterruptedException | ExecutionException | MissingResourceException | TskCoreException | HeadlessException ex) { SwingUtilities.invokeLater(() -> { - JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), - "CaseCreateAction.msgDlg.cantCreateCase.msg") + " " + caseName, - NbBundle.getMessage(this.getClass(), - "CaseOpenAction.msgDlg.cantOpenCase.title"), - JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getCause().getMessage() + " " + + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), + NbBundle.getMessage(this.getClass(), "CaseCreateAction.msgDlg.cantCreateCase.msg"), + JOptionPane.ERROR_MESSAGE); //NON-NLS + + try { + StartupWindowProvider.getInstance().close(); + } catch (Exception unused) { + } + if (!Case.isCaseOpen()) { + StartupWindowProvider.getInstance().open(); + } }); doFailedCaseCleanup(wizardDescriptor); } @@ -151,6 +172,9 @@ final class NewCaseWizardAction extends CallableSystemAction { logger.log(Level.INFO, "Deleting a created case directory due to an error, dir: {0}", createdDirectory); //NON-NLS Case.deleteCaseDirectory(new File(createdDirectory)); } + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index 9741296bde..00b4b600c3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -28,6 +28,8 @@ import javax.swing.SwingUtilities; import javax.swing.table.AbstractTableModel; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; +import org.openide.windows.WindowManager; +import java.awt.Cursor; /** * Panel show from the splash dialog that shows recent cases and allows them to @@ -196,7 +198,7 @@ class OpenRecentCasePanel extends javax.swing.JPanel { } // Open the recent cases if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { - JOptionPane.showMessageDialog(null, + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(this.getClass(), "OpenRecentCasePanel.openCase.msgDlg.caseDoesntExist.msg", caseName), @@ -211,12 +213,17 @@ class OpenRecentCasePanel extends javax.swing.JPanel { } } else { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); new Thread(() -> { try { Case.open(casePath); } catch (CaseActionException ex) { SwingUtilities.invokeLater(() -> { - JOptionPane.showMessageDialog(null, ex.getMessage(), NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage(), + NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index a4859c9846..7782ba6230 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -26,6 +26,8 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingUtilities; import org.openide.util.NbBundle; +import org.openide.windows.WindowManager; +import java.awt.Cursor; /** * This class is used to add the action to the recent case menu item. When the @@ -70,13 +72,18 @@ class RecentItems implements ActionListener { } } else { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); new Thread(() -> { // Create case. try { Case.open(casePath); } catch (CaseActionException ex) { SwingUtilities.invokeLater(() -> { - JOptionPane.showMessageDialog(null, ex.getMessage(), NbBundle.getMessage(RecentItems.this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getMessage(), + NbBundle.getMessage(RecentItems.this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), JOptionPane.ERROR_MESSAGE); //NON-NLS if (!Case.isCaseOpen()) { StartupWindowProvider.getInstance().open(); } From 6327732a8b81be6ec8a843d10b4cbda1b1338111 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 16 Oct 2015 16:36:43 -0400 Subject: [PATCH 02/16] merge --- .../org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 797a074267..6d6efd12da 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -47,6 +47,7 @@ import java.util.concurrent.ExecutionException; import org.openide.windows.WindowManager; import org.sleuthkit.datamodel.TskCoreException; import java.awt.Cursor; +import org.sleuthkit.autopsy.core.UserPreferencesException; /** * Action to open the New Case wizard. @@ -139,7 +140,7 @@ final class NewCaseWizardAction extends CallableSystemAction { doFailedCaseCleanup(wizardDescriptor); } } - } catch (InterruptedException | ExecutionException | MissingResourceException | TskCoreException | HeadlessException ex) { + } catch (InterruptedException | ExecutionException | MissingResourceException | TskCoreException | HeadlessException | UserPreferencesException ex) { SwingUtilities.invokeLater(() -> { JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getCause().getMessage() + " " + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), From 276d9e1c636b9f996cc53b2a5180df2733888c3e Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Mon, 19 Oct 2015 16:01:30 -0400 Subject: [PATCH 03/16] add scroll pane for multi user options --- .../MultiUserSettingsPanel.form | 860 +++++++++--------- .../MultiUserSettingsPanel.java | 8 +- 2 files changed, 439 insertions(+), 429 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form index 57f1eca7d5..0ffb633a41 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form @@ -16,86 +16,36 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - + - + - - - - - - - - - - - - + - - + + + + + + @@ -104,416 +54,472 @@ - - - - - + + + - - - + - - - - - + + + - + - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java index 0a26244edc..88ab83e5e2 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java @@ -143,6 +143,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { // //GEN-BEGIN:initComponents private void initComponents() { + jScrollPane = new javax.swing.JScrollPane(); pnOverallPanel = new javax.swing.JPanel(); pnDatabaseSettings = new javax.swing.JPanel(); tbDbHostname = new javax.swing.JTextField(); @@ -432,15 +433,17 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { .addContainerGap(39, Short.MAX_VALUE)) ); + jScrollPane.setViewportView(pnOverallPanel); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 555, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 555, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 559, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE) ); }// //GEN-END:initComponents @@ -800,6 +803,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { private javax.swing.JButton bnTestMessageService; private javax.swing.JButton bnTestSolr; private javax.swing.JCheckBox cbEnableMultiUser; + private javax.swing.JScrollPane jScrollPane; private javax.swing.JLabel lbDatabaseSettings; private javax.swing.JLabel lbMessageServiceSettings; private javax.swing.JLabel lbSolrSettings; From cc92ac6bc53bac58817b7793477de394b59925f5 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Mon, 19 Oct 2015 17:19:04 -0400 Subject: [PATCH 04/16] add database info to case properties --- .../autopsy/casemodule/Bundle.properties | 4 + .../casemodule/CasePropertiesForm.form | 132 +++++++++++------ .../casemodule/CasePropertiesForm.java | 136 +++++++++++------- 3 files changed, 177 insertions(+), 95 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index c9a86ea72f..8af4905638 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -261,3 +261,7 @@ NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user NewCaseVisualPanel1.multiUserSettingsWarningLabel.text=Multi-user settings warning label Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} +CasePropertiesForm.lbDbType.text=Database Type: +CasePropertiesForm.tbDbType.text= +CasePropertiesForm.lbDbName.text=Database Name: +CasePropertiesForm.tbDbName.text= diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form index ddbcd7e243..133475120c 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form @@ -1,4 +1,4 @@ - +
@@ -37,49 +37,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + @@ -92,38 +87,51 @@ - + - + - + - + - + - + - + - + + + + + + + + + + + - + + + + @@ -253,11 +261,11 @@ + - @@ -304,5 +312,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java index 5a60ca75d7..5c6df573da 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java @@ -24,12 +24,11 @@ */ package org.sleuthkit.autopsy.casemodule; -import java.awt.*; +import java.nio.file.Paths; import java.awt.event.ActionListener; import java.io.File; import java.util.Map; import java.util.logging.Level; - import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; @@ -47,7 +46,9 @@ import org.openide.util.actions.CallableSystemAction; */ class CasePropertiesForm extends javax.swing.JPanel { - Case current = null; + private static final long serialVersionUID = 1L; + + private Case current = null; private static JPanel caller; // panel for error // Shrink a path to fit in targetLength (if necessary), by replaceing part @@ -85,9 +86,22 @@ class CasePropertiesForm extends javax.swing.JPanel { examinerTextField.setText(currentCase.getExaminer()); crDateTextField.setText(crDate); caseDirTextArea.setText(caseDir); - current = currentCase; + try { + CaseMetadata caseMetadata = new CaseMetadata(Paths.get(currentCase.getConfigFilePath())); + tbDbName.setText(caseMetadata.getCaseDatabaseName()); + Case.CaseType caseType = caseMetadata.getCaseType(); + tbDbType.setText(caseType.toString()); + if (caseType == Case.CaseType.SINGLE_USER_CASE) { + deleteCaseButton.setEnabled(true); + } else { + deleteCaseButton.setEnabled(false); + } + } catch (CaseMetadata.CaseMetadataException ex) { + Logger.getLogger(CasePropertiesForm.class.getName()).log(Level.WARNING, "Could not read case properties.", ex); //NON-NLS + } + int totalImages = imgPaths.size(); // create the headers and add all the rows @@ -186,12 +200,16 @@ class CasePropertiesForm extends javax.swing.JPanel { examinerLabel = new javax.swing.JLabel(); caseNumberTextField = new javax.swing.JTextField(); examinerTextField = new javax.swing.JTextField(); + lbDbType = new javax.swing.JLabel(); + tbDbType = new javax.swing.JTextField(); + lbDbName = new javax.swing.JLabel(); + tbDbName = new javax.swing.JTextField(); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); - casePropLabel.setFont(casePropLabel.getFont().deriveFont(Font.BOLD, 24)); + casePropLabel.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N casePropLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); casePropLabel.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.casePropLabel.text")); // NOI18N @@ -213,11 +231,10 @@ class CasePropertiesForm extends javax.swing.JPanel { } }); - genInfoLabel.setFont(genInfoLabel.getFont().deriveFont(Font.BOLD, 14)); - genInfoLabel.setText( - org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.genInfoLabel.text")); // NOI18N + genInfoLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + genInfoLabel.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.genInfoLabel.text")); // NOI18N - imgInfoLabel.setFont(imgInfoLabel.getFont().deriveFont(Font.BOLD, 14)); + imgInfoLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N imgInfoLabel.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.imgInfoLabel.text")); // NOI18N OKButton.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.OKButton.text")); // NOI18N @@ -227,7 +244,7 @@ class CasePropertiesForm extends javax.swing.JPanel { }, new String [] { - "Path", "Remove" //NON-NLS + "Path", "Remove" } ) { boolean[] canEdit = new boolean [] { @@ -244,9 +261,9 @@ class CasePropertiesForm extends javax.swing.JPanel { imagesTable.setUpdateSelectionOnSort(false); imagesTableScrollPane.setViewportView(imagesTable); + caseDirTextArea.setEditable(false); caseDirTextArea.setBackground(new java.awt.Color(240, 240, 240)); caseDirTextArea.setColumns(20); - caseDirTextArea.setEditable(false); caseDirTextArea.setRows(1); caseDirTextArea.setRequestFocusEnabled(false); jScrollPane2.setViewportView(caseDirTextArea); @@ -268,6 +285,16 @@ class CasePropertiesForm extends javax.swing.JPanel { examinerTextField.setEditable(false); examinerTextField.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.examinerTextField.text")); // NOI18N + lbDbType.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.lbDbType.text")); // NOI18N + + tbDbType.setEditable(false); + tbDbType.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.tbDbType.text")); // NOI18N + + lbDbName.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.lbDbName.text")); // NOI18N + + tbDbName.setEditable(false); + tbDbName.setText(org.openide.util.NbBundle.getMessage(CasePropertiesForm.class, "CasePropertiesForm.tbDbName.text")); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -276,38 +303,37 @@ class CasePropertiesForm extends javax.swing.JPanel { .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(casePropLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE) - .addComponent(genInfoLabel) - .addComponent(imgInfoLabel) .addComponent(imagesTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addGap(181, 181, 181) - .addComponent(OKButton, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(caseNameLabel) - .addComponent(caseNumberLabel)) - .addGap(25, 25, 25) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(caseNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE) - .addComponent(caseNumberTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE))) - .addGroup(layout.createSequentialGroup() - .addComponent(examinerLabel) - .addGap(45, 45, 45) - .addComponent(examinerTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(caseDirLabel) - .addComponent(crDateLabel)) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE) - .addComponent(crDateTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(caseNameLabel) + .addComponent(caseNumberLabel) + .addComponent(examinerLabel) + .addComponent(caseDirLabel) + .addComponent(crDateLabel) + .addComponent(lbDbType)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(caseNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) + .addComponent(caseNumberTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) + .addComponent(examinerTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) + .addComponent(crDateTextField) + .addComponent(jScrollPane2) + .addComponent(tbDbType) + .addComponent(tbDbName)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(updateCaseNameButton) - .addComponent(deleteCaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addComponent(deleteCaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(updateCaseNameButton, 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(genInfoLabel) + .addComponent(imgInfoLabel) + .addGroup(layout.createSequentialGroup() + .addGap(181, 181, 181) + .addComponent(OKButton, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lbDbName)) + .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( @@ -317,32 +343,42 @@ class CasePropertiesForm extends javax.swing.JPanel { .addComponent(casePropLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(genInfoLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(caseNameLabel) .addComponent(caseNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(updateCaseNameButton)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(caseNumberLabel) .addComponent(caseNumberTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(examinerLabel) .addComponent(examinerTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(crDateLabel) .addComponent(crDateTextField, 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) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(caseDirLabel) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(39, 39, 39) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(caseDirLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(tbDbType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lbDbType)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lbDbName) + .addComponent(tbDbName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) .addComponent(imgInfoLabel)) - .addComponent(deleteCaseButton)) + .addGroup(layout.createSequentialGroup() + .addGap(9, 9, 9) + .addComponent(deleteCaseButton))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(imagesTableScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -445,6 +481,10 @@ class CasePropertiesForm extends javax.swing.JPanel { private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTextArea jTextArea1; + private javax.swing.JLabel lbDbName; + private javax.swing.JLabel lbDbType; + private javax.swing.JTextField tbDbName; + private javax.swing.JTextField tbDbType; private javax.swing.JButton updateCaseNameButton; // End of variables declaration//GEN-END:variables From c8141cafab54d93e769c60a24846b03edba603e3 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Tue, 20 Oct 2015 09:18:30 -0400 Subject: [PATCH 05/16] no multi-user settings is not an error --- Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties | 5 ++--- .../sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index c9a86ea72f..d2b97417e3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -192,7 +192,6 @@ MissingImageDialog.ErrorSettingImage=Error setting image path. Please try again. NewCaseVisualPanel1.getName.text=Case Info NewCaseVisualPanel1.caseDirBrowse.selectButton.text=Select NewCaseVisualPanel1.badCredentials.text=Bad multi-user settings (see Tools, Options, Multi-user) or services are down. -NewCaseVisualPanel1.MultiUserDisabled.text=Multi-user cases not enabled. See Tools, Options, Multi-user. NewCaseVisualPanel2.getName.text=Additional Information NewCaseWizardAction.closeCurCase.confMsg.msg=Do you want to save and close this case and proceed with the new case creation? NewCaseWizardAction.closeCurCase.confMsg.title=Warning\: Closing the Current Case @@ -255,9 +254,9 @@ SingleUserCaseImporter.WillNotImport=Will not import: SingleUserCaseImporter.None=None SingleUserCaseImporter.ContinueWithImport=Continue with import? SingleUserCaseImporter.Cancelled=Cancelled -NewCaseVisualPanel1.caseParentDirWarningLabel.text=Case directory warning label +NewCaseVisualPanel1.caseParentDirWarningLabel.text= NewCaseVisualPanel1.multiUserCaseRadioButton.text=Multi-user NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user -NewCaseVisualPanel1.multiUserSettingsWarningLabel.text=Multi-user settings warning label +NewCaseVisualPanel1.multiUserSettingsWarningLabel.text= Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java index 6aebc0fe99..c2f41afbde 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java @@ -62,11 +62,9 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { if (UserPreferences.getIsMultiUserModeEnabled()) { multiUserCaseRadioButton.setEnabled(true); multiUserCaseRadioButton.setSelected(true); - multiUserSettingsWarningLabel.setVisible(false); } else { multiUserCaseRadioButton.setEnabled(false); singleUserCaseRadioButton.setSelected(true); - multiUserSettingsWarningLabel.setText(NbBundle.getMessage(this.getClass(), "NewCaseVisualPanel1.MultiUserDisabled.text")); } validateSettings(); } From 5e1a557e9e91e054a75f5831aff5b3417aed80ae Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 22 Oct 2015 16:05:56 -0400 Subject: [PATCH 06/16] merge --- .../autopsy/casemodule/Bundle.properties | 2 +- .../sleuthkit/autopsy/casemodule/Case.java | 34 ++++++++++++------- .../autopsy/casemodule/CaseOpenAction.java | 4 +++ .../casemodule/NewCaseWizardAction.java | 7 ++-- .../casemodule/OpenRecentCasePanel.java | 4 +++ .../autopsy/casemodule/RecentItems.java | 4 +++ nbproject/platform.properties | 16 +-------- 7 files changed, 40 insertions(+), 31 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 617d0efa69..10b0487510 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -262,4 +262,4 @@ NewCaseVisualPanel1.multiUserSettingsWarningLabel.text=Multi-user settings warni Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} CaseOpenException.DatabaseSettingsIssue=Database settings: -CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. \ No newline at end of file +CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 7b9172a968..e580a124bb 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -323,9 +323,10 @@ public class Case implements SleuthkitCase.ErrorObserver { Case oldCase = Case.currentCase; Case.currentCase = null; if (oldCase != null) { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - }); + /* KDM I think we want this one.... + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + });*/ doCaseChange(null); //closes windows, etc if (null != oldCase.tskErrorReporter) { oldCase.tskErrorReporter.shutdown(); // stop listening for TSK errors for the old case @@ -349,7 +350,7 @@ public class Case implements SleuthkitCase.ErrorObserver { } // start listening for TSK errors for the new case currentCase.tskErrorReporter = new IntervalErrorReportData(currentCase, MIN_SECONDS_BETWEEN_ERROR_REPORTS, - NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText")); + NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText")); doCaseChange(currentCase); SwingUtilities.invokeLater(() -> { RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases @@ -374,11 +375,12 @@ public class Case implements SleuthkitCase.ErrorObserver { } else { Logger.setLogDirectory(PlatformUtil.getLogDirectory()); } - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - }); + /* KDM I think we want this one too. + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + });*/ } - + @Override public void receiveError(String context, String errorMessage) { /* NOTE: We are accessing tskErrorReporter from two different threads. @@ -469,6 +471,10 @@ public class Case implements SleuthkitCase.ErrorObserver { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS throw new CaseActionException( NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); + } finally { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } /** @@ -581,7 +587,7 @@ public class Case implements SleuthkitCase.ErrorObserver { throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.multiUserCaseNotEnabled")); } try { - db = SleuthkitCase.openCase(metadata.getCaseDatabaseName(), UserPreferences.getDatabaseConnectionInfo(), caseDir); + db = SleuthkitCase.openCase(metadata.getCaseDatabaseName(), UserPreferences.getDatabaseConnectionInfo(), caseDir); } catch (UserPreferencesException ex) { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS throw new CaseActionException( @@ -647,6 +653,10 @@ public class Case implements SleuthkitCase.ErrorObserver { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage(), ex); //NON-NLS + } finally { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } } @@ -704,7 +714,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * * @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and * {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and - * {@link #notifyFailedAddingDataSource(java.util.UUID)} + * {@link #notifyFailedAddingDataSource(java.util.UUID)} */ @Deprecated public Image addImage(String imgPath, long imgId, String timeZone) throws CaseActionException { @@ -719,13 +729,13 @@ public class Case implements SleuthkitCase.ErrorObserver { /** * Finishes adding new local data source to the case. Sends out event and - * reopens windows if needed. + * reopens windows if needed. * * @param newDataSource new data source added * * @deprecated As of release 4.0, replaced by {@link #notifyAddingDataSource(java.util.UUID) and * {@link #notifyDataSourceAdded(org.sleuthkit.datamodel.Content, java.util.UUID) and - * {@link #notifyFailedAddingDataSource(java.util.UUID)} + * {@link #notifyFailedAddingDataSource(java.util.UUID)} */ @Deprecated void addLocalDataSource(Content newDataSource) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 5c16b16fd2..2ad1cd5a8f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -101,6 +101,10 @@ public final class CaseOpenAction implements ActionListener { StartupWindowProvider.getInstance().open(); } }); + } finally { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } }).start(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 58bdf04081..294b0a961b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -120,10 +120,10 @@ final class NewCaseWizardAction extends CallableSystemAction { final String caseName = (String) wizardDescriptor.getProperty("caseName"); //NON-NLS try { get(); - AddImageAction addImageAction = SystemAction.get(AddImageAction.class); - addImageAction.actionPerformed(null); + AddImageAction addImageAction = SystemAction.get(AddImageAction.class); + addImageAction.actionPerformed(null); } catch (Exception ex) { - logger.log(Level.SEVERE, "Error creating case", ex); //NON-NLS + logger.log(Level.SEVERE, "Error creating case", ex); //NON-NLS SwingUtilities.invokeLater(() -> { JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), ex.getCause().getMessage() + " " + NbBundle.getMessage(this.getClass(), "CaseExceptionWarning.CheckMultiUserOptions"), @@ -140,6 +140,7 @@ final class NewCaseWizardAction extends CallableSystemAction { }); doFailedCaseCleanup(wizardDescriptor); } + /// KDM here???? } }.execute(); } else { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index 00b4b600c3..9e4280474a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -228,6 +228,10 @@ class OpenRecentCasePanel extends javax.swing.JPanel { StartupWindowProvider.getInstance().open(); } }); + } finally { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); } }).start(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 7782ba6230..0de9887fad 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -88,6 +88,10 @@ class RecentItems implements ActionListener { StartupWindowProvider.getInstance().open(); } }); + } finally { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); } }).start(); } diff --git a/nbproject/platform.properties b/nbproject/platform.properties index aa34a2c2be..61f719736c 100644 --- a/nbproject/platform.properties +++ b/nbproject/platform.properties @@ -1,4 +1,5 @@ branding.token=autopsy +nbjdk.active=JDK_1.8_66 # Version of platform that is automatically downloaded # Note build.xml has similar definitions that should be kept in sync (manually) netbeans-plat-version=8.0.2 @@ -13,15 +14,12 @@ cluster.path=\ ${nbplatform.active.dir}/java:\ ${nbplatform.active.dir}/platform disabled.modules=\ - org.apache.tools.ant.module,\ org.netbeans.api.debugger.jpda,\ org.netbeans.api.java,\ - org.netbeans.api.maven,\ org.netbeans.lib.nbjavac,\ org.netbeans.libs.cglib,\ org.netbeans.libs.javacapi,\ org.netbeans.libs.javacimpl,\ - org.netbeans.libs.javafx,\ org.netbeans.libs.springframework,\ org.netbeans.modules.ant.browsetask,\ org.netbeans.modules.ant.debugger,\ @@ -33,7 +31,6 @@ disabled.modules=\ org.netbeans.modules.dbschema,\ org.netbeans.modules.debugger.jpda,\ org.netbeans.modules.debugger.jpda.ant,\ - org.netbeans.modules.debugger.jpda.js,\ org.netbeans.modules.debugger.jpda.kit,\ org.netbeans.modules.debugger.jpda.projects,\ org.netbeans.modules.debugger.jpda.ui,\ @@ -46,8 +43,6 @@ disabled.modules=\ org.netbeans.modules.form.nb,\ org.netbeans.modules.form.refactoring,\ org.netbeans.modules.hibernate,\ - org.netbeans.modules.hibernate4lib,\ - org.netbeans.modules.hibernatelib,\ org.netbeans.modules.hudson.ant,\ org.netbeans.modules.hudson.maven,\ org.netbeans.modules.i18n,\ @@ -69,21 +64,16 @@ disabled.modules=\ org.netbeans.modules.java.examples,\ org.netbeans.modules.java.freeform,\ org.netbeans.modules.java.guards,\ - org.netbeans.modules.java.helpset,\ org.netbeans.modules.java.hints,\ org.netbeans.modules.java.hints.declarative,\ org.netbeans.modules.java.hints.declarative.test,\ org.netbeans.modules.java.hints.legacy.spi,\ org.netbeans.modules.java.hints.test,\ org.netbeans.modules.java.hints.ui,\ - org.netbeans.modules.java.j2sedeploy,\ - org.netbeans.modules.java.j2seembedded,\ org.netbeans.modules.java.j2seplatform,\ - org.netbeans.modules.java.j2seprofiles,\ org.netbeans.modules.java.j2seproject,\ org.netbeans.modules.java.kit,\ org.netbeans.modules.java.lexer,\ - org.netbeans.modules.java.metrics,\ org.netbeans.modules.java.navigation,\ org.netbeans.modules.java.platform,\ org.netbeans.modules.java.preprocessorbridge,\ @@ -95,7 +85,6 @@ disabled.modules=\ org.netbeans.modules.java.sourceui,\ org.netbeans.modules.java.testrunner,\ org.netbeans.modules.javadoc,\ - org.netbeans.modules.javaee.injection,\ org.netbeans.modules.javawebstart,\ org.netbeans.modules.jellytools.java,\ org.netbeans.modules.junit,\ @@ -116,8 +105,6 @@ disabled.modules=\ org.netbeans.modules.maven.repository,\ org.netbeans.modules.maven.search,\ org.netbeans.modules.maven.spring,\ - org.netbeans.modules.nashorn.execution,\ - org.netbeans.modules.performance,\ org.netbeans.modules.performance.java,\ org.netbeans.modules.projectimport.eclipse.core,\ org.netbeans.modules.projectimport.eclipse.j2se,\ @@ -130,7 +117,6 @@ disabled.modules=\ org.netbeans.modules.websvc.jaxws21,\ org.netbeans.modules.websvc.jaxws21api,\ org.netbeans.modules.websvc.saas.codegen.java,\ - org.netbeans.modules.whitelist,\ org.netbeans.modules.xml.jaxb,\ org.netbeans.modules.xml.tools.java,\ org.netbeans.spi.java.hints From 4e2659e810517bd0b0fcb92ffcd556b3625d046c Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 22 Oct 2015 16:18:34 -0400 Subject: [PATCH 07/16] comment out suggested edits --- .../sleuthkit/autopsy/casemodule/Case.java | 33 +++++++++++-------- .../autopsy/casemodule/CaseOpenAction.java | 5 ++- .../casemodule/NewCaseWizardAction.java | 4 ++- .../casemodule/OpenRecentCasePanel.java | 5 ++- .../autopsy/casemodule/RecentItems.java | 5 ++- 5 files changed, 34 insertions(+), 18 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index e580a124bb..9503678f97 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -323,10 +323,10 @@ public class Case implements SleuthkitCase.ErrorObserver { Case oldCase = Case.currentCase; Case.currentCase = null; if (oldCase != null) { - /* KDM I think we want this one.... - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - });*/ + /* KDM I think we want this one....*/ + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); doCaseChange(null); //closes windows, etc if (null != oldCase.tskErrorReporter) { oldCase.tskErrorReporter.shutdown(); // stop listening for TSK errors for the old case @@ -375,10 +375,10 @@ public class Case implements SleuthkitCase.ErrorObserver { } else { Logger.setLogDirectory(PlatformUtil.getLogDirectory()); } - /* KDM I think we want this one too. - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - });*/ + /* KDM I think we want this one too. */ + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } @Override @@ -471,11 +471,13 @@ public class Case implements SleuthkitCase.ErrorObserver { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS throw new CaseActionException( NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); - } finally { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - }); - } + } /* KDM from RC + finally { + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); + } + */ /** * Two-stage initialization to avoid leaking reference to "this" in @@ -653,11 +655,14 @@ public class Case implements SleuthkitCase.ErrorObserver { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage(), ex); //NON-NLS - } finally { + } + /* KDM from RC + finally { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); } + */ } static Map getImagePaths(SleuthkitCase db) { //TODO: clean this up diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 2ad1cd5a8f..e00692ab75 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -101,11 +101,14 @@ public final class CaseOpenAction implements ActionListener { StartupWindowProvider.getInstance().open(); } }); - } finally { + } + /* KDM from RC + finally { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); } + */ }).start(); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 294b0a961b..6c9622b781 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -140,7 +140,9 @@ final class NewCaseWizardAction extends CallableSystemAction { }); doFailedCaseCleanup(wizardDescriptor); } - /// KDM here???? + SwingUtilities.invokeLater(() -> { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); + }); } }.execute(); } else { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index 9e4280474a..45336aa704 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -228,11 +228,14 @@ class OpenRecentCasePanel extends javax.swing.JPanel { StartupWindowProvider.getInstance().open(); } }); - } finally { + } + /* KDM from RC + finally { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); }); } + */ }).start(); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 0de9887fad..76b5469574 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -88,11 +88,14 @@ class RecentItems implements ActionListener { StartupWindowProvider.getInstance().open(); } }); - } finally { + } + /* KDM from RC + finally { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); }); } + */ }).start(); } } From f365d5d28f7b262da9404f8c6211ada32912109f Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 22 Oct 2015 16:37:21 -0400 Subject: [PATCH 08/16] remove finally blocks --- .../org/sleuthkit/autopsy/casemodule/Case.java | 17 +---------------- .../autopsy/casemodule/CaseOpenAction.java | 7 ------- .../autopsy/casemodule/NewCaseWizardAction.java | 3 --- .../autopsy/casemodule/OpenRecentCasePanel.java | 7 ------- .../autopsy/casemodule/RecentItems.java | 7 ------- 5 files changed, 1 insertion(+), 40 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 9503678f97..2cfabe81d3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -323,7 +323,6 @@ public class Case implements SleuthkitCase.ErrorObserver { Case oldCase = Case.currentCase; Case.currentCase = null; if (oldCase != null) { - /* KDM I think we want this one....*/ SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); }); @@ -375,7 +374,6 @@ public class Case implements SleuthkitCase.ErrorObserver { } else { Logger.setLogDirectory(PlatformUtil.getLogDirectory()); } - /* KDM I think we want this one too. */ SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); @@ -471,13 +469,7 @@ public class Case implements SleuthkitCase.ErrorObserver { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS throw new CaseActionException( NbBundle.getMessage(Case.class, "Case.databaseConnectionInfo.error.msg"), ex); - } /* KDM from RC - finally { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - }); - } - */ + } /** * Two-stage initialization to avoid leaking reference to "this" in @@ -656,13 +648,6 @@ public class Case implements SleuthkitCase.ErrorObserver { }); throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage(), ex); //NON-NLS } - /* KDM from RC - finally { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - }); - } - */ } static Map getImagePaths(SleuthkitCase db) { //TODO: clean this up diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index e00692ab75..2a03307cf5 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -102,13 +102,6 @@ public final class CaseOpenAction implements ActionListener { } }); } - /* KDM from RC - finally { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - }); - } - */ }).start(); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 6c9622b781..09659fcefa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -140,9 +140,6 @@ final class NewCaseWizardAction extends CallableSystemAction { }); doFailedCaseCleanup(wizardDescriptor); } - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); - }); } }.execute(); } else { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index 45336aa704..00b4b600c3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -229,13 +229,6 @@ class OpenRecentCasePanel extends javax.swing.JPanel { } }); } - /* KDM from RC - finally { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - }); - } - */ }).start(); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 76b5469574..7782ba6230 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -89,13 +89,6 @@ class RecentItems implements ActionListener { } }); } - /* KDM from RC - finally { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - }); - } - */ }).start(); } } From 1583ec99ba4fbd667a4f1be813eeb12f15b02bc3 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 22 Oct 2015 16:41:40 -0400 Subject: [PATCH 09/16] merge --- nbproject/platform.properties | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nbproject/platform.properties b/nbproject/platform.properties index 61f719736c..2572317eef 100644 --- a/nbproject/platform.properties +++ b/nbproject/platform.properties @@ -1,5 +1,4 @@ branding.token=autopsy -nbjdk.active=JDK_1.8_66 # Version of platform that is automatically downloaded # Note build.xml has similar definitions that should be kept in sync (manually) netbeans-plat-version=8.0.2 @@ -14,12 +13,15 @@ cluster.path=\ ${nbplatform.active.dir}/java:\ ${nbplatform.active.dir}/platform disabled.modules=\ + org.apache.tools.ant.module,\ org.netbeans.api.debugger.jpda,\ org.netbeans.api.java,\ + org.netbeans.api.maven,\ org.netbeans.lib.nbjavac,\ org.netbeans.libs.cglib,\ org.netbeans.libs.javacapi,\ org.netbeans.libs.javacimpl,\ + org.netbeans.libs.javafx,\ org.netbeans.libs.springframework,\ org.netbeans.modules.ant.browsetask,\ org.netbeans.modules.ant.debugger,\ @@ -31,6 +33,7 @@ disabled.modules=\ org.netbeans.modules.dbschema,\ org.netbeans.modules.debugger.jpda,\ org.netbeans.modules.debugger.jpda.ant,\ + org.netbeans.modules.debugger.jpda.js,\ org.netbeans.modules.debugger.jpda.kit,\ org.netbeans.modules.debugger.jpda.projects,\ org.netbeans.modules.debugger.jpda.ui,\ @@ -43,6 +46,8 @@ disabled.modules=\ org.netbeans.modules.form.nb,\ org.netbeans.modules.form.refactoring,\ org.netbeans.modules.hibernate,\ + org.netbeans.modules.hibernate4lib,\ + org.netbeans.modules.hibernatelib,\ org.netbeans.modules.hudson.ant,\ org.netbeans.modules.hudson.maven,\ org.netbeans.modules.i18n,\ @@ -64,16 +69,21 @@ disabled.modules=\ org.netbeans.modules.java.examples,\ org.netbeans.modules.java.freeform,\ org.netbeans.modules.java.guards,\ + org.netbeans.modules.java.helpset,\ org.netbeans.modules.java.hints,\ org.netbeans.modules.java.hints.declarative,\ org.netbeans.modules.java.hints.declarative.test,\ org.netbeans.modules.java.hints.legacy.spi,\ org.netbeans.modules.java.hints.test,\ org.netbeans.modules.java.hints.ui,\ + org.netbeans.modules.java.j2sedeploy,\ + org.netbeans.modules.java.j2seembedded,\ org.netbeans.modules.java.j2seplatform,\ + org.netbeans.modules.java.j2seprofiles,\ org.netbeans.modules.java.j2seproject,\ org.netbeans.modules.java.kit,\ org.netbeans.modules.java.lexer,\ + org.netbeans.modules.java.metrics,\ org.netbeans.modules.java.navigation,\ org.netbeans.modules.java.platform,\ org.netbeans.modules.java.preprocessorbridge,\ @@ -85,6 +95,7 @@ disabled.modules=\ org.netbeans.modules.java.sourceui,\ org.netbeans.modules.java.testrunner,\ org.netbeans.modules.javadoc,\ + org.netbeans.modules.javaee.injection,\ org.netbeans.modules.javawebstart,\ org.netbeans.modules.jellytools.java,\ org.netbeans.modules.junit,\ @@ -105,6 +116,8 @@ disabled.modules=\ org.netbeans.modules.maven.repository,\ org.netbeans.modules.maven.search,\ org.netbeans.modules.maven.spring,\ + org.netbeans.modules.nashorn.execution,\ + org.netbeans.modules.performance,\ org.netbeans.modules.performance.java,\ org.netbeans.modules.projectimport.eclipse.core,\ org.netbeans.modules.projectimport.eclipse.j2se,\ @@ -117,7 +130,7 @@ disabled.modules=\ org.netbeans.modules.websvc.jaxws21,\ org.netbeans.modules.websvc.jaxws21api,\ org.netbeans.modules.websvc.saas.codegen.java,\ + org.netbeans.modules.whitelist,\ org.netbeans.modules.xml.jaxb,\ org.netbeans.modules.xml.tools.java,\ org.netbeans.spi.java.hints - From 283f826282f5988ed285d04c91d1b0c8538aa8be Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 22 Oct 2015 17:18:08 -0400 Subject: [PATCH 10/16] fix up properties --- nbproject/platform.properties | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/nbproject/platform.properties b/nbproject/platform.properties index 2572317eef..b7dde1d50c 100644 --- a/nbproject/platform.properties +++ b/nbproject/platform.properties @@ -1,4 +1,5 @@ branding.token=autopsy +nbjdk.active=JDK_1.8_66 # Version of platform that is automatically downloaded # Note build.xml has similar definitions that should be kept in sync (manually) netbeans-plat-version=8.0.2 @@ -13,15 +14,12 @@ cluster.path=\ ${nbplatform.active.dir}/java:\ ${nbplatform.active.dir}/platform disabled.modules=\ - org.apache.tools.ant.module,\ org.netbeans.api.debugger.jpda,\ org.netbeans.api.java,\ - org.netbeans.api.maven,\ org.netbeans.lib.nbjavac,\ org.netbeans.libs.cglib,\ org.netbeans.libs.javacapi,\ org.netbeans.libs.javacimpl,\ - org.netbeans.libs.javafx,\ org.netbeans.libs.springframework,\ org.netbeans.modules.ant.browsetask,\ org.netbeans.modules.ant.debugger,\ @@ -33,7 +31,6 @@ disabled.modules=\ org.netbeans.modules.dbschema,\ org.netbeans.modules.debugger.jpda,\ org.netbeans.modules.debugger.jpda.ant,\ - org.netbeans.modules.debugger.jpda.js,\ org.netbeans.modules.debugger.jpda.kit,\ org.netbeans.modules.debugger.jpda.projects,\ org.netbeans.modules.debugger.jpda.ui,\ @@ -46,8 +43,6 @@ disabled.modules=\ org.netbeans.modules.form.nb,\ org.netbeans.modules.form.refactoring,\ org.netbeans.modules.hibernate,\ - org.netbeans.modules.hibernate4lib,\ - org.netbeans.modules.hibernatelib,\ org.netbeans.modules.hudson.ant,\ org.netbeans.modules.hudson.maven,\ org.netbeans.modules.i18n,\ @@ -69,21 +64,16 @@ disabled.modules=\ org.netbeans.modules.java.examples,\ org.netbeans.modules.java.freeform,\ org.netbeans.modules.java.guards,\ - org.netbeans.modules.java.helpset,\ org.netbeans.modules.java.hints,\ org.netbeans.modules.java.hints.declarative,\ org.netbeans.modules.java.hints.declarative.test,\ org.netbeans.modules.java.hints.legacy.spi,\ org.netbeans.modules.java.hints.test,\ org.netbeans.modules.java.hints.ui,\ - org.netbeans.modules.java.j2sedeploy,\ - org.netbeans.modules.java.j2seembedded,\ org.netbeans.modules.java.j2seplatform,\ - org.netbeans.modules.java.j2seprofiles,\ org.netbeans.modules.java.j2seproject,\ org.netbeans.modules.java.kit,\ org.netbeans.modules.java.lexer,\ - org.netbeans.modules.java.metrics,\ org.netbeans.modules.java.navigation,\ org.netbeans.modules.java.platform,\ org.netbeans.modules.java.preprocessorbridge,\ @@ -95,7 +85,6 @@ disabled.modules=\ org.netbeans.modules.java.sourceui,\ org.netbeans.modules.java.testrunner,\ org.netbeans.modules.javadoc,\ - org.netbeans.modules.javaee.injection,\ org.netbeans.modules.javawebstart,\ org.netbeans.modules.jellytools.java,\ org.netbeans.modules.junit,\ @@ -116,8 +105,6 @@ disabled.modules=\ org.netbeans.modules.maven.repository,\ org.netbeans.modules.maven.search,\ org.netbeans.modules.maven.spring,\ - org.netbeans.modules.nashorn.execution,\ - org.netbeans.modules.performance,\ org.netbeans.modules.performance.java,\ org.netbeans.modules.projectimport.eclipse.core,\ org.netbeans.modules.projectimport.eclipse.j2se,\ @@ -130,7 +117,6 @@ disabled.modules=\ org.netbeans.modules.websvc.jaxws21,\ org.netbeans.modules.websvc.jaxws21api,\ org.netbeans.modules.websvc.saas.codegen.java,\ - org.netbeans.modules.whitelist,\ org.netbeans.modules.xml.jaxb,\ org.netbeans.modules.xml.tools.java,\ org.netbeans.spi.java.hints From 476f89d00663333bbff6ab3668bfd48d883356f3 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 22 Oct 2015 18:22:55 -0400 Subject: [PATCH 11/16] code review updates --- .../autopsy/casemodule/Bundle.properties | 2 +- .../casemodule/CasePropertiesForm.form | 6 ++-- .../casemodule/CasePropertiesForm.java | 28 ++++++++----------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 8af4905638..520c4a7171 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -261,7 +261,7 @@ NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user NewCaseVisualPanel1.multiUserSettingsWarningLabel.text=Multi-user settings warning label Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} -CasePropertiesForm.lbDbType.text=Database Type: +CasePropertiesForm.lbDbType.text=Case Type: CasePropertiesForm.tbDbType.text= CasePropertiesForm.lbDbName.text=Database Name: CasePropertiesForm.tbDbName.text= diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form index 133475120c..94e9161756 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.form @@ -49,9 +49,9 @@ - - - + + + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java index 5c6df573da..99dcd8bfa2 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java @@ -79,7 +79,7 @@ class CasePropertiesForm extends javax.swing.JPanel { /** * Creates new form CasePropertiesForm */ - CasePropertiesForm(Case currentCase, String crDate, String caseDir, Map imgPaths) { + CasePropertiesForm(Case currentCase, String crDate, String caseDir, Map imgPaths) throws CaseMetadata.CaseMetadataException { initComponents(); caseNameTextField.setText(currentCase.getName()); caseNumberTextField.setText(currentCase.getNumber()); @@ -88,18 +88,14 @@ class CasePropertiesForm extends javax.swing.JPanel { caseDirTextArea.setText(caseDir); current = currentCase; - try { - CaseMetadata caseMetadata = new CaseMetadata(Paths.get(currentCase.getConfigFilePath())); - tbDbName.setText(caseMetadata.getCaseDatabaseName()); - Case.CaseType caseType = caseMetadata.getCaseType(); - tbDbType.setText(caseType.toString()); - if (caseType == Case.CaseType.SINGLE_USER_CASE) { - deleteCaseButton.setEnabled(true); - } else { - deleteCaseButton.setEnabled(false); - } - } catch (CaseMetadata.CaseMetadataException ex) { - Logger.getLogger(CasePropertiesForm.class.getName()).log(Level.WARNING, "Could not read case properties.", ex); //NON-NLS + CaseMetadata caseMetadata = new CaseMetadata(Paths.get(currentCase.getConfigFilePath())); + tbDbName.setText(caseMetadata.getCaseDatabaseName()); + Case.CaseType caseType = caseMetadata.getCaseType(); + tbDbType.setText(caseType.toString()); + if (caseType == Case.CaseType.SINGLE_USER_CASE) { + deleteCaseButton.setEnabled(true); + } else { + deleteCaseButton.setEnabled(false); } int totalImages = imgPaths.size(); @@ -314,9 +310,9 @@ class CasePropertiesForm extends javax.swing.JPanel { .addComponent(lbDbType)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(caseNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) - .addComponent(caseNumberTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) - .addComponent(examinerTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) + .addComponent(caseNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE) + .addComponent(caseNumberTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE) + .addComponent(examinerTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE) .addComponent(crDateTextField) .addComponent(jScrollPane2) .addComponent(tbDbType) From 7d0569c7d06329a43812bb71c6aee89643014030 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 23 Oct 2015 08:59:13 -0400 Subject: [PATCH 12/16] Lint of keywordsearch.Server --- .../autopsy/keywordsearch/Server.java | 57 ++++++------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index 50d5e962bd..0ec4205d75 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -158,7 +158,6 @@ public class Server { public static final Charset DEFAULT_INDEXED_TEXT_CHARSET = Charset.forName("UTF-8"); ///< default Charset to index text as private static final int MAX_SOLR_MEM_MB = 512; //TODO set dynamically based on avail. system resources private Process curSolrProcess = null; - private static Ingester ingester = null; static final String PROPERTIES_FILE = KeywordSearchSettings.MODULE_NAME; static final String PROPERTIES_CURRENT_SERVER_PORT = "IndexingServerPort"; //NON-NLS static final String PROPERTIES_CURRENT_STOP_PORT = "IndexingServerStopPort"; //NON-NLS @@ -291,13 +290,12 @@ public class Server { @Override public void run() { - InputStreamReader isr = new InputStreamReader(stream); - BufferedReader br = new BufferedReader(isr); - OutputStreamWriter osw = null; - BufferedWriter bw = null; - try { - osw = new OutputStreamWriter(out, PlatformUtil.getDefaultPlatformCharset()); - bw = new BufferedWriter(osw); + + try (InputStreamReader isr = new InputStreamReader(stream); + BufferedReader br = new BufferedReader(isr); + OutputStreamWriter osw = new OutputStreamWriter(out, PlatformUtil.getDefaultPlatformCharset()); + BufferedWriter bw = new BufferedWriter(osw);) { + String line = null; while (doRun && (line = br.readLine()) != null) { bw.write(line); @@ -309,22 +307,7 @@ public class Server { } bw.flush(); } catch (IOException ex) { - logger.log(Level.WARNING, "Error redirecting Solr output stream"); //NON-NLS - } finally { - if (bw != null) { - try { - bw.close(); - } catch (IOException ex) { - logger.log(Level.WARNING, "Error closing Solr output stream writer"); //NON-NLS - } - } - if (br != null) { - try { - br.close(); - } catch (IOException ex) { - logger.log(Level.WARNING, "Error closing Solr output stream reader"); //NON-NLS - } - } + logger.log(Level.SEVERE, "Error redirecting Solr output stream", ex); //NON-NLS } } } @@ -357,7 +340,7 @@ public class Server { void killSolr() { List solrPids = getSolrPIDs(); for (long pid : solrPids) { - logger.log(Level.INFO, "Trying to kill old Solr process, PID: " + pid); //NON-NLS + logger.log(Level.INFO, "Trying to kill old Solr process, PID: {0}", pid); //NON-NLS PlatformUtil.killProcess(pid); } } @@ -399,22 +382,12 @@ public class Server { } } - logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath()); //NON-NLS + logger.log(Level.INFO, "Starting Solr server from: {0}", solrFolder.getAbsolutePath()); //NON-NLS if (isPortAvailable(currentSolrServerPort)) { - logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr"); //NON-NLS + logger.log(Level.INFO, "Port [{0}] available, starting Solr", currentSolrServerPort); //NON-NLS try { final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m"; //NON-NLS - -// String loggingPropertiesOpt = "-Djava.util.logging.config.file="; //NON-NLS -// String loggingPropertiesFilePath = instanceDir + File.separator + "conf" + File.separator; //NON-NLS -// -// if (DEBUG) { -// loggingPropertiesFilePath += "logging-development.properties"; //NON-NLS -// } else { -// loggingPropertiesFilePath += "logging-release.properties"; //NON-NLS -// } -// final String loggingProperties = loggingPropertiesOpt + loggingPropertiesFilePath; List commandLine = new ArrayList<>(); commandLine.add(javaPath); commandLine.add(MAX_SOLR_MEM_MB_PAR); @@ -434,7 +407,7 @@ public class Server { Path solrStderrPath = Paths.get(Places.getUserDirectory().getAbsolutePath(), "var", "log", "solr.log.stderr"); solrProcessBuilder.redirectError(solrStderrPath.toFile()); - logger.log(Level.INFO, "Starting Solr using: " + solrProcessBuilder.command()); //NON-NLS + logger.log(Level.INFO, "Starting Solr using: {0}", solrProcessBuilder.command()); //NON-NLS curSolrProcess = solrProcessBuilder.start(); logger.log(Level.INFO, "Finished starting Solr"); //NON-NLS @@ -447,7 +420,7 @@ public class Server { } final List pids = this.getSolrPIDs(); - logger.log(Level.INFO, "New Solr process PID: " + pids); //NON-NLS + logger.log(Level.INFO, "New Solr process PID: {0}", pids); //NON-NLS } catch (SecurityException ex) { logger.log(Level.SEVERE, "Could not start Solr process!", ex); //NON-NLS throw new KeywordSearchModuleException( @@ -526,7 +499,7 @@ public class Server { } try { - logger.log(Level.INFO, "Stopping Solr server from: " + solrFolder.getAbsolutePath()); //NON-NLS + logger.log(Level.INFO, "Stopping Solr server from: {0}", solrFolder.getAbsolutePath()); //NON-NLS //try graceful shutdown final String[] SOLR_STOP_CMD = { @@ -1278,6 +1251,7 @@ public class Server { } class ServerAction extends AbstractAction { + private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { @@ -1289,11 +1263,12 @@ public class Server { * Exception thrown if solr port not available */ class SolrServerNoPortException extends SocketException { + private static final long serialVersionUID = 1L; /** * the port number that is not available */ - private int port; + private final int port; SolrServerNoPortException(int port) { super(NbBundle.getMessage(Server.class, "Server.solrServerNoPortException.msg", port, From 0a5575fb3759cf69d552ea8bec8c0df909fe4966 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 09:28:44 -0400 Subject: [PATCH 13/16] code review updates --- Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties | 1 - Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 6 +++--- .../core.jar/org/netbeans/core/startup/Bundle.properties | 2 +- .../org/netbeans/core/windows/view/ui/Bundle.properties | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 10b0487510..0c929caa83 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -261,5 +261,4 @@ NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user NewCaseVisualPanel1.multiUserSettingsWarningLabel.text=Multi-user settings warning label Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} -CaseOpenException.DatabaseSettingsIssue=Database settings: CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 2cfabe81d3..7f636435ac 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -464,7 +464,7 @@ public class Case implements SleuthkitCase.ErrorObserver { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); - throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage()); //NON-NLS + throw new CaseActionException(ex.getMessage(), ex); //NON-NLS } catch (UserPreferencesException ex) { logger.log(Level.SEVERE, "Error accessing case database connection info", ex); //NON-NLS throw new CaseActionException( @@ -635,7 +635,7 @@ public class Case implements SleuthkitCase.ErrorObserver { } catch (IllegalStateException unused) { // Already logged. } - throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.gen.msg") + ". " + ex.getMessage(), ex); //NON-NLS + throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.gen.msg") + ": " + ex.getMessage(), ex); //NON-NLS } catch (TskCoreException ex) { try { Case badCase = Case.getCurrentCase(); @@ -646,7 +646,7 @@ public class Case implements SleuthkitCase.ErrorObserver { SwingUtilities.invokeLater(() -> { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); - throw new CaseActionException(NbBundle.getMessage(Case.class, "CaseOpenException.DatabaseSettingsIssue") + " " + ex.getMessage(), ex); //NON-NLS + throw new CaseActionException(ex.getMessage(), ex); //NON-NLS } } diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index a41dd17420..7e3c904dd2 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Tue, 13 Oct 2015 17:00:33 -0400 +#Fri, 23 Oct 2015 09:28:23 -0400 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=314 SPLASH_WIDTH=538 diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index 5dd3fa12e1..fd051ed29c 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,4 +1,4 @@ #Updated by build script -#Tue, 13 Oct 2015 17:00:33 -0400 +#Fri, 23 Oct 2015 09:28:23 -0400 CTL_MainWindow_Title=Autopsy 3.1.3 CTL_MainWindow_Title_No_Project=Autopsy 3.1.3 From 2568cb45d887066bbc78e710df273399f8d499e7 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 09:43:39 -0400 Subject: [PATCH 14/16] remove extraneous UI element --- .../autopsy/casemodule/Bundle.properties | 1 - .../autopsy/casemodule/NewCaseVisualPanel1.form | 15 +-------------- .../autopsy/casemodule/NewCaseVisualPanel1.java | 12 ++---------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index b83bceff1e..c7916b48d0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -257,7 +257,6 @@ SingleUserCaseImporter.Cancelled=Cancelled NewCaseVisualPanel1.caseParentDirWarningLabel.text= NewCaseVisualPanel1.multiUserCaseRadioButton.text=Multi-user NewCaseVisualPanel1.singleUserCaseRadioButton.text=Single-user -NewCaseVisualPanel1.multiUserSettingsWarningLabel.text= Case.deleteReports.deleteFromDiskException.log.msg=Unable to delete the report from the disk. Case.deleteReports.deleteFromDiskException.msg=Unable to delete the report {0} from the disk.\nYou may manually delete it from {1} CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form index c30aa65b0b..697ac53348 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form @@ -43,7 +43,6 @@ - @@ -93,9 +92,7 @@ - - - + @@ -190,16 +187,6 @@ - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java index c2f41afbde..9d09d360fd 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java @@ -212,7 +212,6 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { caseDirTextField = new javax.swing.JTextField(); singleUserCaseRadioButton = new javax.swing.JRadioButton(); multiUserCaseRadioButton = new javax.swing.JRadioButton(); - multiUserSettingsWarningLabel = new javax.swing.JLabel(); caseParentDirWarningLabel = new javax.swing.JLabel(); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N @@ -254,9 +253,6 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { } }); - multiUserSettingsWarningLabel.setForeground(new java.awt.Color(255, 0, 0)); - org.openide.awt.Mnemonics.setLocalizedText(multiUserSettingsWarningLabel, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.multiUserSettingsWarningLabel.text")); // NOI18N - caseParentDirWarningLabel.setForeground(new java.awt.Color(255, 0, 0)); org.openide.awt.Mnemonics.setLocalizedText(caseParentDirWarningLabel, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.caseParentDirWarningLabel.text")); // NOI18N @@ -283,8 +279,7 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { .addGroup(layout.createSequentialGroup() .addComponent(caseNameLabel) .addGap(26, 26, 26) - .addComponent(caseNameTextField)) - .addComponent(multiUserSettingsWarningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(caseNameTextField))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(caseDirBrowseButton))) .addContainerGap()) @@ -321,9 +316,7 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { .addComponent(multiUserCaseRadioButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(caseParentDirWarningLabel) - .addGap(1, 1, 1) - .addComponent(multiUserSettingsWarningLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(35, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -368,7 +361,6 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JRadioButton multiUserCaseRadioButton; - private javax.swing.JLabel multiUserSettingsWarningLabel; private javax.swing.JRadioButton singleUserCaseRadioButton; // End of variables declaration//GEN-END:variables From d45ba54f9a29264409e320397bcd033be0d6132d Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 09:53:46 -0400 Subject: [PATCH 15/16] bump version --- Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties index 06146d2d8f..d2522a3a81 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties @@ -27,7 +27,7 @@ Format_OperatingSystem_Value={0} version {1} running on {2} LBL_Copyright=
Autopsy™ is a digital forensics platform based on The Sleuth Kit™ and other tools.
Copyright © 2003-2014.
URL_ON_IMG=http://www.sleuthkit.org/ -URL_ON_HELP=http://sleuthkit.org/autopsy/docs/user-docs/3.1/ +URL_ON_HELP=http://sleuthkit.org/autopsy/docs/user-docs/4.0/ FILE_FOR_LOCAL_HELP=file:/// INDEX_FOR_LOCAL_HELP=/docs/index.html From a76821e1236ba50b0581913ac25118dfe0e7776c Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 23 Oct 2015 10:24:22 -0400 Subject: [PATCH 16/16] Additional linting of keywordsearch.Server --- .../src/org/sleuthkit/autopsy/keywordsearch/Server.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index 0ec4205d75..be87190bc1 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -167,6 +167,7 @@ public class Server { static final int DEFAULT_SOLR_STOP_PORT = 34343; private int currentSolrServerPort = 0; private int currentSolrStopPort = 0; + private volatile Core currentCore = null; private static final boolean DEBUG = false;//(Version.getBuildType() == Version.Type.DEVELOPMENT); private final UNCPathUtilities uncPathUtilities = new UNCPathUtilities(); @@ -182,7 +183,7 @@ public class Server { // This could be a local or remote server. private HttpSolrServer currentSolrServer; - private final String instanceDir; +// private final String instanceDir; private final File solrFolder; private final ServerAction serverAction; private InputStreamPrinterThread errorRedirectThread; @@ -197,7 +198,7 @@ public class Server { this.localSolrServer = new HttpSolrServer("http://localhost:" + currentSolrServerPort + "/solr"); //NON-NLS serverAction = new ServerAction(); solrFolder = InstalledFileLocator.getDefault().locate("solr", Server.class.getPackage().getName(), false); //NON-NLS - instanceDir = solrFolder.getAbsolutePath() + File.separator + "solr"; //NON-NLS +// instanceDir = solrFolder.getAbsolutePath() + File.separator + "solr"; //NON-NLS javaPath = PlatformUtil.getJavaPath(); logger.log(Level.INFO, "Created Server instance"); //NON-NLS @@ -586,10 +587,10 @@ public class Server { return true; } - /** + + /* * ** Convenience methods for use while we only open one case at a time *** */ - private volatile Core currentCore = null; synchronized void openCore() throws KeywordSearchModuleException { if (currentCore != null) {