private static void renameWithMD5(File sourceFile, File targetDir) throws IOException {
    try (final InputStream is = Files.newInputStream(sourceFile.toPath())) {
      final String sourceFileBaseName = FilenameUtils.getBaseName(sourceFile.getName());
      final String sourceFileExtension = FilenameUtils.getExtension(sourceFile.getName());
      final String sourceFileMD5 = DigestUtils.md5Hex(is);

      final String targetFileName =
          sourceFileBaseName + "-" + sourceFileMD5.substring(0, 16) + "." + sourceFileExtension;
      final File targetFile = new File(targetDir, targetFileName);

      org.apache.commons.io.FileUtils.moveFile(
          sourceFile, targetFile, StandardCopyOption.REPLACE_EXISTING);

      LOGGER.info(
          RENAME_FILE_MESSAGE,
          sourceFile.getName(),
          targetFile.getName(),
          targetDir.getAbsolutePath());
    }
  }
Transfer bytes to human-readable string. Copy from <a
href="https://stackoverflow.com/a/3758880">stackoverflow</a>.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java