Merge pull request #3077 from millmanorama/2978-db-version-compatibility

2978 db version compatibility
This commit is contained in:
Richard Cordovano 2017-09-20 12:36:04 -04:00 committed by GitHub
commit e645d4bc14
3 changed files with 29 additions and 21 deletions

View File

@ -93,10 +93,8 @@ AddImageWizardIngestConfigVisual.getName.text=Configure Ingest Modules
AddImageWizardIterator.stepXofN=Step {0} of {1} AddImageWizardIterator.stepXofN=Step {0} of {1}
AddLocalFilesTask.localFileAdd.progress.text=Adding\: {0}/{1} AddLocalFilesTask.localFileAdd.progress.text=Adding\: {0}/{1}
Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open\! Case.getCurCase.exception.noneOpen=Cannot get the current case; there is no case open\!
Case.databaseConnectionInfo.error.msg=Error accessing database server connection info. See Tools, Options, Multi-user.
Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the database with the following path has been made\:\n {0} Case.open.msgDlg.updated.msg=Updated case database schema.\nA backup copy of the database with the following path has been made\:\n {0}
Case.open.msgDlg.updated.title=Case Database Schema Update Case.open.msgDlg.updated.title=Case Database Schema Update
Case.open.exception.multiUserCaseNotEnabled=Cannot open a multi-user case if multi-user cases are not enabled. See Tools, Options, Multi-user.
Case.checkImgExist.confDlg.doesntExist.msg=One of the images associated with \n\ Case.checkImgExist.confDlg.doesntExist.msg=One of the images associated with \n\
this case are missing. Would you like to search for them now?\n\ this case are missing. Would you like to search for them now?\n\
Previously, the image was located at\:\n\ Previously, the image was located at\:\n\
@ -131,7 +129,6 @@ Close the folder and file and try again or you can delete the case manually.
CaseDeleteAction.msgDlg.fileInUse.title=Error\: Folder In Use CaseDeleteAction.msgDlg.fileInUse.title=Error\: Folder In Use
CaseDeleteAction.msgDlg.caseDelete.msg=Case {0} has been deleted. CaseDeleteAction.msgDlg.caseDelete.msg=Case {0} has been deleted.
CaseOpenAction.autFilter.title={0} Case File ( {1}) CaseOpenAction.autFilter.title={0} Case File ( {1})
CaseOpenAction.msgDlg.cantOpenCase.title=Error Opening Case
CaseCreateAction.msgDlg.cantCreateCase.msg=Cannot create case CaseCreateAction.msgDlg.cantCreateCase.msg=Cannot create case
IntervalErrorReport.NewIssues=new issue(s) IntervalErrorReport.NewIssues=new issue(s)
IntervalErrorReport.TotalIssues=total issue(s) IntervalErrorReport.TotalIssues=total issue(s)
@ -184,7 +181,6 @@ OpenRecentCasePanel.colName.caseName=Case Name
OpenRecentCasePanel.colName.path=Path OpenRecentCasePanel.colName.path=Path
RecentCases.exception.caseIdxOutOfRange.msg=Recent case index {0} is out of range. RecentCases.exception.caseIdxOutOfRange.msg=Recent case index {0} is out of range.
RecentCases.getName.text=Clear Recent Cases RecentCases.getName.text=Clear Recent Cases
RecentItems.openRecentCase.msgDlg.text=Case {0} no longer exists.
StartupWindow.title.text=Welcome StartupWindow.title.text=Welcome
UpdateRecentCases.menuItem.clearRecentCases.text=Clear Recent Cases UpdateRecentCases.menuItem.clearRecentCases.text=Clear Recent Cases
UpdateRecentCases.menuItem.empty=-Empty- UpdateRecentCases.menuItem.empty=-Empty-

View File

