public static File createTempFile(String prefix, String suffix, boolean deleteOnExit) throws IOException {
        if (prefix == null || prefix.isEmpty()) {
            prefix = "ch";
        }
        if (suffix == null || suffix.isEmpty()) {
            suffix = ".data";
        }

        final File f;
        if (IS_UNIX) {
            FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions
                    .asFileAttribute(PosixFilePermissions.fromString("rw-------"));
            f = Files.createTempFile(prefix, suffix, attr).toFile();
        } else {
            f = Files.createTempFile(prefix, suffix).toFile(); // NOSONAR
            f.setReadable(true, true); // NOSONAR
            f.setWritable(true, true); // NOSONAR
            f.setExecutable(false, false); // NOSONAR
        }

        if (deleteOnExit) {
            f.deleteOnExit();
        }
        return f;
    }
Creates a temporary file with the given prefix and suffix. The file has only
read and write access granted to the owner.

@param prefix       prefix, null or empty string is taken as {@code "ch"}
@param suffix       suffix, null or empty string is taken as {@code ".data"}
@param deleteOnExit whether the file be deleted on exit
@return non-null temporary file
@throws IOException when failed to create the temporary file
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java