7471 re-order case opening and deleting of file

This commit is contained in:
William Schaefer 2021-04-01 10:43:40 -04:00
parent 8caf0fe4cd
commit ab8f58efd7

View File

@ -95,15 +95,15 @@ public class StartupWindowProvider implements StartupWindowInterface {
Charset encoding = null; Charset encoding = null;
caseFilePath = FileUtils.readFileToString(openPreviousCaseFile, encoding); caseFilePath = FileUtils.readFileToString(openPreviousCaseFile, encoding);
if (new File(caseFilePath).exists()) { if (new File(caseFilePath).exists()) {
Case.openAsCurrentCase(caseFilePath);
FileUtils.forceDelete(openPreviousCaseFile); FileUtils.forceDelete(openPreviousCaseFile);
Case.openAsCurrentCase(caseFilePath);
//the case is now open we do not want to display the start up windows //the case is now open we do not want to display the start up windows
return; return;
} else { } else {
logger.log(Level.WARNING, "Unable to open previously open case because metadata file not found at: {0}", caseFilePath); logger.log(Level.WARNING, "Unable to open previously open case because metadata file not found at: {0}", caseFilePath);
} }
} catch (IOException ex) { } catch (IOException ex) {
logger.log(Level.WARNING, "Unable to open file containing path " + ResetWindowsAction.getCaseToReopenFilePath() + " to previously open case, will not open previous case.", ex); logger.log(Level.WARNING, "Unable to open or delete file containing path " + ResetWindowsAction.getCaseToReopenFilePath() + " to previously open case, will not open previous case.", ex);
} catch (CaseActionException ex) { } catch (CaseActionException ex) {
logger.log(Level.WARNING, "Unable to open previously open case with metadata file: " + caseFilePath, ex); logger.log(Level.WARNING, "Unable to open previously open case with metadata file: " + caseFilePath, ex);
} }