private AmazonS3 cacheClient ( String region ) { if ( awscredentialsProvider == null ) { throw new IllegalArgumentException ( "No credentials provider found to connect to S3" ) ; } AmazonS3 client = new AmazonS3Client ( awscredentialsProvider ) ; client . setRegion ( RegionUtils . getRegion ( region ) ) ; clientsByRegion . put ( region , client ) ; return client ; }
Returns a new client with region configured to region . Also updates the clientsByRegion map by associating the new client with region .