本文整理汇总了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);
}
示例2: initPollyClient
private void initPollyClient(Context context, String awsPoolId) {
CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
context,
awsPoolId,
Regions.US_EAST_1
);
pollyClient = new AmazonPollyPresigningClient(credentialsProvider);
}
示例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");
}
示例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