This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 6bdc923746ca camel-file: CamelFileLocalWorkPath is a String path, not 
a File (#29964)
6bdc923746ca is described below

commit 6bdc923746cafd065c3ec66a634c288ad5df9261
Author: dhairya05 <[email protected]>
AuthorDate: Sun Nov 15 02:26:44 2026 +0530

    camel-file: CamelFileLocalWorkPath is a String path, not a File (#29964)
    
    FileConstants documents the header as javaType=File, but nothing ever
    puts a File in it. Every component that sets it sets the path:
    
        exchange.getIn().setHeader(FtpConstants.FILE_LOCAL_WORK_PATH, 
local.getPath());
    
    in FtpOperations, SftpOperations, MinaSftpOperations, FilesOperations and
    SmbOperations, and both readers read a String and build the File
    themselves:
    
        String local = 
exchange.getIn().getHeader(FileConstants.FILE_LOCAL_WORK_PATH, String.class);
        if (local != null) {
            File f = new File(local);
    
    in FileOperations.handleFileAsFileSource and
    GenericFileProcessStrategySupport. FileProducerFileBodyGetsMovedTest
    passes temporaryFile.getAbsolutePath() too.
    
    The other three declarations of this header already have it right -
    FtpConstants, FilesConstants and SmbConstants all say javaType=String,
    with the description "Path to the local work file, if local work
    directory is used." Only the camel-file copy says File, so the catalog
    contradicts itself for one header across the file-based components.
    
    Use the same type and wording as the other three.
---
 .../generated/resources/org/apache/camel/catalog/components/file.json | 2 +-
 .../resources/META-INF/org/apache/camel/component/file/file.json      | 2 +-
 .../src/main/java/org/apache/camel/component/file/FileConstants.java  | 3 ++-
 .../apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java | 4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file.json
index b05c5f309dd1..e0ddf1bfbfbc 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/file.json
@@ -33,7 +33,7 @@
   "headers": {
     "CamelFileLength": { "index": 0, "kind": "header", "displayName": "", 
"group": "consumer", "label": "consumer", "required": false, "javaType": 
"long", "deprecated": false, "autowired": false, "secret": false, "important": 
true, "description": "A long value containing the file size.", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LENGTH" },
     "CamelFileLastModified": { "index": 1, "kind": "header", "displayName": 
"", "group": "consumer", "label": "consumer", "required": false, "javaType": 
"long", "deprecated": false, "autowired": false, "secret": false, 
"description": "A Long value containing the last modified timestamp of the 
file.", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LAST_MODIFIED" },
-    "CamelFileLocalWorkPath": { "index": 2, "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"File", "deprecated": false, "autowired": false, "secret": false, 
"description": "The local work path", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LOCAL_WORK_PATH" },
+    "CamelFileLocalWorkPath": { "index": 2, "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Path to the local work file, if local work directory is used.", 
"constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LOCAL_WORK_PATH" },
     "CamelFileNameOnly": { "index": 3, "kind": "header", "displayName": "", 
"group": "consumer", "label": "consumer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Only the file name (the name with no leading paths).", 
"constantName": "org.apache.camel.component.file.FileConstants#FILE_NAME_ONLY" 
},
     "CamelFileName": { "index": 4, "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "autowired": false, "secret": false, "important": true, 
"description": "(producer) Specifies the name of the file to write (relative to 
the endpoint directory). This name can be a String; a String with a file or 
simple Language expression; or an Expression object. If it's null then Camel 
will auto-generate a filename based o [...]
     "CamelFileNameConsumed": { "index": 5, "kind": "header", "displayName": 
"", "group": "consumer", "label": "consumer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "The name of the file that has been consumed", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_NAME_CONSUMED" },
diff --git 
a/components/camel-file/src/generated/resources/META-INF/org/apache/camel/component/file/file.json
 
b/components/camel-file/src/generated/resources/META-INF/org/apache/camel/component/file/file.json
index b05c5f309dd1..e0ddf1bfbfbc 100644
--- 
a/components/camel-file/src/generated/resources/META-INF/org/apache/camel/component/file/file.json
+++ 
b/components/camel-file/src/generated/resources/META-INF/org/apache/camel/component/file/file.json
@@ -33,7 +33,7 @@
   "headers": {
     "CamelFileLength": { "index": 0, "kind": "header", "displayName": "", 
"group": "consumer", "label": "consumer", "required": false, "javaType": 
"long", "deprecated": false, "autowired": false, "secret": false, "important": 
true, "description": "A long value containing the file size.", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LENGTH" },
     "CamelFileLastModified": { "index": 1, "kind": "header", "displayName": 
"", "group": "consumer", "label": "consumer", "required": false, "javaType": 
"long", "deprecated": false, "autowired": false, "secret": false, 
"description": "A Long value containing the last modified timestamp of the 
file.", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LAST_MODIFIED" },
-    "CamelFileLocalWorkPath": { "index": 2, "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"File", "deprecated": false, "autowired": false, "secret": false, 
"description": "The local work path", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LOCAL_WORK_PATH" },
+    "CamelFileLocalWorkPath": { "index": 2, "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Path to the local work file, if local work directory is used.", 
"constantName": 
"org.apache.camel.component.file.FileConstants#FILE_LOCAL_WORK_PATH" },
     "CamelFileNameOnly": { "index": 3, "kind": "header", "displayName": "", 
"group": "consumer", "label": "consumer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Only the file name (the name with no leading paths).", 
"constantName": "org.apache.camel.component.file.FileConstants#FILE_NAME_ONLY" 
},
     "CamelFileName": { "index": 4, "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "autowired": false, "secret": false, "important": true, 
"description": "(producer) Specifies the name of the file to write (relative to 
the endpoint directory). This name can be a String; a String with a file or 
simple Language expression; or an Expression object. If it's null then Camel 
will auto-generate a filename based o [...]
     "CamelFileNameConsumed": { "index": 5, "kind": "header", "displayName": 
"", "group": "consumer", "label": "consumer", "required": false, "javaType": 
"String", "deprecated": false, "autowired": false, "secret": false, 
"description": "The name of the file that has been consumed", "constantName": 
"org.apache.camel.component.file.FileConstants#FILE_NAME_CONSUMED" },
diff --git 
a/components/camel-file/src/main/java/org/apache/camel/component/file/FileConstants.java
 
b/components/camel-file/src/main/java/org/apache/camel/component/file/FileConstants.java
index 74aaa2518ec3..04006c657738 100644
--- 
a/components/camel-file/src/main/java/org/apache/camel/component/file/FileConstants.java
+++ 
b/components/camel-file/src/main/java/org/apache/camel/component/file/FileConstants.java
@@ -26,7 +26,8 @@ public final class FileConstants {
     @Metadata(label = "consumer", description = "A `Long` value containing the 
last modified timestamp of the file.",
               javaType = "long")
     public static final String FILE_LAST_MODIFIED = 
Exchange.FILE_LAST_MODIFIED;
-    @Metadata(label = "producer", description = "The local work path", 
javaType = "File")
+    @Metadata(label = "producer", description = "Path to the local work file, 
if local work directory is used.",
+              javaType = "String")
     public static final String FILE_LOCAL_WORK_PATH = 
Exchange.FILE_LOCAL_WORK_PATH;
     @Metadata(label = "consumer", description = "Only the file name (the name 
with no leading paths).", javaType = "String")
     public static final String FILE_NAME_ONLY = Exchange.FILE_NAME_ONLY;
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java
index 3d578001184e..709283e096ce 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java
@@ -4123,9 +4123,9 @@ public interface FileEndpointBuilderFactory {
             return "CamelFileLastModified";
         }
         /**
-         * The local work path.
+         * Path to the local work file, if local work directory is used.
          * 
-         * The option is a: {@code File} type.
+         * The option is a: {@code String} type.
          * 
          * Group: producer
          * 

Reply via email to