Package com.amazonaws.auth

Examples of com.amazonaws.auth.PropertiesCredentials


         * 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
         */
        AmazonSimpleDB sdb = new AmazonSimpleDBClient(new PropertiesCredentials(
                SimpleDBSample.class.getResourceAsStream("AwsCredentials.properties")));

        System.out.println("===========================================");
        System.out.println("Getting Started with Amazon SimpleDB");
        System.out.println("===========================================\n");
View Full Code Here


  public static void init()
  {
    try
    {
      sdb = new AmazonSimpleDBClient(new PropertiesCredentials(
                SimpleDBSample.class.getResourceAsStream("AwsCredentials.properties")));
      // Create a domain
      //sdb.createDomain(new CreateDomainRequest(myDomain));       
      s3 = new AmazonS3Client(new PropertiesCredentials(
          S3Sample.class.getResourceAsStream("AwsCredentials.properties")));
            //s3.createBucket(myBucket);

    }catch(IOException e)
    {
View Full Code Here

    try {

      final File file = new File(getCredentials());

      final AWSCredentials creds = new PropertiesCredentials(file);

      amazonClient = new AmazonSNSAsyncClient(creds, service);

      return true;
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 class RemoteCloudWatchTest {
    @Test
    public void testSendingToAmazon() throws IOException {
        URL props = Resources.getResource("aws_creds.properties");
        InputStream is = Resources.newInputStreamSupplier(props).getInput();
        AWSCredentials creds = new PropertiesCredentials(is);

        Timer timer = Metrics.newTimer(CloudWatchReporterTest.class, "TestTimer", TimeUnit.MINUTES, TimeUnit.MINUTES);
        for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 50; j++) {
                timer.update(i, TimeUnit.MINUTES);
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

   
    @PostConstruct
    public void create() {
        URL resource = getCredentialsResource();
        try {
            PropertiesCredentials credentials = new PropertiesCredentials(new File(resource.getFile()));
            amazonS3Client = new AmazonS3Client(credentials);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Could not instantiate amazon S3 client", e);
        } catch (IOException e) {
            throw new RuntimeException("Could not instantiate amazon S3 client", e);
View Full Code Here

    try {

      final File file = new File(getCredentials());

      final AWSCredentials creds = new PropertiesCredentials(file);

      amazonClient = new AmazonSNSAsyncClient(creds, service);

      return true;
View Full Code Here

    private JFrame frame;
    private Upload upload;
    private JButton button;

    public static void main(String[] args) throws Exception {
        credentials = new PropertiesCredentials(S3TransferProgressSample.class
                .getResourceAsStream("AwsCredentials.properties"));

        // TransferManager manages a pool of threads, so we create a
        // single instance and share it throughout our application.
        tx = new TransferManager(credentials);
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.