NissimShiman commented on a change in pull request #4627:
URL: https://github.com/apache/nifi/pull/4627#discussion_r528817029
##########
File path:
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/processor/util/StandardValidators.java
##########
@@ -848,8 +849,8 @@ public ValidationResult validate(final String subject,
final String value, final
}
final File file = new File(substituted);
- final boolean valid = file.exists();
- final String explanation = valid ? null : "File " + file + " does
not exist";
+ final boolean valid = file.exists() & !file.isDirectory();
+ final String explanation = valid ? null : "File " + file + " does
not exist or is directory";
return new
ValidationResult.Builder().subject(subject).input(value).valid(valid).explanation(explanation).build();
}
Review comment:
@tlsmith109 Let's just put the file checking in customValidate() to be
consistent with how it done in TailFile.java
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]