@ -65,6 +65,7 @@ import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.actions.OpenOutputFolderAction; import org.sleuthkit.autopsy.actions.OpenOutputFolderAction;
import org.sleuthkit.autopsy.appservices.AutopsyService; import org.sleuthkit.autopsy.appservices.AutopsyService;
import org.sleuthkit.autopsy.appservices.AutopsyService.CaseContext; import org.sleuthkit.autopsy.appservices.AutopsyService.CaseContext;
import static org.sleuthkit.autopsy.casemodule.Bundle.*;
import org.sleuthkit.autopsy.casemodule.CaseMetadata.CaseMetadataException; import org.sleuthkit.autopsy.casemodule.CaseMetadata.CaseMetadataException;
import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceEvent; import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceEvent;
import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceFailedEvent; import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceFailedEvent;
@ -110,6 +111,7 @@ import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.Report; import org.sleuthkit.datamodel.Report;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskUnsupportedSchemaVersionException;
/** /**
* An Autopsy case. Currently, only one case at a time may be open. * An Autopsy case. Currently, only one case at a time may be open.
@ -376,6 +378,7 @@ public class Case {
* *
* @param eventNames The events the subscriber is interested in. * @param eventNames The events the subscriber is interested in.
* @param subscriber The subscriber (PropertyChangeListener) to add. * @param subscriber The subscriber (PropertyChangeListener) to add.
*
* @deprecated Use addEventTypeSubscriber instead. * @deprecated Use addEventTypeSubscriber instead.
*/ */
@Deprecated @Deprecated
@ -400,6 +403,7 @@ public class Case {
* *
* @param eventName The event the subscriber is interested in. * @param eventName The event the subscriber is interested in.
* @param subscriber The subscriber (PropertyChangeListener) to add. * @param subscriber The subscriber (PropertyChangeListener) to add.
*
* @deprecated Use addEventTypeSubscriber instead. * @deprecated Use addEventTypeSubscriber instead.
*/ */
@Deprecated @Deprecated
@ -1786,7 +1790,11 @@ public class Case {
*/ */
@Messages({ @Messages({
"Case.progressMessage.openingCaseDatabase=Opening case database...", "Case.progressMessage.openingCaseDatabase=Opening case database...",
"Case.exceptionMessage.couldNotOpenCaseDatabase=Failed to open case database." "Case.exceptionMessage.couldNotOpenCaseDatabase=Failed to open case database.",
"Case.unsupportedSchemaVersionMessage=Unsupported DB schema version - see log for details",
"Case.databaseConnectionInfo.error.msg=Error accessing database server connection info. See Tools, Options, Multi-User.",
"Case.open.exception.multiUserCaseNotEnabled=Cannot open a multi-user case if multi-user cases are not enabled. "
+ "See Tools, Options, Multi-user."
}) })
private void openCaseData(ProgressIndicator progressIndicator) throws CaseActionException { private void openCaseData(ProgressIndicator progressIndicator) throws CaseActionException {
try { try {
@ -1797,16 +1805,14 @@ public class Case {
} else if (UserPreferences.getIsMultiUserModeEnabled()) { } else if (UserPreferences.getIsMultiUserModeEnabled()) {
try { try {
caseDb = SleuthkitCase.openCase(databaseName, UserPreferences.getDatabaseConnectionInfo(), metadata.getCaseDirectory()); caseDb = SleuthkitCase.openCase(databaseName, UserPreferences.getDatabaseConnectionInfo(), metadata.getCaseDirectory());
} catch (UserPreferencesException ex) { } catch (UserPreferencesException ex) {
throw new CaseActionException(NbBundle.getMessage(Case.class, throw new CaseActionException(Case_databaseConnectionInfo_error_msg(), ex);
"Case.databaseConnectionInfo.error.msg"), ex);
} }
} else { } else {
throw new CaseActionException(NbBundle.getMessage(Case.class, throw new CaseActionException(Case_open_exception_multiUserCaseNotEnabled());
"Case.open.exception.multiUserCaseNotEnabled"));
} }
} catch (TskUnsupportedSchemaVersionException ex) {
throw new CaseActionException(Bundle.Case_unsupportedSchemaVersionMessage(), ex);
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotOpenCaseDatabase(), ex); throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotOpenCaseDatabase(), ex);
} }

View File

@ -28,7 +28,9 @@ import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import static org.sleuthkit.autopsy.casemodule.Bundle.*;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ThreadConfined;
/** /**
* Panel used by the the open recent case option of the start window. * Panel used by the the open recent case option of the start window.
@ -93,9 +95,13 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
} }
} }
/* /**
* Opens the selected case. * Opens the selected case.
*/ */
@NbBundle.Messages({"# {0} - case name",
"RecentItems.openRecentCase.msgDlg.text=Case {0} no longer exists.",
"CaseOpenAction.msgDlg.cantOpenCase.title=Error Opening Case"})
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
private void openCase() { private void openCase() {
if (casePaths.length < 1) { if (casePaths.length < 1) {
return; return;
@ -110,17 +116,17 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
logger.log(Level.SEVERE, "Error closing start up window", ex); //NON-NLS logger.log(Level.SEVERE, "Error closing start up window", ex); //NON-NLS
} }
/* // try to open the case.
* Open the case.
*/
if (caseName.isEmpty() || caseMetadataFilePath.isEmpty() || (!new File(caseMetadataFilePath).exists())) { if (caseName.isEmpty() || caseMetadataFilePath.isEmpty() || (!new File(caseMetadataFilePath).exists())) {
//case doesn't exist
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "RecentItems.openRecentCase.msgDlg.text", caseName), RecentItems_openRecentCase_msgDlg_text(caseName),
NbBundle.getMessage(this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), CaseOpenAction_msgDlg_cantOpenCase_title(),
JOptionPane.ERROR_MESSAGE); JOptionPane.ERROR_MESSAGE);
RecentCases.getInstance().removeRecentCase(caseName, caseMetadataFilePath); // remove the recent case if it doesn't exist anymore RecentCases.getInstance().removeRecentCase(caseName, caseMetadataFilePath); // remove the recent case if it doesn't exist anymore
StartupWindowProvider.getInstance().open(); StartupWindowProvider.getInstance().open();
} else { } else {
//do actual opening on another thread
new Thread(() -> { new Thread(() -> {
try { try {
Case.openAsCurrentCase(caseMetadataFilePath); Case.openAsCurrentCase(caseMetadataFilePath);
@ -128,10 +134,10 @@ class OpenRecentCasePanel extends javax.swing.JPanel {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
if (!(ex instanceof CaseActionCancelledException)) { if (!(ex instanceof CaseActionCancelledException)) {
logger.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", caseMetadataFilePath), ex); //NON-NLS logger.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", caseMetadataFilePath), ex); //NON-NLS
JOptionPane.showMessageDialog(
WindowManager.getDefault().getMainWindow(), JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
ex.getMessage(), ex.getLocalizedMessage(),
NbBundle.getMessage(OpenRecentCasePanel.this.getClass(), "CaseOpenAction.msgDlg.cantOpenCase.title"), //NON-NLS CaseOpenAction_msgDlg_cantOpenCase_title(), //NON-NLS
JOptionPane.ERROR_MESSAGE); JOptionPane.ERROR_MESSAGE);
} }
StartupWindowProvider.getInstance().open(); StartupWindowProvider.getInstance().open();