protected String extractServiceName(URI endpoint) { if (serviceName != null) { return serviceName; } // This should never actually be called, as we should always be setting // a service name on the signer; retain it for now in case anyone is // using the AWS4Signer directly and not setting a service name // explicitly. return AwsHostNameUtils.parseServiceName(endpoint); }
@Test public void testParseServiceName() { // Verify that parseServiceName keeps working the way it used to. assertEquals("iam", AwsHostNameUtils.parseServiceName(IAM_ENDPOINT)); assertEquals("iam", AwsHostNameUtils.parseServiceName(IAM_REGION_ENDPOINT)); assertEquals("ec2", AwsHostNameUtils.parseServiceName(EC2_REGION_ENDPOINT)); assertEquals("s3", AwsHostNameUtils.parseServiceName(S3_ENDPOINT)); assertEquals("s3", AwsHostNameUtils.parseServiceName(S3_BUCKET_ENDPOINT)); assertEquals("s3", AwsHostNameUtils.parseServiceName(S3_REGION_ENDPOINT)); assertEquals("s3", AwsHostNameUtils.parseServiceName(S3_BUCKET_REGION_ENDPOINT)); }
protected String extractServiceName(URI endpoint) { if (serviceName != null) { return serviceName; } // This should never actually be called, as we should always be setting // a service name on the signer; retain it for now in case anyone is // using the AWS4Signer directly and not setting a service name // explicitly. return AwsHostNameUtils.parseServiceName(endpoint); }
protected String extractServiceName(URI endpoint) { if (serviceName != null) { return serviceName; } // This should never actually be called, as we should always be setting // a service name on the signer; retain it for now in case anyone is // using the AWS4Signer directly and not setting a service name // explicitly. return AwsHostNameUtils.parseServiceName(endpoint); }