You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/11/06 08:57:53 UTC

[GitHub] [camel] omarsmak commented on a change in pull request #4573: CAMEL-15822: [camel-file] fileExist=Move doesn't use FileMoveExisting…

omarsmak commented on a change in pull request #4573:
URL: https://github.com/apache/camel/pull/4573#discussion_r518608380



##########
File path: components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileDefaultMoveExistingFileStrategy.java
##########
@@ -49,14 +49,24 @@ public boolean moveExistingFile(GenericFileEndpoint endpoint, GenericFileOperati
         dummy.getIn().setHeader(Exchange.FILE_PARENT, parent);
 
         String to = endpoint.getMoveExisting().evaluate(dummy, String.class);
-        // we must normalize it (to avoid having both \ and / in the name which
-        // confuses java.io.File)
-        to = FileUtil.normalizePath(to);
+
         if (ObjectHelper.isEmpty(to)) {
             throw new GenericFileOperationFailedException(
                     "moveExisting evaluated as empty String, cannot move existing file: " + fileName);
         }
 
+        if (to.length() > 1 && to.endsWith("/")) {

Review comment:
       I see some of this logic to check the name being repeated across the three strategies, can we somehow unify this logic into a common function to ease maintainability?  




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org