davsclaus commented on a change in pull request #6473:
URL: https://github.com/apache/camel/pull/6473#discussion_r756593583



##########
File path: 
components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
##########
@@ -408,6 +411,16 @@ public boolean storeFile(String fileName, Exchange 
exchange, long size) throws G
         }
     }
 
+    private void writeFileFromString(String body, File target) throws 
IOException {

Review comment:
       Can you rename to `writeFileByString` and move the method down to where 
the others are

##########
File path: 
components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
##########
@@ -381,6 +381,9 @@ public boolean storeFile(String fileName, Exchange 
exchange, long size) throws G
                 // buffer the reader
                 in = IOHelper.buffered(in);
                 writeFileByReaderWithCharset(in, file, charset);
+            } else if (exchange.getIn().getBody() instanceof String &&
+                    ((String) exchange.getIn().getBody()).length() < 
endpoint.getBufferSize()) {

Review comment:
       Maybe put the body into a String str = (String) ... so you avoid the 
ugly type casts




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