private static URI convertToVirtualHostEndpoint ( URI endpoint , String bucketName ) { try { return new URI ( String . format ( "%s://%s.%s" , endpoint . getScheme ( ) , bucketName , endpoint . getAuthority ( ) ) ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Invalid bucket name: " + bucketName , e ) ; } }
Converts the current endpoint set for this client into virtual addressing style by placing the name of the specified bucket before the S3 service endpoint .