Example usage for com.amazonaws.auth SignerFactory registerSigner

List of usage examples for com.amazonaws.auth SignerFactory registerSigner

Introduction

In this page you can find the example usage for com.amazonaws.auth SignerFactory registerSigner.

Prototype

public static void registerSigner(final String signerType, final Class<? extends Signer> signerClass) 

Source Link

Document

Register an implementation class for the given signer type.

Usage

From source file:org.icgc.dcc.storage.server.service.download.ObjectDownloadServiceStubFactory.java

License:Open Source License

public static AmazonS3 createS3ClientForRadosGW(String endpoint) {
    // Configs copied from S3Config
    // RadosGW doesn't support latest AWS API version: AWSS3V4SignerType
    val clientConfiguration = new ClientConfiguration();
    SignerFactory.registerSigner("S3Signer", S3Signer.class);
    clientConfiguration.setSignerOverride("S3SignerType");
    clientConfiguration.setProtocol(Protocol.HTTPS);
    val s3Client = new AmazonS3Client(new BasicAWSCredentials("accesskey", "secret"), clientConfiguration);
    s3Client.setEndpoint(endpoint);/*from w  w  w.jav  a 2s  .  c o m*/
    s3Client.setS3ClientOptions(new S3ClientOptions().withPathStyleAccess(true));
    return s3Client;
}