This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 54583809774 NIFI-16373 Added ResourceType for FetchFile File property
(#11704)
54583809774 is described below
commit 5458380977470d9526b9eb48b421f50b7e19c09d
Author: István Adamcsik <[email protected]>
AuthorDate: Thu Oct 1 19:22:10 2026 +0200
NIFI-16373 Added ResourceType for FetchFile File property (#11704)
Signed-off-by: David Handermann <[email protected]>
---
.../src/main/java/org/apache/nifi/processors/standard/FetchFile.java | 3 +++
.../test/java/org/apache/nifi/processors/standard/TestFetchFile.java | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFile.java
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFile.java
index 550177b2ea5..bb4b71aee13 100644
---
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFile.java
+++
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchFile.java
@@ -29,6 +29,8 @@ import org.apache.nifi.components.AllowableValue;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.ValidationContext;
import org.apache.nifi.components.ValidationResult;
+import org.apache.nifi.components.resource.ResourceCardinality;
+import org.apache.nifi.components.resource.ResourceType;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.logging.LogLevel;
@@ -123,6 +125,7 @@ public class FetchFile extends AbstractProcessor {
.name("File to Fetch")
.description("The fully-qualified filename of the file to fetch from
the file system")
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .identifiesExternalResource(ResourceCardinality.SINGLE,
ResourceType.FILE)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.defaultValue("${absolute.path}/${filename}")
.required(true)
diff --git
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java
index 14bc7eed2e2..119455b09ff 100644
---
a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java
+++
b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestFetchFile.java
@@ -60,7 +60,8 @@ public class TestFetchFile {
final File sourceFile = new File("notFound");
final TestRunner runner = TestRunners.newTestRunner(new FetchFile());
- runner.setProperty(FetchFile.FILENAME, sourceFile.getAbsolutePath());
+ runner.setEnvironmentVariableValue("filepath",
sourceFile.getAbsolutePath());
+ runner.setProperty(FetchFile.FILENAME, "${filepath}");
runner.setProperty(FetchFile.COMPLETION_STRATEGY,
FetchFile.COMPLETION_NONE.getValue());
runner.enqueue(new byte[0]);