gnodet-bot commented on code in PR #30680:
URL: https://github.com/apache/camel/pull/30680#discussion_r4670355392


##########
components/camel-mina-sftp/src/main/java/org/apache/camel/component/file/remote/mina/MinaSftpOperations.java:
##########
@@ -1090,6 +1095,14 @@ public void changeCurrentDirectory(String path) throws 
GenericFileOperationFaile
         }
     }
 
+    /**
+     * Whether the path is the directory itself or one of its parent 
directories. A path that only starts with the same
+     * characters, such as /home/cam for /home/camel, is not.
+     */
+    private static boolean isDirectoryOrParentOf(String path, String 
directory) {

Review Comment:
   💡 **Nit:** Identical duplicate of `SftpOperations.isDirectoryOrParentOf` — 
see note there. Extracting to `FtpUtils` would be the right home for this.



##########
components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java:
##########
@@ -879,6 +884,14 @@ public void changeCurrentDirectory(String path) throws 
GenericFileOperationFaile
         }
     }
 
+    /**
+     * Whether the path is the directory itself or one of its parent 
directories. A path that only starts with the same
+     * characters, such as /home/cam for /home/camel, is not.
+     */
+    private static boolean isDirectoryOrParentOf(String path, String 
directory) {

Review Comment:
   💡 **Nit:** `isDirectoryOrParentOf` is duplicated verbatim in 
`SftpOperations` and `MinaSftpOperations`. Consider moving it to `FtpUtils` to 
prevent drift if either copy ever needs a correction.



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