@Test public void testGetAmazonRegion() { AwsSignatureHelper helper = new AwsSignatureHelper(); for (String[] item : ENDPOINT_LIST) { String endpoint = item[0]; String region = item[1]; assertEquals(region, helper.getAmazonRegion(endpoint)); } }
public String getAmazonRegion(String endpoint) { if (isBlank(endpoint)) { return DEFAULT_AMAZON_REGION; } final Pattern pattern = Pattern.compile("(https: final Matcher matcher = pattern.matcher(endpoint); if (matcher.find()) { return matcher.group(3); } return DEFAULT_AMAZON_REGION; }
AwsSignatureHelper { public String getAmazonRegion(String endpoint) { if (isBlank(endpoint)) { return DEFAULT_AMAZON_REGION; } final Pattern pattern = Pattern.compile("(https: final Matcher matcher = pattern.matcher(endpoint); if (matcher.find()) { return matcher.group(3); } return DEFAULT_AMAZON_REGION; } }
AwsSignatureHelper { public String getAmazonRegion(String endpoint) { if (isBlank(endpoint)) { return DEFAULT_AMAZON_REGION; } final Pattern pattern = Pattern.compile("(https: final Matcher matcher = pattern.matcher(endpoint); if (matcher.find()) { return matcher.group(3); } return DEFAULT_AMAZON_REGION; }  }
AwsSignatureHelper { public String getAmazonRegion(String endpoint) { if (isBlank(endpoint)) { return DEFAULT_AMAZON_REGION; } final Pattern pattern = Pattern.compile("(https: final Matcher matcher = pattern.matcher(endpoint); if (matcher.find()) { return matcher.group(3); } return DEFAULT_AMAZON_REGION; }  String canonicalizedQueryString(Map<String, String> queryParameters); String canonicalizedHeadersString(Map<String, String> headers); String getSignedHeadersString(Map<String, String> headers); String getAmazonDateString(Date date); String getAmazonCredentialScope(String dateStamp, String awsRegion, String awsService); String getAmazonRegion(String endpoint); }
AwsSignatureHelper { public String getAmazonRegion(String endpoint) { if (isBlank(endpoint)) { return DEFAULT_AMAZON_REGION; } final Pattern pattern = Pattern.compile("(https: final Matcher matcher = pattern.matcher(endpoint); if (matcher.find()) { return matcher.group(3); } return DEFAULT_AMAZON_REGION; }  String canonicalizedQueryString(Map<String, String> queryParameters); String canonicalizedHeadersString(Map<String, String> headers); String getSignedHeadersString(Map<String, String> headers); String getAmazonDateString(Date date); String getAmazonCredentialScope(String dateStamp, String awsRegion, String awsService); String getAmazonRegion(String endpoint);  }