@Override
    public void initialize(Map<String, Param> params) throws TikaConfigException {
        //params have already been set...ignore them
        AWSCredentialsProvider provider;
        if (credentialsProvider.equals("instance")) {
            provider = InstanceProfileCredentialsProvider.getInstance();
        } else if (credentialsProvider.equals("profile")) {
            provider = new ProfileCredentialsProvider(profile);
        } else if (credentialsProvider.equals("key_secret")) {
            provider =
                    new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey));
        } else {
            throw new TikaConfigException("credentialsProvider must be set and " +
                    "must be either 'instance', 'profile' or 'key_secret'");
        }
        ClientConfiguration clientConfiguration = new ClientConfiguration()
                .withMaxConnections(maxConnections);
        try {
            synchronized (clientLock) {
                AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder.standard()
                        .withClientConfiguration(clientConfiguration)
                        .withPathStyleAccessEnabled(pathStyleAccessEnabled)
                        .withCredentials(provider);
                if (!StringUtils.isBlank(endpointConfigurationService)) {
                    amazonS3ClientBuilder.setEndpointConfiguration(
                            new AwsClientBuilder
                                    .EndpointConfiguration(endpointConfigurationService, region));
                } else {
                    amazonS3ClientBuilder.withRegion(region);
                }
                s3Client = amazonS3ClientBuilder.build();
            }
        } catch (AmazonClientException e) {
            throw new TikaConfigException("can't initialize s3 fetcher", e);
        }
        if (throttleSeconds == null) {
            throttleSeconds = new long[retries];
            for (int i = 0; i < retries; i++) {
                throttleSeconds[i] = sleepBeforeRetryMillis * 1000;
            }
        }
    }
This initializes the s3 client. Note, we wrap S3's RuntimeExceptions,
e.g. AmazonClientException in a TikaConfigException.

@param params params to use for initialization
@throws TikaConfigException
tika-pipes/tika-fetchers/tika-fetcher-s3/src/main/java/org/apache/tika/pipes/fetcher/s3/S3Fetcher.java