Merge pull request #6216 from APriestman/openWithAutFile

Allow a case to be opened from command line using the .aut file
This commit is contained in:
Richard Cordovano 2020-08-27 14:51:14 -04:00 committed by GitHub
commit 11dc6ee9cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,15 +36,20 @@ class CommandLineManager {
/**
* Opens existing case.
*
* @param caseFolderPath full path to case directory
* @param casePath full path to case directory or full path to .aut file
*
* @throws CaseActionException
*/
Case openCase(String caseFolderPath) throws CaseActionException {
Case openCase(String casePath) throws CaseActionException {
LOGGER.log(Level.INFO, "Opening case in directory {0}", caseFolderPath);
String metadataFilePath = findAutFile(caseFolderPath);
String metadataFilePath;
if (casePath.endsWith(".aut") && (new File(casePath)).isFile()) {
LOGGER.log(Level.INFO, "Opening case {0}", casePath);
metadataFilePath = casePath;
} else {
LOGGER.log(Level.INFO, "Opening case in directory {0}", casePath);
metadataFilePath = findAutFile(casePath);
}
Case.openAsCurrentCase(metadataFilePath);
Case newCase = Case.getCurrentCase();