本文整理汇总了Java中com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider类的典型用法代码示例。如果您正苦于以下问题:Java ClasspathPropertiesFileCredentialsProvider类的具体用法?Java ClasspathPropertiesFileCredentialsProvider怎么用?Java ClasspathPropertiesFileCredentialsProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClasspathPropertiesFileCredentialsProvider类属于com.amazonaws.auth包,在下文中一共展示了ClasspathPropertiesFileCredentialsProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PersistentStore
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
/**
* The only information needed to create a client are security credentials
* consisting of the AWS Access Key ID and Secret Access Key. All other
* configuration, such as the service endpoints, are performed
* automatically. Client parameters, such as proxies, can be specified in an
* optional ClientConfiguration object when constructing a client.
*
* @see com.amazonaws.auth.BasicAWSCredentials
* @see com.amazonaws.auth.PropertiesCredentials
* @see com.amazonaws.ClientConfiguration
*/
private PersistentStore(Region region, long readCapacity, long writeCapacity)
throws Exception {
/*
* This credentials provider implementation loads your AWS credentials
* from a properties file at the root of your classpath.
*/
dynamoDB = new AmazonDynamoDBClient(
new ClasspathPropertiesFileCredentialsProvider());
dynamoDB.setRegion(region);
try {
if (!tablesExist()) {
createTables(readCapacity, writeCapacity);
}
waitForTableToBecomeAvailable(TABLE_NAME);
} catch (Exception e) {
handleException(e);
}
}
示例2: MyCredentialsProvider
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
MyCredentialsProvider() {
super(new EnvironmentVariableCredentialsProvider(),
new SystemPropertiesCredentialsProvider(),
// Removed due to ElasticBeanstalk environment not being setup with a profile dir
// new ProfileCredentialsProvider(),
new InstanceProfileCredentialsProvider(),
new ClasspathPropertiesFileCredentialsProvider());
}
示例3: AmazonDynamoDBDAO
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
protected AmazonDynamoDBDAO() {
dynamoDB = new AmazonDynamoDBClient(new ClasspathPropertiesFileCredentialsProvider());
Region usWest2 = Region.getRegion(Regions.US_WEST_2);
String local_db = EnvironmentUtils.getInstance().getLocal_db();
if (local_db != null && local_db.trim().length() > 0) {
// LOCAL
dynamoDB.setEndpoint(local_db,"local","us-west-2");
} else {
// PROD
dynamoDB.setRegion(usWest2);
}
mapper = new DynamoDBMapper(dynamoDB);
}
示例4: updateApp
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
private static void updateApp() {
System.out.println("Downloading file (duckdns-dist) duckdns.war ---> /var/tmp/duckdns.war");
ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setProtocol(Protocol.HTTP);
AmazonS3 conn = new AmazonS3Client(new ClasspathPropertiesFileCredentialsProvider(), clientConfig);
conn.getObject(new GetObjectRequest("duckdns-dist", "duckdns.war"),new File("/var/tmp/duckdns.war"));
System.out.println("Done");
}
示例5: AmazonS3ManagerImpl
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
/**
* You can choose the geographical region where Amazon S3 will store the
* buckets you create. You might choose a region to optimize latency,
* minimize costs, or address regulator requirements.
*
* @param region
*/
public AmazonS3ManagerImpl(Region region) {
LOG.info("Create an instance of the AmazonS3Client class by providing your "
+ "AWS Account or IAM user credentials (Access Key ID, Secret Access Key)");
// Create an instance of the AmazonS3Client class by providing your AWS
// Account or IAM user credentials (Access Key ID, Secret Access Key)
amazonS3Client = new AmazonS3Client(new ClasspathPropertiesFileCredentialsProvider());
amazonS3Client.setRegion(region);
}
示例6: PropertiesFileConfiguration
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
/**
* Creates a {@link PropertiesFileConfiguration} from values provided in a classpath properties file.
*
* @param propertiesFile the classpath properties file to load.
*/
public PropertiesFileConfiguration(String propertiesFile) {
//load properties from configuration properties file
Properties prop = loadProperty(propertiesFile);
sqsUrl = prop.getProperty(SQS_URL);
LibraryUtils.checkArgumentNotNull(sqsUrl, "Cannot find SQS URL in properties file.");
String accessKey = prop.getProperty(ACCESS_KEY);
String secretKey = prop.getProperty(SECRET_KEY);
if (accessKey != null && secretKey != null) {
awsCredentialsProvider = new ClasspathPropertiesFileCredentialsProvider(propertiesFile);
}
s3Region = prop.getProperty(S3_REGION);
visibilityTimeout = getIntProperty(prop, VISIBILITY_TIMEOUT);
sqsRegion = prop.getProperty(SQS_REGION);
threadCount = getIntProperty(prop, THREAD_COUNT);
threadTerminationDelaySeconds = getIntProperty(prop, THREAD_TERMINATION_DELAY_SECONDS);
maxEventsPerEmit = getIntProperty(prop, MAX_EVENTS_PER_EMIT);
enableRawEventInfo = getBooleanProperty(prop, ENABLE_RAW_EVENT_INFO);
deleteMessageUponFailure = getBooleanProperty(prop, DELETE_MESSAGE_UPON_FAILURE);
}
示例7: FandomDAO
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
public FandomDAO() {
client = new AmazonDynamoDBClient(
new ClasspathPropertiesFileCredentialsProvider());
mapper = new DynamoDBMapper(client);
Fandom test = mapper.load(Fandom.class, "fandoms");
if (test == null) {
test = new Fandom();
test.setId("fandoms");
mapper.save(test);
}
}
示例8: CraftDAO
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
public CraftDAO(){
client = new AmazonDynamoDBClient(new ClasspathPropertiesFileCredentialsProvider());
mapper = new DynamoDBMapper(client);
Craft test = mapper.load(Craft.class, "crafts");
if(test == null){
test = new Craft();
test.setId("crafts");
mapper.save(test);
}
}
示例9: copyFiles
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
@Override
public void copyFiles(File directory, List<String> keys, boolean preserveDirectories)
{
try
{
List<File> files = new LinkedList<File>();
AmazonS3 client = new AmazonS3Client(new ClasspathPropertiesFileCredentialsProvider());
for (String key : keys)
{
GetObjectRequest request = new GetObjectRequest("geodashboarddata", key);
S3Object object = client.getObject(request);
InputStream istream = object.getObjectContent();
try
{
String targetPath = this.getTargetPath(preserveDirectories, key);
File file = new File(directory, targetPath);
FileUtils.copyInputStreamToFile(istream, file);
files.add(file);
}
finally
{
// Process the objectData stream.
istream.close();
}
}
}
catch (IOException e)
{
throw new ProgrammingErrorException(e);
}
}
示例10: listFiles
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
private List<String> listFiles(String prefix)
{
List<String> files = new LinkedList<String>();
try
{
AmazonS3 s3Client = new AmazonS3Client(new ClasspathPropertiesFileCredentialsProvider());
ListObjectsRequest request = new ListObjectsRequest();
request = request.withBucketName("geodashboarddata");
request = request.withPrefix(prefix);
ObjectListing listing;
do
{
listing = s3Client.listObjects(request);
List<S3ObjectSummary> summaries = listing.getObjectSummaries();
for (S3ObjectSummary summary : summaries)
{
String key = summary.getKey();
if (key.endsWith(".xml.gz"))
{
files.add(key);
}
}
request.setMarker(listing.getNextMarker());
} while (listing != null && listing.isTruncated());
}
catch (Exception e)
{
logger.error("Unable to retrieve files", e);
}
return files;
}
示例11: CustomCredentialsProviderChain
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
public CustomCredentialsProviderChain() {
super(new ClasspathPropertiesFileCredentialsProvider(), new InstanceProfileCredentialsProvider(),
new SystemPropertiesCredentialsProvider(), new EnvironmentVariableCredentialsProvider(),
new ProfileCredentialsProvider());
}
示例12: awsCredentials
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
@Bean
AWSCredentialsProvider awsCredentials()
{
return new ClasspathPropertiesFileCredentialsProvider( "aws-credentials.properties" );
}
示例13: init
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
private static void init() {
speechCloud = new IvonaSpeechCloudClient(
new ClasspathPropertiesFileCredentialsProvider("resources/IvonaCredentials.properties"));
speechCloud.setEndpoint("https://tts.eu-west-1.ivonacloud.com");
}
开发者ID:IvonaSoftware,项目名称:ivona-speechcloud-sdk-java,代码行数:6,代码来源:SampleIvonaSpeechCloudVoiceList.java
示例14: CustomCredentialsProviderChain
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
public CustomCredentialsProviderChain() {
super(new ClasspathPropertiesFileCredentialsProvider(), new InstanceProfileCredentialsProvider(),
new SystemPropertiesCredentialsProvider(), new EnvironmentVariableCredentialsProvider());
}
示例15: CustomCredentialsProviderChain
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider; //导入依赖的package包/类
public CustomCredentialsProviderChain() {
super(new EnvironmentVariableCredentialsProvider(),
new SystemPropertiesCredentialsProvider(),
new ClasspathPropertiesFileCredentialsProvider(),
new InstanceProfileCredentialsProvider());
}