added support for wildcard extensions in scan path for issue #95

Former-commit-id: 48b91add5bf6aa289dc03f1627046971dc0366e6
This commit is contained in:
Jeremy Long
2014-03-28 05:03:37 -04:00
parent c16e85e7db
commit 8fb14ffdf3
3 changed files with 69 additions and 34 deletions

View File

@@ -129,12 +129,14 @@ public final class CliParser {
* @throws FileNotFoundException is thrown if the path being validated does not exist.
*/
private void validatePathExists(String path, String argumentName) throws FileNotFoundException {
final File f = new File(path);
if (!f.exists()) {
isValid = false;
final String msg = String.format("Invalid '%s' argument: '%s'", argumentName, path);
throw new FileNotFoundException(msg);
}
if (!path.contains("*.")) {
final File f = new File(path);
if (!f.exists()) {
isValid = false;
final String msg = String.format("Invalid '%s' argument: '%s'", argumentName, path);
throw new FileNotFoundException(msg);
}
} // else { // TODO add a validation for *.zip extensions rather then relying on the engine to validate it.
}
/**