public URI toURI() {
        validateHostnameCompliant(outpostId, "outpostId", "outpost ARN");
        validateHostnameCompliant(accountId, "accountId", "outpost ARN");
        validateHostnameCompliant(accessPointName, "accessPointName", "outpost ARN");

        String uriString;
        if (endpointOverride == null) {
            uriString = String.format("%s://%s-%s.%s.s3-outposts.%s.%s",
                                      protocol, accessPointName, accountId, outpostId, region, domain);
        } else {
            StringBuilder uriSuffix = new StringBuilder(endpointOverride.getHost());
            if (endpointOverride.getPort() > 0) {
                uriSuffix.append(":").append(endpointOverride.getPort());
            }
            if (endpointOverride.getPath() != null) {
                uriSuffix.append(endpointOverride.getPath());
            }

            uriString = String.format("%s://%s-%s.%s.%s", protocol, accessPointName, accountId, outpostId, uriSuffix);
        }
        return URI.create(uriString);
    }
Generate an endpoint URI with no path that maps to the Outpost Access Point information stored in this builder.
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/S3OutpostAccessPointBuilder.java