public static File createHardLink(File sourceFile, File hardlink) throws IOException {
    if (!hardlink.getParentFile().exists() && !hardlink.getParentFile().mkdirs()) {
      synchronized (FileUtils.class) {
        if (!hardlink.getParentFile().exists() && !hardlink.getParentFile().mkdirs()) {
          throw new IOException(
              String.format(
                  "failed to create hardlink %s for file %s: failed to create parent dir %s",
                  hardlink.getPath(), sourceFile.getPath(), hardlink.getParentFile().getPath()));
        }
      }
    }

    final Path sourcePath = FileSystems.getDefault().getPath(sourceFile.getAbsolutePath());
    final Path linkPath = FileSystems.getDefault().getPath(hardlink.getAbsolutePath());
    Files.createLink(linkPath, sourcePath);
    return hardlink;
  }
Move source file to target file. The move will be divided into three steps: 1. Copy the source
file to the "target.unfinished" location 2. Rename the "target.unfinished" to "target" 3.
Delete the source file

@param source source file, which can be a directory.
@param target target file, which can be a directory.
@return success or not
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java