GlacierUploaderOptionParser extends OptionParser { public String parseEndpointToRegion(String endpointOptionValue) { String region = endpointOptionValue; final Matcher matcher = REGION_REGEX_PATTERN.matcher(endpointOptionValue); if(matcher.matches()) { region = matcher.group("region"); LOG.debug("Endpoint parsed: {}", region); } return region; } GlacierUploaderOptionParser(final Configuration config); String parseEndpointToRegion(String endpointOptionValue); List<File> mergeNonOptionsFiles(List<File> optionsFiles, List<String> nonOptions); final OptionSpec<Void> listVaults; final OptionSpec<Void> listJobs; final OptionSpec<File> targetFile; @Deprecated
    final OptionSpec<String> endpoint; final OptionSpec<String> region; final OptionSpec<String> vault; final OptionSpec<File> upload; final OptionSpec<String> download; final OptionSpec<String> inventoryListing; final OptionSpec<Void> createVault; @Deprecated
    final OptionSpec<File> credentials; final OptionSpec<String> deleteArchive; final OptionSpec<Void> deleteVault; final OptionSpec<File> calculateHash; final OptionSpec<File> multipartUpload; final OptionSpec<Long> partSize; final OptionSpec<Void> help; final OptionSpec<String> abortUpload; }
@Test public void canParseEndpointUrlToRegion() { assertEquals("eu-west-1", optionsParser.parseEndpointToRegion(ENDPOINT_URL)); assertEquals("eu-central-2", optionsParser.parseEndpointToRegion("eu-central-2")); }