public static S3Url parse(String s3Url) throws IllegalArgumentException {
        if (StringUtils.isBlank(s3Url)) {
            throw new IllegalArgumentException("s3Url required");
        }
        // skip the first prefix "s3://"
        String s3Endpoint = s3Url.substring(5, s3Url.indexOf('?'));

        String paramsPart = s3Url.substring(s3Url.indexOf('?') + 1);
        String[] params = paramsPart.split("&");

        String accessKey = null;
        String secretKey = null;
        String region = null;
        EndpointProtocol protocol = null;
        String dataBucket = null;
        String opsBucket = null;
        String clusterId = null;
        boolean s3PathStyle = false;

        for (String param : params) {
            String[] keyValue = param.split("=");
            if (keyValue.length != 2) {
                throw new IllegalArgumentException("Invalid parameter format: " + param);
            }

            String key = keyValue[0];
            String value = keyValue[1];

            switch (key) {
                case "s3-access-key":
                    accessKey = value;
                    break;
                case "s3-secret-key":
                    secretKey = value;
                    break;
                case "s3-region":
                    region = value;
                    break;
                case "s3-endpoint-protocol":
                    protocol = EndpointProtocol.getByName(value);
                    break;
                case "s3-data-bucket":
                    dataBucket = value;
                    break;
                case "s3-ops-bucket":
                    opsBucket = value;
                    break;
                case "cluster-id":
                    clusterId = value;
                    break;
                case "s3-path-style":
                    s3PathStyle = Boolean.parseBoolean(value);
                    break;
                default:
                    throw new IllegalArgumentException("Unknown parameter: " + key);
            }
        }

        return new S3Url(accessKey, secretKey, region, protocol, s3Endpoint, dataBucket, opsBucket, clusterId, s3PathStyle);
    }
@param args input args to start AutoMQ
@return s3Url value from args, or null if not found
automq-shell/src/main/java/com/automq/shell/model/S3Url.java