allthingssecurity commented on code in PR #27675:
URL: https://github.com/apache/camel/pull/27675#discussion_r4240516371


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc:
##########
@@ -2637,6 +2637,13 @@ resolves back inside the polled directory remains 
accepted. Two configurations c
 server that reports names navigating above the polled directory, and a 
`fileName` expression (used when
 `useList=false`) that navigates above it. Set `jailStartingDirectory=false` if 
such a path is intended.
 
+=== camel-mina-sftp - the producer applies the charset and allowNullBody 
options
+
+The producer wrote a String body in the charset of the exchange (UTF-8 unless 
the exchange sets another one) and

Review Comment:
   Confirmed in the code and with a test: for a body that is not a String, 
`GenericFileHelper.toInputStream` converts
   the body to a `Reader` (the converters of `byte[]`, `InputStream` and files 
decode with the charset of the exchange)
   and wraps it in a `ReaderInputStream` of the configured charset. Added in 
71d85fcdd817: the sentence in the upgrade
   note ("... non-String bodies ... are also read in the charset of the 
exchange and re-encoded to that charset ...; do
   not set `charset` for binary payloads"), and 
`SftpProducerWithCharsetIT.testProducerWithCharsetReencodesBytesBody`,
   which sends the UTF-8 bytes of the sample text through a route and finds the 
ISO-8859-1 bytes in the file.
   camel-mina-sftp suite: 26 unit tests (1 skipped) and 271 integration tests 
(7 skipped), 0 failures.
   
   _Claude Code on behalf of allthingssecurity_



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