List of usage examples for com.amazonaws.auth BasicAWSCredentials BasicAWSCredentials
public BasicAWSCredentials(String accessKey, String secretKey)
From source file:com.projectlaver.util.VoucherService.java
License:Open Source License
/** * Uploads the pdf file to the private S3 bucket. * //from ww w . j a v a 2s .c o m * @param pdfFilename * @param pdf */ void savePdf(String pdfFilename, File pdf) { AWSCredentials myCredentials = new BasicAWSCredentials(this.s3accessKey, this.s3secretKey); TransferManager tx = new TransferManager(myCredentials); Upload myUpload = tx.upload(this.s3privateBucketName, pdfFilename, pdf); try { myUpload.waitForCompletion(); } catch (Exception e) { this.logger.error(String.format( "Exception while trying to upload to S3 the PDF using the temp file with path: %s", pdf.getPath()), e); throw new RuntimeException("Unable to upload the PDF file to S3.", e); } }
From source file:com.proofpoint.discovery.elb.MainModule.java
License:Apache License
@Provides private AWSCredentials provideAwsCredentials(ServerConfig config) { return new BasicAWSCredentials(config.getAwsAccessKey(), config.getAwsSecretKey()); }
From source file:com.proofpoint.event.collector.MainModule.java
License:Apache License
@Provides @Singleton private AWSCredentials provideProviderCredentials(ServerConfig config) { return new BasicAWSCredentials(config.getAwsAccessKey(), config.getAwsSecretKey()); }
From source file:com.proofpoint.event.monitor.AmazonModule.java
License:Apache License
@Provides @Singleton//w w w. j a v a2 s .c o m private AWSCredentials provideProviderCredentials(AmazonConfig config) { if (!config.isAlertingEnabled()) { return new BasicAWSCredentials("", ""); } return new BasicAWSCredentials(config.getAwsAccessKey(), config.getAwsSecretKey()); }
From source file:com.proofpoint.event.monitor.aws.AmazonModule.java
License:Apache License
@Provides @Singleton private AWSCredentials provideProviderCredentials(AmazonConfig config) { return new BasicAWSCredentials(config.getAwsAccessKey(), config.getAwsSecretKey()); }
From source file:com.proofpoint.galaxy.coordinator.AwsProvisionerModule.java
License:Apache License
@Provides @Singleton//from ww w . ja v a2 s .co m public AWSCredentials provideAwsCredentials(AwsProvisionerConfig provisionerConfig) throws IOException { File credentialsFile = new File(provisionerConfig.getAwsCredentialsFile()); Properties properties = new Properties(); FileInputStream in = new FileInputStream(credentialsFile); try { properties.load(in); } finally { in.close(); } String accessKey = properties.getProperty("aws.access-key"); Preconditions.checkArgument(accessKey != null, "aws credentials file does not contain a value for aws.access-key"); String secretKey = properties.getProperty("aws.secret-key"); Preconditions.checkArgument(secretKey != null, "aws credentials file does not contain a value for aws.secret-key"); return new BasicAWSCredentials(accessKey, secretKey); }
From source file:com.qubole.qds.sdk.java.client.ResultStreamer.java
License:Apache License
@VisibleForTesting protected S3Client newS3Client() throws Exception { Account account = getAccount();/*from w w w .j a va2 s. c om*/ AWSCredentials awsCredentials = new BasicAWSCredentials(account.getStorage_access_key(), account.getStorage_secret_key()); final AmazonS3Client client = new AmazonS3Client(awsCredentials); return new S3Client() { @Override public void shutdown() { client.shutdown(); } @Override public ObjectListing listObjects(ListObjectsRequest listObjectsRequest) { return client.listObjects(listObjectsRequest); } @Override public S3Object getObject(String bucket, String key) { return client.getObject(bucket, key); } }; }
From source file:com.r573.enfili.common.resource.cloud.aws.dynamodb.DynamoDbManager.java
License:Apache License
public static void initWithCredentials(String awsAccessKey, String awsSecretKey, String region, String tag) { AWSCredentials awsCredentials = new BasicAWSCredentials(awsAccessKey, awsSecretKey); initWithCredentials(awsCredentials, region, tag); }
From source file:com.r573.enfili.common.resource.cloud.aws.ses.SesManager.java
License:Apache License
public static void initWithCredentials(String awsAccessKey, String awsSecretKey, String defaultSender, String tag) {/*from w w w . jav a2 s. c om*/ AWSCredentials awsCredentials = new BasicAWSCredentials(awsAccessKey, awsSecretKey); initWithCredentials(awsCredentials, defaultSender, tag); }
From source file:com.raoul.walkfoframe.web.DynamoDBManager.java
License:Open Source License
public static ArrayList<WOFPushNotification> getWofPushNotifications(int lastNotificationId) throws UnknownHostException { BasicAWSCredentials c = new BasicAWSCredentials("AKIAJRYXOB72QJQU3MQQ", "FOQ6TDEhxTqvZb6hb+5db1OQFd4nikDRh2tuGqy1"); AmazonDynamoDB clientManager = new AmazonDynamoDBClient(c); clientManager.setRegion(Region.getRegion(Regions.US_WEST_2)); AmazonDynamoDB ddb = clientManager;//from ww w . j av a2s .c o m DynamoDBMapper mapper = new DynamoDBMapper(ddb); DynamoDBScanExpression scanExpression = new DynamoDBScanExpression(); scanExpression.addFilterCondition("ID", new Condition().withComparisonOperator(ComparisonOperator.GT.toString()) .withAttributeValueList(new AttributeValue().withN(lastNotificationId + ""))); try { PaginatedScanList<WOFPushNotification> result = mapper.scan(WOFPushNotification.class, scanExpression); ArrayList<WOFPushNotification> resultList = new ArrayList<WOFPushNotification>(); for (WOFPushNotification up : result) { resultList.add(up); } Log.e("Push notification result list", resultList.size() + ""); return resultList; } catch (AmazonServiceException ex) { //HWOFameApplication.clientManager.wipeCredentialsOnAuthError(ex); } return null; }