davsclaus opened a new pull request, #30585: URL: https://github.com/apache/camel/pull/30585
## What was wrong [CAMEL-27368](https://issues.apache.org/jira/browse/CAMEL-27368), two differences from the file component: 1. **sortBy**: `SmbComponent.buildFileEndpoint` called `setProperties(endpoint, parameters)` itself. `GenericFileComponent.createEndpoint` parses `sortBy` (`reverse:`, `ignoreCase:`, `;` groups) only after `buildFileEndpoint` returns, so the option had already been bound through `setSortBy(String)` as a plain file language expression. `sortBy=reverse:file:name` failed with `Unknown function: reverse:file:name`. A plain `sortBy=file:name` worked. 2. **delete=true with move**: the file consumer (`FileEndpoint.createConsumer`) and the ftp/sftp consumer (`RemoteFileEndpoint.createConsumer`) refuse this combination at startup. The smb consumer started, deleted the files and ignored `move`. ## The fix - `SmbComponent.buildFileEndpoint` no longer sets the options. `GenericFileComponent.createEndpoint` sets them after it parses `sortBy`, as for the ftp component. - `SmbEndpoint.createConsumer` throws `IllegalArgumentException("You cannot set both delete=true and move options")`, the same message as the file component. - Upgrade guide 4.24: a `camel-smb` entry for `delete=true` with `move`, because such a route started before and now fails to start. ## Tests - `SmbEndpointSortByTest` (new, unit): `file:name`, `reverse:file:name`, `ignoreCase:file:name`, `reverse:ignoreCase:file:name` and `file:ext;reverse:ignoreCase:file:name` sort as expected, and `delete=true&move=done` fails in `createConsumer`. Without the fix in `src/main`, the reverse/ignoreCase cases fail with `Unknown function` and the delete/move case fails because no exception is thrown. With the fix, 6 tests pass. - `FromSmbFileSortByReverseIT` (new, Samba container): polls with `sortBy=file:ext;reverse:ignoreCase:file:name` and checks the order. - Full camel-smb suite with Docker: `mvn verify` in `components/camel-smb`: 32 unit tests and 87 ITs, all pass. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
