From 26a10d772f3b552d460a55634107cb3022a490cd Mon Sep 17 00:00:00 2001 From: Paul Grey Date: Thu, 30 Jun 2022 15:03:40 -0400 Subject: [PATCH] NIFI-10186 Corrected PutFTP Remote Path Property EL This closes #6173 Signed-off-by: David Handermann --- .../java/org/apache/nifi/processors/standard/PutFTP.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java index 50ae599b6f..e26ec43cf8 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFTP.java @@ -39,6 +39,7 @@ import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.expression.ExpressionLanguageScope; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessorInitializationContext; @@ -71,6 +72,11 @@ public class PutFTP extends PutFileTransfer { private List properties; + // PutFileTransfer.onTrigger() uses FlowFile attributes + public static final PropertyDescriptor REMOTE_PATH = new PropertyDescriptor.Builder() + .fromPropertyDescriptor(FTPTransfer.REMOTE_PATH) + .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES).build(); + @Override protected void init(final ProcessorInitializationContext context) { final List properties = new ArrayList<>(); @@ -78,7 +84,7 @@ public class PutFTP extends PutFileTransfer { properties.add(FTPTransfer.PORT); properties.add(FTPTransfer.USERNAME); properties.add(FTPTransfer.PASSWORD); - properties.add(FTPTransfer.REMOTE_PATH); + properties.add(REMOTE_PATH); properties.add(FTPTransfer.CREATE_DIRECTORY); properties.add(FTPTransfer.BATCH_SIZE); properties.add(FTPTransfer.CONNECTION_TIMEOUT);