From 24e661afc7970192709764218dbdcb467fdeeaad Mon Sep 17 00:00:00 2001 From: Eugene Livis Date: Thu, 22 Oct 2015 14:45:25 -0400 Subject: [PATCH 1/6] Disable multi-user cases for non-Windows platforms --- .../autopsy/casemodule/Bundle.properties | 2 +- .../autopsy/core/UserPreferences.java | 5 ++++ .../autopsy/corecomponents/Bundle.properties | 1 + .../MultiUserSettingsPanel.form | 4 ++-- .../MultiUserSettingsPanel.java | 24 ++++++++++++++++--- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index c9a86ea72f..18e8d578a6 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -192,7 +192,7 @@ 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. +NewCaseVisualPanel1.MultiUserDisabled.text=Multi-user cases are 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 diff --git a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java index a9909593b0..03c97a0479 100755 --- a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java +++ b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java @@ -30,6 +30,7 @@ import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; import org.openide.util.NbBundle; import org.openide.util.NbPreferences; +import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.datamodel.CaseDbConnectionInfo; import org.sleuthkit.datamodel.TskData.DbType; @@ -39,6 +40,7 @@ import org.sleuthkit.datamodel.TskData.DbType; */ public final class UserPreferences { + private static final boolean isWindowsOS = PlatformUtil.isWindowsOS(); private static final Preferences preferences = NbPreferences.forModule(UserPreferences.class); public static final String KEEP_PREFERRED_VIEWER = "KeepPreferredViewer"; // NON-NLS public static final String HIDE_KNOWN_FILES_IN_DATA_SOURCES_TREE = "HideKnownFilesInDataSourcesTree"; //NON-NLS @@ -177,6 +179,9 @@ public final class UserPreferences { } public static boolean getIsMultiUserModeEnabled() { + if (!isWindowsOS) { + return false; + } return preferences.getBoolean(IS_MULTI_USER_MODE_ENABLED, false); } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties index 06146d2d8f..c1f259014e 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties @@ -153,6 +153,7 @@ MultiUserSettingsPanel.lbSolrSettings.text=Solr Settings MultiUserSettingsPanel.cbEnableMultiUser.text=Enable Multi-user cases MultiUserSettingsPanel.lbDatabaseSettings.text=Database Settings MultiUserSettingsPanel.validationErrMsg.incomplete=Fill in all values +MultiUserSettingsPanel.nonWindowsOs.msg=Multi-user cases are only available on Windows platforms MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort=Invalid database port number MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort=Invalid message service port number MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort=Invalid Solr server port number diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form index 57f1eca7d5..e15416659f 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form @@ -16,12 +16,12 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java index 0a26244edc..03c3bdf7c5 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java @@ -23,6 +23,7 @@ import javax.swing.ImageIcon; import org.openide.util.ImageUtilities; import org.openide.util.Lookup; import org.sleuthkit.autopsy.core.UserPreferencesException; +import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.events.MessageServiceException; import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService; import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchServiceException; @@ -39,7 +40,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { private static final String INVALID_DB_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidDatabasePort"); private static final String INVALID_MESSAGE_SERVICE_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidMessageServicePort"); private static final String INVALID_INDEXING_SERVER_PORT_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.validationErrMsg.invalidIndexingServerPort"); - private static final int DEFAULT_MESSAGE_SERVICE_PORT = 61616; + private static final String NON_WINDOWS_OS_MSG = NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.nonWindowsOs.msg"); private static final long serialVersionUID = 1L; private final MultiUserSettingsPanelController controller; private final Collection textBoxes = new ArrayList<>(); @@ -47,6 +48,7 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { private static final Logger logger = Logger.getLogger(MultiUserSettingsPanel.class.getName()); private final ImageIcon goodIcon; private final ImageIcon badIcon; + private static final boolean isWindowsOS = PlatformUtil.isWindowsOS(); /** * Creates new form AutopsyMultiUserSettingsPanel @@ -105,6 +107,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { addDocumentListeners(textBoxes, textBoxChangedListener); goodIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/good.png", false)); badIcon = new ImageIcon(ImageUtilities.loadImage("org/sleuthkit/autopsy/images/bad.png", false)); + if (!isWindowsOS) { + cbEnableMultiUser.setEnabled(false); + cbEnableMultiUser.setSelected(false); + } enableMultiUserComponents(textBoxes, cbEnableMultiUser.isSelected()); } @@ -457,7 +463,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { private void cbEnableMultiUserItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbEnableMultiUserItemStateChanged if (!cbEnableMultiUser.isSelected()) { - tbOops.setText(""); + if (!isWindowsOS) { + tbOops.setText(NON_WINDOWS_OS_MSG); + } else { + tbOops.setText(""); + } bnTestDatabase.setEnabled(false); lbTestDatabase.setIcon(null); bnTestSolr.setEnabled(false); @@ -640,6 +650,10 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { } void store() { + if (!isWindowsOS) { + return; + } + DbType dbType = DbType.SQLITE; if (cbEnableMultiUser.isSelected()) { @@ -691,7 +705,11 @@ public final class MultiUserSettingsPanel extends javax.swing.JPanel { * @return true if it's okay, false otherwise. */ boolean valid() { - tbOops.setText(""); + if (!isWindowsOS) { + tbOops.setText(NON_WINDOWS_OS_MSG); + } else { + tbOops.setText(""); + } if (cbEnableMultiUser.isSelected()) { return checkFieldsAndEnableButtons() From 0ef944344e4f685376ea09dc545c026eeece8e58 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 10:56:21 -0400 Subject: [PATCH 2/6] prompt before closing a case, if we are currently ingesting --- .../autopsy/casemodule/Bundle.properties | 4 +- .../autopsy/casemodule/CaseCloseAction.java | 64 ++++++++--- .../autopsy/casemodule/CaseOpenAction.java | 103 ++++++++++++------ .../casemodule/NewCaseWizardAction.java | 36 +++--- .../autopsy/casemodule/RecentItems.java | 95 ++++++++++------ 5 files changed, 196 insertions(+), 106 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 0c929caa83..a9c5f50e5a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -194,8 +194,6 @@ 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 NewCaseWizardAction.newCase.windowTitle.text=New Case Information NewCaseWizardAction.getName.text=New Case Wizard NewCaseWizardAction.databaseProblem1.text=Cannot open database. Cancelling case creation. @@ -262,3 +260,5 @@ 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} CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. +CloseCaseWhileIngesting.Warning=Proceeding will close the open case, which is currently ingesting. Proceed? +CloseCaseWhileIngesting.Warning.title=Warning\: This will close the current case diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index 1fc7c79575..d8ecd82996 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -28,6 +28,12 @@ import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.ingest.IngestManager; +import java.util.logging.Level; +import org.openide.DialogDescriptor; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; /** * The action to close the current Case. This class should be disabled on @@ -57,28 +63,52 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese */ @Override public void actionPerformed(ActionEvent e) { - if (Case.existsCurrentCase() == false) { - return; + boolean proceedWithAction = true; + // if ingest is ongoing, warn and get confirmaion before opening a different case + if (IngestManager.getInstance().isIngestRunning()) { + // show the confirmation first to close the current case and open the "New Case" wizard panel + String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), + NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); + descriptor.setValue(NotifyDescriptor.NO_OPTION); + + Object res = DialogDisplayer.getDefault().notify(descriptor); + if (res != null && res == DialogDescriptor.YES_OPTION) { + try { + Case.getCurrentCase().closeCase(); // close the current case + } catch (Exception ex) { + Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS + } + } else { + proceedWithAction = false; + } } - new SwingWorker() { + if (proceedWithAction) { + if (Case.existsCurrentCase() == false) { + return; + } - @Override - protected Void doInBackground() throws Exception { - try { - Case result = Case.getCurrentCase(); - result.closeCase(); - } catch (CaseActionException | IllegalStateException unused) { - // Already logged. + new SwingWorker() { + + @Override + protected Void doInBackground() throws Exception { + try { + Case result = Case.getCurrentCase(); + result.closeCase(); + } catch (CaseActionException | IllegalStateException unused) { + // Already logged. + } + return null; } - return null; - } - @Override - protected void done() { - StartupWindowProvider.getInstance().open(); - } - }.execute(); + @Override + protected void done() { + StartupWindowProvider.getInstance().open(); + } + }.execute(); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 2a03307cf5..636ee99a54 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -32,6 +32,12 @@ import org.openide.util.lookup.ServiceProvider; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.Version; +import org.openide.DialogDescriptor; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.sleuthkit.autopsy.coreutils.Logger; +import java.util.logging.Level; +import org.sleuthkit.autopsy.ingest.IngestManager; /** * An action that opens an existing case. @@ -65,44 +71,69 @@ public final class CaseOpenAction implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - /** - * Pop up a file chooser to allow the user to select a case meta data - * file (.aut file) - */ - int retval = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()); - if (retval == JFileChooser.APPROVE_OPTION) { - /** - * This is a bit of a hack, but close the startup window, if it was - * the source of the action invocation. - */ - try { - StartupWindowProvider.getInstance().close(); - } catch (Exception unused) { - } - /** - * 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(() -> { + boolean proceedWithAction = true; + // if ingest is ongoing, warn and get confirmaion before opening a different case + if (IngestManager.getInstance().isIngestRunning()) { + // show the confirmation first to close the current case and open the "New Case" wizard panel + String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), + NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); + descriptor.setValue(NotifyDescriptor.NO_OPTION); + + Object res = DialogDisplayer.getDefault().notify(descriptor); + if (res != null && res == DialogDescriptor.YES_OPTION) { try { - Case.open(path); - } catch (CaseActionException ex) { - SwingUtilities.invokeLater(() -> { - 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(); - } - }); - } - }).start(); + Case.getCurrentCase().closeCase(); // close the current case + } catch (Exception ex) { + Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS + } + } else { + proceedWithAction = false; + } + } + + if (proceedWithAction) { + /** + * Pop up a file chooser to allow the user to select a case meta + * data file (.aut file) + */ + int retval = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()); + if (retval == JFileChooser.APPROVE_OPTION) { + /** + * This is a bit of a hack, but close the startup window, if it + * was the source of the action invocation. + */ + try { + StartupWindowProvider.getInstance().close(); + } catch (Exception unused) { + } + + /** + * 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(() -> { + 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(); + } + }); + } + }).start(); + } } } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 09659fcefa..348b8cc107 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -39,15 +39,9 @@ import javax.swing.JOptionPane; import org.sleuthkit.autopsy.casemodule.Case.CaseType; 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; -import org.sleuthkit.autopsy.core.UserPreferencesException; +import org.sleuthkit.autopsy.ingest.IngestManager; /** * Action to open the New Case wizard. @@ -62,28 +56,30 @@ final class NewCaseWizardAction extends CallableSystemAction { @Override public void performAction() { - // there's a case open - if (Case.existsCurrentCase()) { + boolean proceedWithAction = true; + // if ingest is ongoing, warn and get confirmaion before opening a different case + if (IngestManager.getInstance().isIngestRunning()) { // show the confirmation first to close the current case and open the "New Case" wizard panel - String closeCurrentCase = NbBundle - .getMessage(this.getClass(), "NewCaseWizardAction.closeCurCase.confMsg.msg"); - NotifyDescriptor d = new NotifyDescriptor.Confirmation(closeCurrentCase, - NbBundle.getMessage(this.getClass(), - "NewCaseWizardAction.closeCurCase.confMsg.title"), + String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); - d.setValue(NotifyDescriptor.NO_OPTION); + descriptor.setValue(NotifyDescriptor.NO_OPTION); - Object res = DialogDisplayer.getDefault().notify(d); + Object res = DialogDisplayer.getDefault().notify(descriptor); if (res != null && res == DialogDescriptor.YES_OPTION) { try { Case.getCurrentCase().closeCase(); // close the current case - newCaseAction(); // start the new case creation process } catch (Exception ex) { Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } + } else { + proceedWithAction = false; } - } else { - newCaseAction(); + } + + if (proceedWithAction) { + newCaseAction(); // start the new case creation process } } @@ -120,6 +116,8 @@ final class NewCaseWizardAction extends CallableSystemAction { 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(); AddImageAction addImageAction = SystemAction.get(AddImageAction.class); addImageAction.actionPerformed(null); } catch (Exception ex) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 7782ba6230..08fb5fa3aa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -28,6 +28,12 @@ import javax.swing.SwingUtilities; import org.openide.util.NbBundle; import org.openide.windows.WindowManager; import java.awt.Cursor; +import java.util.logging.Level; +import org.openide.DialogDescriptor; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.ingest.IngestManager; /** * This class is used to add the action to the recent case menu item. When the @@ -54,42 +60,67 @@ class RecentItems implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - // check if the file exists - if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { - // throw an error here - JOptionPane.showMessageDialog(caller, - NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", - caseName), - NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.err"), - JOptionPane.ERROR_MESSAGE); - RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore - //if case is not opened, open the start window - if (Case.isCaseOpen() == false) { - EventQueue.invokeLater(() -> { - StartupWindowProvider.getInstance().open(); - }); + boolean proceedWithAction = true; + // if ingest is ongoing, warn and get confirmaion before opening a different case + if (IngestManager.getInstance().isIngestRunning()) { + // show the confirmation first to close the current case and open the "New Case" wizard panel + String closeCurrentCase = NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning"); + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(closeCurrentCase, + NbBundle.getMessage(this.getClass(), "CloseCaseWhileIngesting.Warning.title"), + NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE); + descriptor.setValue(NotifyDescriptor.NO_OPTION); - } - } else { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - }); - new Thread(() -> { - // Create case. + Object res = DialogDisplayer.getDefault().notify(descriptor); + if (res != null && res == DialogDescriptor.YES_OPTION) { try { - Case.open(casePath); - } catch (CaseActionException ex) { - SwingUtilities.invokeLater(() -> { - 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(); - } - }); + Case.getCurrentCase().closeCase(); // close the current case + } catch (Exception ex) { + Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } - }).start(); + } else { + proceedWithAction = false; + } + } + + if (proceedWithAction) { + // check if the file exists + if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { + // throw an error here + JOptionPane.showMessageDialog(caller, + NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", + caseName), + NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.err"), + JOptionPane.ERROR_MESSAGE); + RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore + + //if case is not opened, open the start window + if (Case.isCaseOpen() == false) { + EventQueue.invokeLater(() -> { + StartupWindowProvider.getInstance().open(); + }); + + } + } 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(() -> { + 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(); + } + }); + } + }).start(); + } } } } From 090ac9cad9c6a09aeba6f48f26e3513a9a1f1742 Mon Sep 17 00:00:00 2001 From: momo Date: Fri, 23 Oct 2015 11:06:42 -0400 Subject: [PATCH 3/6] revert property changes --- nbproject/platform.properties | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nbproject/platform.properties b/nbproject/platform.properties index b7dde1d50c..6c3e50c82d 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,6 +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 + org.netbeans.spi.java.hints \ No newline at end of file From ac27960e4e67eac5117b7fe7fcc3a2cbd881a948 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 11:08:26 -0400 Subject: [PATCH 4/6] cursor update --- .../org/sleuthkit/autopsy/casemodule/CaseCloseAction.java | 5 ++++- .../sleuthkit/autopsy/casemodule/NewCaseWizardAction.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index d8ecd82996..cbc817b533 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -34,6 +34,8 @@ import java.util.logging.Level; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; +import org.openide.windows.WindowManager; +import java.awt.Cursor; /** * The action to close the current Case. This class should be disabled on @@ -89,7 +91,7 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese if (Case.existsCurrentCase() == false) { return; } - + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); new SwingWorker() { @Override @@ -105,6 +107,7 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese @Override protected void done() { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); StartupWindowProvider.getInstance().open(); } }.execute(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 348b8cc107..9dc704be75 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -79,6 +79,7 @@ final class NewCaseWizardAction extends CallableSystemAction { } if (proceedWithAction) { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); newCaseAction(); // start the new case creation process } } From 1f4e2112d9b1b46cac2335cbd753f759cdb7ba3b Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 11:57:18 -0400 Subject: [PATCH 5/6] use early out --- .../autopsy/casemodule/Bundle.properties | 2 +- .../autopsy/casemodule/CaseCloseAction.java | 52 +++++++------ .../autopsy/casemodule/CaseOpenAction.java | 75 +++++++++---------- .../casemodule/NewCaseWizardAction.java | 10 +-- .../autopsy/casemodule/RecentItems.java | 71 +++++++++--------- 5 files changed, 100 insertions(+), 110 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 7060f9a1e9..ccba954c84 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -262,5 +262,5 @@ CasePropertiesForm.tbDbType.text= CasePropertiesForm.lbDbName.text=Database Name: CasePropertiesForm.tbDbName.text= CaseExceptionWarning.CheckMultiUserOptions=Check Multi-user options. -CloseCaseWhileIngesting.Warning=Proceeding will close the open case, which is currently ingesting. Proceed? +CloseCaseWhileIngesting.Warning=Ingest is running. Are you sure you want to close the case? CloseCaseWhileIngesting.Warning.title=Warning\: This will close the current case diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index cbc817b533..ce97a09c9d 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -65,7 +65,7 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese */ @Override public void actionPerformed(ActionEvent e) { - boolean proceedWithAction = true; + // if ingest is ongoing, warn and get confirmaion before opening a different case if (IngestManager.getInstance().isIngestRunning()) { // show the confirmation first to close the current case and open the "New Case" wizard panel @@ -83,35 +83,33 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } } else { - proceedWithAction = false; - } - } - - if (proceedWithAction) { - if (Case.existsCurrentCase() == false) { return; } - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - new SwingWorker() { - - @Override - protected Void doInBackground() throws Exception { - try { - Case result = Case.getCurrentCase(); - result.closeCase(); - } catch (CaseActionException | IllegalStateException unused) { - // Already logged. - } - return null; - } - - @Override - protected void done() { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - StartupWindowProvider.getInstance().open(); - } - }.execute(); } + + if (Case.existsCurrentCase() == false) { + return; + } + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + new SwingWorker() { + + @Override + protected Void doInBackground() throws Exception { + try { + Case result = Case.getCurrentCase(); + result.closeCase(); + } catch (CaseActionException | IllegalStateException unused) { + // Already logged. + } + return null; + } + + @Override + protected void done() { + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + StartupWindowProvider.getInstance().open(); + } + }.execute(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 636ee99a54..63ddefebf8 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -72,7 +72,6 @@ public final class CaseOpenAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - boolean proceedWithAction = true; // if ingest is ongoing, warn and get confirmaion before opening a different case if (IngestManager.getInstance().isIngestRunning()) { // show the confirmation first to close the current case and open the "New Case" wizard panel @@ -90,50 +89,48 @@ public final class CaseOpenAction implements ActionListener { Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } } else { - proceedWithAction = false; + return; } } - if (proceedWithAction) { + /** + * Pop up a file chooser to allow the user to select a case meta data + * file (.aut file) + */ + int retval = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()); + if (retval == JFileChooser.APPROVE_OPTION) { /** - * Pop up a file chooser to allow the user to select a case meta - * data file (.aut file) + * This is a bit of a hack, but close the startup window, if it was + * the source of the action invocation. */ - int retval = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()); - if (retval == JFileChooser.APPROVE_OPTION) { - /** - * This is a bit of a hack, but close the startup window, if it - * was the source of the action invocation. - */ - try { - StartupWindowProvider.getInstance().close(); - } catch (Exception unused) { - } - - /** - * 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(() -> { - 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(); - } - }); - } - }).start(); + try { + StartupWindowProvider.getInstance().close(); + } catch (Exception unused) { } + + /** + * 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(() -> { + 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(); + } + }); + } + }).start(); } } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 9dc704be75..491f66ba5e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -56,7 +56,7 @@ final class NewCaseWizardAction extends CallableSystemAction { @Override public void performAction() { - boolean proceedWithAction = true; + // if ingest is ongoing, warn and get confirmaion before opening a different case if (IngestManager.getInstance().isIngestRunning()) { // show the confirmation first to close the current case and open the "New Case" wizard panel @@ -74,14 +74,12 @@ final class NewCaseWizardAction extends CallableSystemAction { Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } } else { - proceedWithAction = false; + return; } } - if (proceedWithAction) { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - newCaseAction(); // start the new case creation process - } + WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + newCaseAction(); // start the new case creation process } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 08fb5fa3aa..8e9c989d5a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -61,7 +61,6 @@ class RecentItems implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - boolean proceedWithAction = true; // if ingest is ongoing, warn and get confirmaion before opening a different case if (IngestManager.getInstance().isIngestRunning()) { // show the confirmation first to close the current case and open the "New Case" wizard panel @@ -79,48 +78,46 @@ class RecentItems implements ActionListener { Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } } else { - proceedWithAction = false; + return; } } - if (proceedWithAction) { - // check if the file exists - if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { - // throw an error here - JOptionPane.showMessageDialog(caller, - NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", - caseName), - NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.err"), - JOptionPane.ERROR_MESSAGE); - RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore + // check if the file exists + if (caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())) { + // throw an error here + JOptionPane.showMessageDialog(caller, + NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", + caseName), + NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.err"), + JOptionPane.ERROR_MESSAGE); + RecentCases.getInstance().removeRecentCase(caseName, casePath); // remove the recent case if it doesn't exist anymore - //if case is not opened, open the start window - if (Case.isCaseOpen() == false) { - EventQueue.invokeLater(() -> { - StartupWindowProvider.getInstance().open(); - }); - - } - } else { - SwingUtilities.invokeLater(() -> { - WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + //if case is not opened, open the start window + if (Case.isCaseOpen() == false) { + EventQueue.invokeLater(() -> { + StartupWindowProvider.getInstance().open(); }); - new Thread(() -> { - // Create case. - try { - Case.open(casePath); - } catch (CaseActionException ex) { - SwingUtilities.invokeLater(() -> { - 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(); - } - }); - } - }).start(); + } + } 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(() -> { + 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(); + } + }); + } + }).start(); } } } From a72b9f8adb6e23ce706e574df9306501e1842bd3 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Fri, 23 Oct 2015 12:01:19 -0400 Subject: [PATCH 6/6] update version information from 3.1 to 4.0 in documentation --- docs/doxygen-user/android.dox | 2 +- docs/doxygen-user/android_analyzer.dox | 2 +- docs/doxygen-user/main.dox | 2 +- docs/doxygen/main.dox | 2 +- docs/doxygen/modIngest.dox | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/doxygen-user/android.dox b/docs/doxygen-user/android.dox index 04733581eb..b8ccf83dc9 100644 --- a/docs/doxygen-user/android.dox +++ b/docs/doxygen-user/android.dox @@ -6,7 +6,7 @@ The Android Analyzer module allows you to analyze SQLite and other files from an Simply add your physical images or file system dumps as data sources and enable the Android Analyzer module. -NOTE: This module is not exhaustive with its support for Android. It was created as a starting point for others to contribute plug-ins for 3rd party apps. See the Developer docs (http://sleuthkit.org/autopsy/docs/api-docs/3.1/mod_mobile_page.html) for information on writing modules. +NOTE: This module is not exhaustive with its support for Android. It was created as a starting point for others to contribute plug-ins for 3rd party apps. See the Developer docs (http://sleuthkit.org/autopsy/docs/api-docs/4.0/mod_mobile_page.html) for information on writing modules. Analysis diff --git a/docs/doxygen-user/android_analyzer.dox b/docs/doxygen-user/android_analyzer.dox index f23df9714c..0943bd05c9 100755 --- a/docs/doxygen-user/android_analyzer.dox +++ b/docs/doxygen-user/android_analyzer.dox @@ -18,7 +18,7 @@ The module should be able to extract the following: NOTE: These database formats vary by version of OS and different vendors can place the databases in different places. Autopsy may not support all versions and vendors. -NOTE: This module is not exhaustive with its support for Android. It was created as a starting point for others to contribute plug-ins for 3rd party apps. See the Developer docs for information on writing modules. +NOTE: This module is not exhaustive with its support for Android. It was created as a starting point for others to contribute plug-ins for 3rd party apps. See the Developer docs for information on writing modules. Configuration diff --git a/docs/doxygen-user/main.dox b/docs/doxygen-user/main.dox index e3ded15e32..aa8724840b 100644 --- a/docs/doxygen-user/main.dox +++ b/docs/doxygen-user/main.dox @@ -4,7 +4,7 @@ Overview ----- -This is the User's Guide for the open source Autopsy platform. Autopsy allows you to examine a hard drive or mobile device and recover evidence from it. This guide should help you with using Autopsy. The developer's guide will help you develop your own Autopsy modules. +This is the User's Guide for the open source Autopsy platform. Autopsy allows you to examine a hard drive or mobile device and recover evidence from it. This guide should help you with using Autopsy. The developer's guide will help you develop your own Autopsy modules. Autopsy 4 (and 3) are a complete rewrite from Autopsy 2, and none of this document is relevant to Autopsy 2. diff --git a/docs/doxygen/main.dox b/docs/doxygen/main.dox index 17ba30d6e7..9b4510f820 100755 --- a/docs/doxygen/main.dox +++ b/docs/doxygen/main.dox @@ -18,7 +18,7 @@ If you want to write modules, then these pages are for you: - \subpage mod_content_page - \subpage mod_result_page - \subpage adv_dev_page -- \subpage query_database_page +- Query the Database - \subpage mod_mobile_page These pages are more detailed if you want to modify Autopsy code instead of writing add-on modules. diff --git a/docs/doxygen/modIngest.dox b/docs/doxygen/modIngest.dox index 0f3d4a1ebb..4a88c317b0 100755 --- a/docs/doxygen/modIngest.dox +++ b/docs/doxygen/modIngest.dox @@ -43,7 +43,7 @@ ingest modules. \section ingest_modules_lifecycle Ingest Module Life Cycle -Before we dive into the details of creating a module, it is important to understand the life cycle of the module. Note that this life cycle is much different for Autopsy 3.1 modules compared to Autopsy 3.0 modules. This section only talks about 3.1 modules. +Before we dive into the details of creating a module, it is important to understand the life cycle of the module. Note that this life cycle is much different for Autopsy 3.1 and newer modules compared to Autopsy 3.0 modules. This section only talks about 3.1 and newer modules. You will need to implement at least two classes to make an ingest module: -# A factory class that will be created when Autopsy starts and will provide configuration panels to Autopsy and will create instances of your ingest module. @@ -319,7 +319,7 @@ databases from the hash databases manager. -\section ingest_modules_api_migration Migrating 3.0 Java Ingest Modules to the 3.1 API +\section ingest_modules_api_migration Migrating 3.0 Java Ingest Modules to the 3.1 and newer API This section is a guide for module developers who wrote modules for the 3.0 API. These API changes occurred so that we could make parallel pipelines of the file-level ingest modules. This section assumes you've read the above description of the new API.