Package com.amazonaws.auth

Examples of com.amazonaws.auth.PropertiesCredentials


  public GoraDynamoDBTestDriver() {
    super(DynamoDBStore.class);
    try {
      AWSCredentials credentials;
      File file = new File(awsCredentialsPath + awsCredentialsFile);
      credentials = new PropertiesCredentials(file);
      auth = credentials;
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IllegalArgumentException e) {
      e.printStackTrace();
View Full Code Here


   
  if(authentication == null){
    InputStream awsCredInpStr = getClass().getClassLoader().getResourceAsStream(awsCredentialsProperties);
    if (awsCredInpStr == null)
      LOG.info("AWS Credentials File was not found on the classpath!");
      AWSCredentials credentials = new PropertiesCredentials(awsCredInpStr);
      setConf(credentials);
  }
  return (AWSCredentials)authentication;
  }
View Full Code Here

  public AmazonSESMailer(Environment env) throws IOException {
    this.env = env;
    InputStream resource = AmazonSESMailer.class
        .getResourceAsStream("/AwsCredentials.properties");
    PropertiesCredentials credentials = new PropertiesCredentials(resource);
    this.client = new AmazonSimpleEmailServiceClient(credentials);
    Properties props = new Properties();
    props.setProperty("mail.transport.protocol", "aws");
    props.setProperty("mail.aws.user", credentials.getAWSAccessKeyId());
    props.setProperty("mail.aws.password", credentials.getAWSSecretKey());
    this.session = Session.getInstance(props);
  }
View Full Code Here

        // Use any explicitly specified credentials properties file next
        if (credentialsFile != null) {
            try {
                getContainer().getLogger().debug("Reading security credentials from properties file: " + credentialsFile);
                PropertiesCredentials credentials = new PropertiesCredentials(credentialsFile);
                getContainer().getLogger().debug("Using AWS credentials from file: " + credentialsFile);
                return new StaticCredentialsProvider(credentials);
            } catch (Exception e) {
                throw new AmazonClientException(
                        "Unable to read AWS security credentials from file specified in context.xml: " + credentialsFile, e);
View Full Code Here

            String errMsg = "Missing primary key attribute name, cannot continue";
            logger.error(errMsg);
        }

        try {
            AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile));
            ClientConfiguration cconfig = new ClientConfiguration();
            cconfig.setMaxConnections(maxConnects);
            dynamoDB = new AmazonDynamoDBClient(credentials,cconfig);
            dynamoDB.setEndpoint(this.endpoint);
            primaryKeyName = primaryKey;
View Full Code Here

   * @param maxKeys maximal number of keys to retrieve from S3 in single call
   * @throws IOException
   */
  public S3BucketReader(String bucketName, String keyPrefix, String marker, int maxKeys) throws IOException {
    listObjectsRequest = new ListObjectsRequest(bucketName, keyPrefix, marker, "", maxKeys);
    s3Client = new AmazonS3Client(new PropertiesCredentials(
        S3RecordReader.class.getResourceAsStream("/AwsCredentials.properties")));
  }
View Full Code Here

  public AmazonSESMailer(Environment env) throws IOException {
    this.env = env;
    InputStream resource = AmazonSESMailer.class
        .getResourceAsStream("/AwsCredentials.properties");
    PropertiesCredentials credentials = new PropertiesCredentials(resource);
    this.client = new AmazonSimpleEmailServiceClient(credentials);
    Properties props = new Properties();
    props.setProperty("mail.transport.protocol", "aws");
    props.setProperty("mail.aws.user", credentials.getAWSAccessKeyId());
    props.setProperty("mail.aws.password", credentials.getAWSSecretKey());
    this.session = Session.getInstance(props);
  }
View Full Code Here

  public AmazonSESMailer(Environment env) throws IOException {
    this.env = env;
    InputStream resource = AmazonSESMailer.class
        .getResourceAsStream("/AwsCredentials.properties");
    PropertiesCredentials credentials = new PropertiesCredentials(resource);
    this.client = new AmazonSimpleEmailServiceClient(credentials);
    Properties props = new Properties();
    props.setProperty("mail.transport.protocol", "aws");
    props.setProperty("mail.aws.user", credentials.getAWSAccessKeyId());
    props.setProperty("mail.aws.password", credentials.getAWSSecretKey());
    this.session = Session.getInstance(props);
  }
View Full Code Here

        AWSCredentials awsCredentials = null;
        InputStream credentialsFile = getClass().getClassLoader().getResourceAsStream("AwsCredentials.properties");
        if (credentialsFile != null) {
            logger.info("Loading credentials from AwsCredentials.properties");
            try {
                awsCredentials = new PropertiesCredentials(credentialsFile);
            } catch (IOException e) {
                throw new PersistenceException("Failed loading credentials from AwsCredentials.properties.", e);
            }
        } else {
            logger.info("Loading credentials from simplejpa.properties");
View Full Code Here

         * Important: Be sure to fill in your AWS access credentials in the
         *            AwsCredentials.properties file before you try to run this
         *            sample.
         * http://aws.amazon.com/security-credentials
         */
        AmazonS3 s3 = new AmazonS3Client(new PropertiesCredentials(
                S3Sample.class.getResourceAsStream("AwsCredentials.properties")));

        String bucketName = "my-first-s3-bucket-" + UUID.randomUUID();
        String key = "MyObjectKey";

View Full Code Here

TOP

Related Classes of com.amazonaws.auth.PropertiesCredentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.