public static void mkdir(File directory) throws IOException {
        if (directory != null && !directory.exists()) {
            directory.mkdirs();
        }

        if (directory != null && !directory.isDirectory()) {
            throw new IOException("Unable to create :" + directory);
        }
    }
A tool class for safely creating and deleting directories that wraps exception information.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/collections/FileIOUtils.java