当前位置: 首页>>代码示例>>Java>>正文


Java AmazonS3Client.setS3ClientOptions方法代码示例

本文整理汇总了Java中com.amazonaws.services.s3.AmazonS3Client.setS3ClientOptions方法的典型用法代码示例。如果您正苦于以下问题:Java AmazonS3Client.setS3ClientOptions方法的具体用法?Java AmazonS3Client.setS3ClientOptions怎么用?Java AmazonS3Client.setS3ClientOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.s3.AmazonS3Client的用法示例。


在下文中一共展示了AmazonS3Client.setS3ClientOptions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAmazonS3Client

import com.amazonaws.services.s3.AmazonS3Client; //导入方法依赖的package包/类
private AmazonS3Client getAmazonS3Client(BackupRestoreContext ctx) throws URISyntaxException {
    final String accessKey = ctx.getAccountId();
    final String secretKey = ctx.getSecretKey();
    String endpoint = getEndpoint(ctx);
    LOGGER.info("endpoint: {}", endpoint);

    final BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(accessKey, secretKey);
    final AmazonS3Client amazonS3Client = new AmazonS3Client(basicAWSCredentials);
    amazonS3Client.setEndpoint(endpoint);

    if (ctx.usesEmc()) {
        final S3ClientOptions options = new S3ClientOptions();
        options.setPathStyleAccess(true);
        amazonS3Client.setS3ClientOptions(options);
    }

    return amazonS3Client;
}
 
开发者ID:mesosphere,项目名称:dcos-cassandra-service,代码行数:19,代码来源:S3StorageDriver.java

示例2: connectToS3

import com.amazonaws.services.s3.AmazonS3Client; //导入方法依赖的package包/类
private void connectToS3(String accessKey, String secretKey, String endpoint, boolean secure, boolean pathStyle) {
    LOG.info("'{}','{}','{}'", accessKey, secretKey, endpoint);
    AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);

    ClientConfiguration clientConfiguration = new ClientConfiguration()
            .withProtocol(secure ? Protocol.HTTPS : Protocol.HTTP)
            .withUserAgentPrefix("s3browser")
            .withSignerOverride("S3SignerType");

    s3Client = new AmazonS3Client(credentials, clientConfiguration);
    s3Client.setS3ClientOptions(S3ClientOptions.builder()
            .setPathStyleAccess(pathStyle)
            .disableChunkedEncoding()
            .build());
    s3Client.setEndpoint(endpoint);
}
 
开发者ID:jenshadlich,项目名称:s3browser,代码行数:17,代码来源:BrowseUI.java

示例3: s3Ninja

import com.amazonaws.services.s3.AmazonS3Client; //导入方法依赖的package包/类
@Bean
@Profile("dev")
public AmazonS3Client s3Ninja() {
    AWSCredentials credentials = new BasicAWSCredentials(
            "AKIAIOSFODNN7EXAMPLE",
            "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY");
    AmazonS3Client newClient = new AmazonS3Client(credentials,
            new ClientConfiguration());
    newClient.setS3ClientOptions(new S3ClientOptions()
            .withPathStyleAccess(true));
    
    newClient.setEndpoint("http://localhost:9444/s3");
    return newClient;

}
 
开发者ID:nailtonvieira,项目名称:pswot-cloud-java-spring-webapp,代码行数:16,代码来源:AmazonConfiguration.java

示例4: s3Amazon

import com.amazonaws.services.s3.AmazonS3Client; //导入方法依赖的package包/类
@Bean
@Profile("prod")
public AmazonS3Client s3Amazon() {
    AWSCredentials credentials = new BasicAWSCredentials(
            "AKIAIOSFODNN7EXAMPLE",
            "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY");
    AmazonS3Client newClient = new AmazonS3Client(credentials,
            new ClientConfiguration());
    newClient.setS3ClientOptions(new S3ClientOptions()
            .withPathStyleAccess(true));
    
    return newClient;

}
 
开发者ID:nailtonvieira,项目名称:pswot-cloud-java-spring-webapp,代码行数:15,代码来源:AmazonConfiguration.java

示例5: setUp

import com.amazonaws.services.s3.AmazonS3Client; //导入方法依赖的package包/类
@BeforeMethod
public void setUp() throws Exception {
    s3mock = System.getProperty("s3mock");
    s3mock = s3mock != null ? s3mock : "http://localhost:9444/s3";
    client = new AmazonS3Client(new BasicAWSCredentials("AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"));
    client.setEndpoint(s3mock);
    client.setS3ClientOptions(new S3ClientOptions().withPathStyleAccess(true));
}
 
开发者ID:MeteoGroup,项目名称:s3mock,代码行数:9,代码来源:S3MockTest.java


注:本文中的com.amazonaws.services.s3.AmazonS3Client.setS3ClientOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。