gnodet-bot commented on code in PR #31179:
URL: https://github.com/apache/camel/pull/31179#discussion_r4754816638


##########
components/camel-file/src/main/java/org/apache/camel/component/file/FileConstants.java:
##########
@@ -21,65 +21,90 @@
 
 public final class FileConstants {
 
-    @Metadata(label = "consumer", description = "A `long` value containing the 
file size.", javaType = "long", important = true)
+    @Metadata(label = "consumer", description = "The size of the file in 
bytes.", javaType = "long", important = true)
     public static final String FILE_LENGTH = Exchange.FILE_LENGTH;
-    @Metadata(label = "consumer", description = "A `Long` value containing the 
last modified timestamp of the file.",
+    @Metadata(label = "consumer",
+              description = "The last modified time of the file, in 
milliseconds since the epoch (1970-01-01T00:00:00Z)."
+                            + " With the keepLastModified option, the producer 
sets this time (a `Long` or a"
+                            + " `java.util.Date`) on the file it writes.",
               javaType = "long")
     public static final String FILE_LAST_MODIFIED = 
Exchange.FILE_LAST_MODIFIED;
-    @Metadata(label = "producer", description = "Path to the local work file, 
if local work directory is used.",
+    @Metadata(label = "producer",
+              description = "The path of the local work file, which a remote 
file consumer (such as FTP) sets when it uses"
+                            + " the localWorkDirectory option. When the 
message body is a file, the file producer moves"
+                            + " this local work file to the target instead of 
copying the body.",
               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;
-    @Metadata(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 on the message"
-                            + " unique ID. (consumer) Name of the consumed 
file as a relative file path with offset from the"
-                            + " starting directory configured on the 
endpoint.",
+    @Metadata(description = "Consumer: the name of the consumed file, relative 
to the starting directory (with the"
+                            + " flatten option, only the file name). Producer: 
the name of the file to write, relative to"
+                            + " the starting directory; it can be a `String`, 
which is used as is (not evaluated as an"
+                            + " expression), or an `Expression`, which is 
evaluated. The fileName option takes precedence"
+                            + " over this header, unless the header is an 
`Expression`. When neither is set, the producer"
+                            + " uses the message ID as the file name.",
               javaType = "String",
               important = true)
     public static final String FILE_NAME = Exchange.FILE_NAME;
-    @Metadata(label = "consumer", description = "The name of the file that has 
been consumed", javaType = "String")
+    @Metadata(label = "consumer",
+              description = "The name of the consumed file, relative to the 
starting directory. Unlike `CamelFileName`, it"
+                            + " keeps this value when the route or the flatten 
option changes `CamelFileName`.",
+              javaType = "String")
     public static final String FILE_NAME_CONSUMED = 
Exchange.FILE_NAME_CONSUMED;
-    @Metadata(label = "consumer", description = "A `boolean` option specifying 
whether the consumed file denotes an"
-                                                + " absolute path or not. 
Should normally be `false` for relative paths."
-                                                + " Absolute paths should 
normally not be used but we added to the move"
-                                                + " option to allow moving 
files to absolute paths. But can be used"
-                                                + " elsewhere as well.",
+    @Metadata(label = "consumer",
+              description = "Whether the path of the consumed file is 
absolute, which is the case when the starting"
+                            + " directory is an absolute path.",
               javaType = "Boolean")
     public static final String FILE_ABSOLUTE = "CamelFileAbsolute";
-    @Metadata(label = "consumer", description = "The absolute path to the 
file. For relative files this path holds the"
-                                                + " relative path instead.",
+    @Metadata(label = "consumer", description = "The absolute path of the 
consumed file, including its name.",
               javaType = "String")
     public static final String FILE_ABSOLUTE_PATH = "CamelFileAbsolutePath";
-    @Metadata(label = "consumer", description = "The extended attributes of 
the file", javaType = "Map<String, Object>")
+    @Metadata(label = "consumer",
+              description = "The file attributes read with the 
extendedAttributes option, as a `Map` keyed by view:name,"
+                            + " such as posix:owner.",
+              javaType = "Map<String, Object>")
     public static final String FILE_EXTENDED_ATTRIBUTES = 
"CamelFileExtendedAttributes";
-    @Metadata(label = "consumer", description = "The content type of the 
file", javaType = "String")
+    @Metadata(label = "consumer",
+              description = "The content type of the consumed file, as 
java.nio.file.Files.probeContentType detects it."
+                            + " Only set when the probeContentType option is 
enabled.",
+              javaType = "String")
     public static final String FILE_CONTENT_TYPE = Exchange.FILE_CONTENT_TYPE;
-    @Metadata(label = "consumer", description = "The file path. For relative 
files this is the starting directory."
-                                                + " For absolute files this is 
the absolute path.",
+    @Metadata(label = "consumer",
+              description = "The path of the consumed file, including its 
name: the absolute path when the starting"
+                            + " directory is absolute, otherwise the starting 
directory followed by the relative path of"
+                            + " the file.",
               javaType = "String")
     public static final String FILE_PATH = Exchange.FILE_PATH;
-    @Metadata(label = "consumer", description = "The relative path.", javaType 
= "String")
+    @Metadata(label = "consumer", description = "The path of the consumed file 
relative to the starting directory, including"
+                                                + " its name.",
+              javaType = "String")
     public static final String FILE_RELATIVE_PATH = "CamelFileRelativePath";
-    @Metadata(description = "The parent path.", javaType = "String")
+    @Metadata(description = "The path of the directory that holds the file. 
The consumer sets it for the consumed file, and"
+                            + " the producer for the existing file when it 
evaluates the moveExisting option.",
+              javaType = "String")
     public static final String FILE_PARENT = Exchange.FILE_PARENT;
-    @Metadata(label = "producer", description = "The actual absolute filepath 
(path + name) for the output file that was"
-                                                + " written. This header is 
set by Camel and its purpose is providing"
-                                                + " end-users with the name of 
the file that was written.",
+    @Metadata(label = "producer",
+              description = "The path (directory and name) of the file that 
the producer wrote. It is absolute when the"
+                            + " starting directory is an absolute path.",
               javaType = "String")
     public static final String FILE_NAME_PRODUCED = 
Exchange.FILE_NAME_PRODUCED;
-    @Metadata(label = "producer", description = "Is used for overruling 
`CamelFileName` header and use the"
-                                                + " value instead (but only 
once, as the producer will remove this header"
-                                                + " after writing the file). 
The value can be only be a String. Notice that"
-                                                + " if the option `fileName` 
has been configured, then this is still being"
-                                                + " evaluated.",
+    @Metadata(label = "producer",
+              description = "The name of the file to write, used instead of 
`CamelFileName` for one write: the producer"
+                            + " uses it as `CamelFileName`, then removes it 
after writing the file and restores the previous"
+                            + " `CamelFileName`. It can be a `String` (or a 
value that converts to a `String`) or an"
+                            + " `Expression`. When the fileName option is set, 
it still takes precedence, unless this"
+                            + " header is an `Expression`.",
               javaType = "Object")
     public static final String OVERRULE_FILE_NAME = 
Exchange.OVERRULE_FILE_NAME;
-    @Metadata(label = "consumer", description = "A `long` value containing the 
initial offset.", javaType = "long")
+    @Metadata(label = "consumer",
+              description = "The consumed file and the offset to resume 
reading it from, as an"
+                            + " `org.apache.camel.resume.Resumable`. The 
offset is the one that the resume strategy of the"
+                            + " consumer has for the file, and is null when 
there is none.",
+              javaType = "long")

Review Comment:
   ⚠️ **`javaType` / description mismatch (low):** The new description says the 
value is `org.apache.camel.resume.Resumable`, but `javaType = "long"` was not 
updated. `FileConsumer.java:491` sets this header to 
`Resumables.of(upToDateFile, file.getLastOffsetValue())` which returns a 
`Resumable`, not a `long`. The old description ("A `long` value containing the 
initial offset") and `javaType = "long"` were at least internally consistent. 
The new description correctly reflects the runtime type, so the `javaType` 
should be updated to match:
   
   ```suggestion
                 javaType = "org.apache.camel.resume.Resumable")
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to