protected void saveToDir(ByteBuffer byteBuffer, String destination) throws IOException {
    try {
      Path path = Paths.get(destination);
      if (!Files.exists(path)) {
        if (!Files.exists(path.getParent())) {
          Files.createDirectories(path.getParent());
        }
        Files.createFile(path);
      }
      // FileOutPutStream is not in append mode by default, so the file will be overridden if it
      // already exists.
      try (FileOutputStream outputStream = new FileOutputStream(destination)) {
        outputStream.getChannel().write(byteBuffer);
        outputStream.getFD().sync();
      }
    } catch (IOException e) {
      LOGGER.warn(
          "Error occurred during writing bytebuffer to {} , the cause is {}", destination, e);
      throw e;
    }
  }
Create and save the file if the specified file does not exist, or this method will override the
existing file.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/executable/ExecutableManager.java