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

Former-commit-id: d02eaf80664e4525d9b00ba5978bec5cced0970a
This commit is contained in:
Jeremy Long
2014-03-28 05:03:37 -04:00
parent 462026e7e9
commit 1ce6e37e78
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.
}
/**