Dhairya-007 opened a new pull request, #29485:
URL: https://github.com/apache/camel/pull/29485

   Two defects in the same option description, which every file-based component 
inherits from `GenericFileEndpoint` (file, ftp, ftps, sftp, mina-sftp, smb, 
azure-files).
   
   ## 1. The sentence names an option that does not exist
   
   ```
   This option is also used to control whether to delete any existing files 
when fileExist=Move
   is enabled, and an existing file exists. If this option 
copyAndDeleteOnRenameFails false, then
   an exception will be thrown if an existing file existed, if its true, then 
the existing file is
   deleted before the move operation.
   ```
   
   `copyAndDeleteOnRenameFails` is a stray token: it leaves the sentence 
ungrammatical, and no option has that name — the one that exists is 
`copyAndDeleteOnRenameFail`, on `FileEndpoint`, which is about renaming across 
filesystems and has nothing to do with this.
   
   The condition described belongs to `eagerDeleteTargetFile` itself. 
`GenericFileDefaultMoveExistingFileStrategy` is explicit:
   
   ```java
   if (operations.existsFile(to)) {
       if (endpoint.isEagerDeleteTargetFile()) {
           // delete it
       } else {
           throw new GenericFileOperationFailedException("Cannot move existing 
file from: " + ...);
       }
   }
   ```
   
   true deletes, false throws — exactly what the sentence says about "this 
option". So the fix is `If this option is false`.
   
   ## 2. `fileExists` is not the option name
   
   The same description says `fileExists=Override`, and five javadocs on the 
move-existing strategies say `fileExists=Move`. Every one of these components 
declares the option as **`fileExist`**:
   
   ```
   file fileExist=True fileExists=False
   ftp fileExist=True fileExists=False
   ftps fileExist=True fileExists=False
   sftp fileExist=True fileExists=False
   mina-sftp fileExist=True fileExists=False
   smb fileExist=True fileExists=False
   azure-files fileExist=True fileExists=False
   ```
   
   Camel fails fast on unknown URI parameters, so `fileExists=Override` as 
documented does not start. Note the one description used both spellings — 
`fileExists=Override` in one sentence and the correct `fileExist=Move` two 
sentences later.
   
   `fileExists` elsewhere in the tree is left alone: `camel-main`'s 
`StartupConditionConfigurationProperties` has a real `fileExists` property, and 
`SmbOperations.fileExists(...)` is a method.
   
   ## Generated files
   
   The description lives in one `@UriParam` on `GenericFileEndpoint`, so the 
committed catalog JSON, per-component metadata and endpoint DSL builders are 
updated to match. The DSL javadoc is machine-wrapped, so I reproduced 
`EndpointDslMojo.formatJavadocOrCommentStringAsList` (wrap at `78 - indent`) 
and confirmed it regenerates the current text byte-for-byte for all seven 
factories before applying the change, so these files are what the build would 
emit.
   
   Documentation only — no behaviour change.


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