davsclaus commented on PR #29848:
URL: https://github.com/apache/camel/pull/29848#issuecomment-6858920070
Thanks for the thorough review and the reproducer. Addressed in bd2ebba1dffa
(main merged in first, so the upgrade guides apply cleanly):
**1. `\` in names.** `deleteFile` and the existence check
(`getFileAttributes`, used by `existsFile` and the read lock) now normalize the
name with the endpoint's `separator`, as `storeFile` already did. With the
default `separator=UNIX` the delete, the check, the store and the rename all
work on `inbox/sub/file.txt`. A file literally named `inbox/sub\file.txt` is
left alone. New test
`storeAgainWithBackslashInNameKeepsFileWithThatLiteralName` is your second-send
case: `sub/file.txt` ends up `second` and the literal file keeps `unrelated`.
**2. Docs.** The upgrade guide and the javadoc of `quotePathForJsch` now say
`*` and `?` are used literally, and that `\` is a path separator with the
default `separator`, as before. The migration advice is split per case:
- consumer with `useList=false` and a wildcard in `fileName`: list and use
`include`/`antInclude`
- producer: the `CamelFileName` header or `fileName` must be the real name
- a wildcard in the endpoint directory: use the real directory name
**3. LTS entries.** Added `camel-ftp - sftp uses remote file and directory
names as given` to the `4.22.2 to 4.22.3` and `4.18.5 to 4.18.6` sections on
main. On the patch-release question: yes, this is intended for the LTS lines. A
name selecting another file is exactly the behaviour being fixed, and the notes
explain the migration.
**4. Stepwise directory.** `retrieveFileToStreamInBody`,
`retrieveFileToFileInLocalWorkDirectory` and `storeFile` now change back to the
starting directory in a `finally` block. After a failed operation, a failure to
change back is only logged at DEBUG, so it does not hide the original error.
Since the PR rewrites the `get` calls on those lines, I fixed it here instead
of in a separate JIRA. New test
`failedStepwiseRetrieveChangesBackToTheStartingDirectory` is your setup:
`useList=false`, `fileName=data-*.txt`,
`ignoreFileNotFoundOrPermissionError=true`, a relative directory. After three
failing polls, a file literally named `data-*.txt` is picked up.
`FtpOperations` has the same pattern; that one is left for a separate change.
**5. Tests.**
- `chmodOnlyChangesStoredFile` now asserts the stored file got `rwxrwxrwx`,
and compares the permission sets.
- New tests:
- `appendToFileWithWildcardInName`: `fileExist=Append`, stepwise on and off
- `checksumFileOfFileWithWildcardInName`: checksum file via
`storeFileDirectly`
- `chmodDirectoryOnlyChangesCreatedDirectory`
- `consumeFileWithWildcardInNameToLocalWorkDirectory`
- `storeFileInDirectoryWithWildcardName`: now also runs with
`existDirCheckUsingLs=false`, for the `cd` check
- `rename` was covered earlier by `consumeAndMoveFileWithWildcardInName`.
`SftpFileNameWithSpecialCharactersIT` now has 24 cases. The two new
regression tests fail with the previous `SftpOperations` and pass with this
one. All 167 `Sftp*IT` in camel-ftp pass.
_Claude Code on behalf of davsclaus_
--
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]