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


Java Regions.US_EAST_1属性代码示例

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


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

示例1: NetworkStore

NetworkStore() {

        kwalaCookieStore = new KwalaCookieStore(KwalaApplication.getInstance());
        CookieManager cookieManager = new CookieManager(kwalaCookieStore, CookiePolicy.ACCEPT_ORIGINAL_SERVER);
        CookieHandler.setDefault(cookieManager);

        okHttpClient = new OkHttpClient.Builder()
                .cookieJar(new JavaNetCookieJar(cookieManager))
                .authenticator(authenticator)
                .readTimeout(30, TimeUnit.SECONDS)
                .writeTimeout(30, TimeUnit.SECONDS)
                .build();

        KwalaApplication application = KwalaApplication.getInstance();

        // Initialize the Amazon Cognito credentials provider
        CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(application,
                KwalaConstants.Network.AWS_IDENTITY_POOL_ID,
                Regions.US_EAST_1
        );

        // Initialize Amazon S3 and transfer utility
        s3Client = new AmazonS3Client(credentialsProvider);
        transferUtility = new TransferUtility(s3Client, application);
    }
 
开发者ID:KwalaGroup,项目名称:Android-Client,代码行数:25,代码来源:NetworkStore.java

示例2: initPollyClient

private void initPollyClient(Context context, String awsPoolId) {
  CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
    context,
    awsPoolId,
    Regions.US_EAST_1
  );
  pollyClient = new AmazonPollyPresigningClient(credentialsProvider);
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:8,代码来源:PollyPlayer.java

示例3: putToS3

/**
 * Performs an S3 Put Object operation storing the UTF-8 bytes of logMsg under the given key
 * using construction provided AWS credentials.
 *
 * @param objectKey the S3 object key. may not be null or whitespace only.
 * @param logMsg the message to store
 * @throws IllegalArgumentException if objectKey is whitespace only.
 */
void putToS3(String objectKey, String logMsg)
{
    if(objectKey == null)
        throw new NullPointerException("objectKey");

    if(objectKey.trim().length() == 0)
        throw new IllegalArgumentException("objectKey may not be only whitespace.");

     /*
     * Make the client used to send the log msg to S3.
     */
    AmazonS3 client;
    {
        Regions regions = Regions.US_EAST_1;
        if(_credentials == null)
        {
            client = AmazonS3ClientBuilder.standard() // get creds from environment
                    .withRegion(regions)
                    .build();
        }
        else
        {
            client =  AmazonS3ClientBuilder.standard()
                    .withCredentials(new AWSStaticCredentialsProvider(_credentials))
                    .withRegion(regions)
                    .build();
        }
    }


    /*
     * Store the log msg in S3.
     */
    byte[] logMsgBytes = logMsg.getBytes(StandardCharsets.UTF_8);

    ObjectMetadata metadata = new ObjectMetadata();
    metadata.setContentLength(logMsgBytes.length);

    client.putObject(_bucketName, objectKey, new ByteArrayInputStream(logMsgBytes), metadata);

    _logger.debug("exiting");
}
 
开发者ID:capergroup,项目名称:bayou,代码行数:50,代码来源:S3LoggerBase.java

示例4: setUp

@Before
public void setUp() throws Exception {
    connectorModel = new ConnectorModel(Regions.US_EAST_1, Constant.CredentialProfile.DEFAULT);
}
 
开发者ID:satr,项目名称:intellij-idea-plugin-connector-for-aws-lambda,代码行数:4,代码来源:ConnectorModelTestCasesBase.java


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