List of usage examples for org.apache.hadoop.fs.s3a S3AUtils createAWSCredentialProvider
public static AWSCredentialsProvider createAWSCredentialProvider(Configuration conf, Class<?> credClass, URI uri) throws IOException
From source file:com.thinkbiganalytics.kylo.catalog.aws.S3FileSystemProvider.java
License:Apache License
/** * Gets a custom credentials provider from the specified Hadoop configuration. *//*w ww . ja va2s. c om*/ @Nonnull @VisibleForTesting Optional<AWSCredentialsProvider> getCustomCredentialsProvider(@Nonnull final URI uri, @Nonnull final Configuration conf) { return Optional.ofNullable(conf.getClass("fs.s3.customAWSCredentialsProvider", null)).map(providerClass -> { try { return S3AUtils.createAWSCredentialProvider(conf, providerClass, uri); } catch (final IOException e) { throw new IllegalArgumentException("Unable to create S3 client: " + e, e); } }); }