public static void createFile(String path, long length) throws IOException {
        File file = new File(path);
        assert !file.exists();

        File parent = file.getParentFile();
        if (null != parent && !parent.exists() && !parent.mkdirs()) {
            throw new IOException("mkdirs " + parent + " fail");
        }
        if (!file.createNewFile()) {
            throw new IOException("create " + path + " fail");
        }
        if (!file.setReadable(true)) {
            throw new IOException("set " + path + " readable fail");
        }
        if (!file.setWritable(true)) {
            throw new IOException("set " + path + " writable fail");
        }

        // set length
        try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
            raf.setLength(length);
        }
    }
Create a file with the given path and length.
Note {@code path} must NOT exist.
s3stream/src/main/java/com/automq/stream/s3/wal/util/WALUtil.java