mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-08 14:19:32 +00:00
Make new case wizard create display name/case name aware case dirs
This commit is contained in:
parent
ce1f462e6b
commit
0a89b0f90d
@ -204,17 +204,27 @@ class NewCaseWizardPanel1 implements WizardDescriptor.ValidatingPanel<WizardDesc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate() throws WizardValidationException {
|
public void validate() throws WizardValidationException {
|
||||||
String caseName = getComponent().getCaseName();
|
String caseDisplayName = getComponent().getCaseName();
|
||||||
String caseParentDir = getComponent().getCaseParentDir();
|
String caseParentDir = getComponent().getCaseParentDir();
|
||||||
String caseDirPath = caseParentDir + caseName;
|
|
||||||
|
|
||||||
// check if case Name contain one of this following symbol:
|
// check if case Name contain one of this following symbol:
|
||||||
// \ / : * ? " < > |
|
// \ / : * ? " < > |
|
||||||
if (!Case.isValidName(caseName)) {
|
if (!Case.isValidName(caseDisplayName)) {
|
||||||
String errorMsg = NbBundle
|
String errorMsg = NbBundle
|
||||||
.getMessage(this.getClass(), "NewCaseWizardPanel1.validate.errMsg.invalidSymbols");
|
.getMessage(this.getClass(), "NewCaseWizardPanel1.validate.errMsg.invalidSymbols");
|
||||||
validationError(errorMsg);
|
validationError(errorMsg);
|
||||||
} else {
|
} else {
|
||||||
|
String caseName = "";
|
||||||
|
try {
|
||||||
|
caseName = Case.displayNameToCaseName(caseDisplayName);
|
||||||
|
} catch (Case.IllegalCaseNameException ex) {
|
||||||
|
String errorMsg = NbBundle
|
||||||
|
.getMessage(this.getClass(), "NewCaseWizardPanel1.validate.errMsg.invalidSymbols");
|
||||||
|
validationError(errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
String caseDirPath = caseParentDir + caseName;
|
||||||
|
|
||||||
// check if the directory exist
|
// check if the directory exist
|
||||||
if (new File(caseDirPath).exists()) {
|
if (new File(caseDirPath).exists()) {
|
||||||
// throw a warning to enter new data or delete the existing directory
|
// throw a warning to enter new data or delete the existing directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user