Merge pull request #5270 from markmckinnon/5535-add-option-to-open-portable-case-directly

5535 add option to open portable case directly
This commit is contained in:
Richard Cordovano 2019-10-01 08:48:49 -04:00 committed by GitHub
commit 05497c6304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 9 deletions

View File

@ -117,7 +117,7 @@ CTL_CaseNewAction=New Case
CTL_CaseDetailsAction=Case Details
CTL_CaseDeleteAction=Delete Case
CTL_CaseOpenAction=Open Case
CTL_UnpackagePortableCaseAction=Unpackage Portable Case
CTL_UnpackagePortableCaseAction=Unpack and Open Portable Case
EditOptionalCasePropertiesPanel.cancelButton.text=Cancel
EditOptionalCasePropertiesPanel.saveButton.text=Save
GeneralFilter.encaseImageDesc.text=Encase Images (*.e01)

View File

@ -29,10 +29,10 @@ import org.openide.windows.WindowManager;
@ActionID(category = "Case", id = "org.sleuthkit.autopsy.casemodule.UnpackagePortableCaseAction")
@ActionRegistration(displayName = "#CTL_UnpackagePortableCaseAction", lazy = false)
@Messages({"CTL_UnpackagePortableCaseAction=Unpackage Portable Case"})
@Messages({"CTL_UnpackagePortableCaseAction=Unpack and Open Portable Case"})
/**
* Unpackage Portable Case action for the Case menu to allow the user to
* decompress a portable case.
* decompress a portable case and open it.
*/
public class UnpackagePortableCaseAction extends CallableSystemAction {

View File

@ -30,6 +30,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import javax.swing.JFrame;
import javax.swing.SwingWorker;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.openide.modules.InstalledFileLocator;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
@ -189,7 +191,15 @@ class UnpackagePortableCaseProgressDialog extends javax.swing.JDialog implements
setDisplayError(Bundle.UnpackageWorker_doInBackground_errorCompressingCase());
throw new TskCoreException("Error unpackaging case", ex); // NON-NLS
}
try {
String caseFileDirectory = FilenameUtils.getBaseName(packagedCase);
String caseDirectory = StringUtils.substringBefore(caseFileDirectory, ".zip");
Case.openAsCurrentCase(outputFolder + File.separator + caseDirectory + File.separator + caseDirectory + ".aut"); // NON-NLS
} catch (CaseActionException ex) {
throw new TskCoreException("Error opening case after unpacking it.", ex); // NON-NLS
}
success.set(true);
return null;
}

View File

@ -150,16 +150,16 @@
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-RecentCases.instance"/>
</file>
</folder>
<file name="org-sleuthkit-autopsy-casemodule-UnpackagePortableCaseAction.shadow">
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-UnpackagePortableCaseAction.instance"/>
<attr name="position" intvalue="103"/>
</file>
<file name="org-sleuthkit-autopsy-casemodule-CaseCloseAct.shadow">
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-CaseCloseAction.instance"/>
<attr name="position" intvalue="103"/>
<attr name="position" intvalue="104"/>
</file>
<file name="org-sleuthkit-autopsy-casemodule-CaseDeleteAction.shadow">
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-CaseDeleteAction.instance"/>
<attr name="position" intvalue="104"/>
</file>
<file name="org-sleuthkit-autopsy-casemodule-UnpackagePortableCaseAction.shadow">
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-UnpackagePortableCaseAction.instance"/>
<attr name="position" intvalue="105"/>
</file>
<file name="org-sleuthkit-autopsy-casemodule-AddImage-separatorBefore.instance">