From f750063491ab61747ffd660271ca8691b8446036 Mon Sep 17 00:00:00 2001 From: apriestman Date: Thu, 27 Aug 2020 10:51:12 -0400 Subject: [PATCH] Allow a case to be opened from command line using the .aut file --- .../commandlineingest/CommandLineManager.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineManager.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineManager.java index b14dc7f387..e52b3f4113 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineManager.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineManager.java @@ -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();