private String getPathStyleResourcePath() {
        if (bucketName == null) {
            return SdkHttpUtils.urlEncode(keyForBaseOfPath(), true);
        }

        String encodedBucketName = SdkHttpUtils.urlEncode(bucketName, false);
        return encodedBucketName + "/" + SdkHttpUtils.urlEncode(key == null ? "" : key, true);
    }
Set the request's endpoint and resource path with the new region provided

@param request Request to set endpoint for
@param regionString  New region to determine endpoint to hit
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/S3RequestEndpointResolver.java