mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #4044 from wschaeferB/AddPathValidatorIsValid
Add back a deprecated PathValidater.isValid method for public API
This commit is contained in:
commit
418e202079
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2013-2014 Basis Technology Corp.
|
||||
* Copyright 2013-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -32,6 +32,14 @@ public final class PathValidator {
|
||||
private static final Pattern driveLetterPattern = Pattern.compile("^[Cc]:.*$");
|
||||
private static final Pattern unixMediaDrivePattern = Pattern.compile("^\\/(media|mnt)\\/.*$");
|
||||
|
||||
/**
|
||||
* Checks if the provided path is valid given the case type.
|
||||
*
|
||||
* @param path - the path to validate
|
||||
* @param caseType - the type of case which the path is being validated for
|
||||
*
|
||||
* @return - boolean true for valid path, false for invalid path
|
||||
*/
|
||||
public static boolean isValidForMultiUserCase(String path, Case.CaseType caseType) {
|
||||
|
||||
if (caseType == Case.CaseType.MULTI_USER_CASE) {
|
||||
@ -91,4 +99,20 @@ public final class PathValidator {
|
||||
Matcher m = driveLetterPattern.matcher(filePath);
|
||||
return m.find();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the provided path is valid given the case type.
|
||||
*
|
||||
* @param path - the path to validate
|
||||
* @param caseType - the type of case which the path is being validated for
|
||||
*
|
||||
* @return - boolean true for valid path, false for invalid path
|
||||
*
|
||||
* @deprecated - PathValidator.isValidForMultiUserCase directly replaces
|
||||
* PathValidator.isValid
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isValid(String path, Case.CaseType caseType) {
|
||||
return isValidForMultiUserCase(path, caseType);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user