Caideyipi commented on code in PR #16141:
URL: https://github.com/apache/iotdb/pull/16141#discussion_r2268789794


##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java:
##########
@@ -418,52 +418,49 @@ public static void moveFileWithMD5Check(final File 
sourceFile, final File target
     final String sourceFileName = sourceFile.getName();
     final File targetFile = new File(targetDir, sourceFileName);
     if (targetFile.exists()) {
-      // Check if the file sizes are the same
-      if (sourceFile.length() == targetFile.length()) {
-        moveWithMD5Check(sourceFile, targetDir, targetFile);
-        return;
-      }
-      moveFileRenameWithSize(sourceFile, targetDir);
+      moveFile(sourceFile, targetFile);
     } else {
       org.apache.commons.io.FileUtils.moveFileToDirectory(sourceFile, 
targetDir, true);
     }
   }
 
-  private static void moveWithMD5Check(
-      final File sourceFile, final File targetDir, final File targetFile) 
throws IOException {
-    if (haveSameMD5(sourceFile, targetFile)) {
-      org.apache.commons.io.FileUtils.forceDelete(sourceFile);
-      LOGGER.info(
-          "Deleted the file {} because it already exists in the target 
directory: {}",
-          sourceFile.getName(),
-          targetDir.getAbsolutePath());
-    } else {
-      renameWithMD5(sourceFile, targetDir);
-    }
-  }
+  private static void moveFile(File sourceFile, File targetDir) throws 
IOException {
+    String sourceFileName = sourceFile.getName();
+    final File exitsFile = new File(targetDir, sourceFileName);

Review Comment:
   ```suggestion
       final File existsFile = new File(targetDir, sourceFileName);
   ```



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