turcsanyip commented on a change in pull request #4721:
URL: https://github.com/apache/nifi/pull/4721#discussion_r544537496
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListFileTransfer.java
##########
@@ -138,4 +144,32 @@ protected boolean isListingResetNecessary(final
PropertyDescriptor property) {
protected abstract FileTransfer getFileTransfer(final ProcessContext
context);
protected abstract String getProtocolName();
+
+ protected void validateAdjustedTimeWindow(ValidationContext
validationContext, Collection<ValidationResult> results) {
+ if (
+
BY_ADJUSTED_TIME_WINDOW.getValue().equals(validationContext.getProperty(FILE_TRANSFER_LISTING_STRATEGY).getValue())
+ &&
+ !validationContext.getProperty(TIME_ADJUSTMENT).isSet()
+ ) {
+ results.add(new ValidationResult.Builder()
+ .explanation("'" + TIME_ADJUSTMENT.getDisplayName() + "'
has to be set when '"
+ + FILE_TRANSFER_LISTING_STRATEGY.getDisplayName() + "'
is set to '" + BY_ADJUSTED_TIME_WINDOW.getValue() + "'")
+ .valid(false)
+ .subject(TIME_ADJUSTMENT.getDisplayName())
+ .build());
+ }
+
+ if (
+
!BY_ADJUSTED_TIME_WINDOW.getValue().equals(validationContext.getProperty(FILE_TRANSFER_LISTING_STRATEGY).getValue())
+ &&
+ validationContext.getProperty(TIME_ADJUSTMENT).isSet()
Review comment:
As Time Adjustment property is hidden when the Listing Strategy is other
than Adjusted Time Window, this validation might not be necessary.
----------------------------------------------------------------
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]