com.jwrapper.maven.util.AWSCredentialsImpl.java Source code

Java tutorial

Introduction

Here is the source code for com.jwrapper.maven.util.AWSCredentialsImpl.java

Source

/**
 * Copyright (C) 2010-2013 Andrei Pozolotin <Andrei.Pozolotin@gmail.com>
 *
 * All rights reserved. Licensed under the OSI BSD License.
 *
 * http://www.opensource.org/licenses/bsd-license.php
 */
package com.jwrapper.maven.util;

import org.apache.maven.settings.Server;

import com.amazonaws.auth.AWSCredentials;

/**
 * amazon user/pass from maven settings.xml server entry
 */
public class AWSCredentialsImpl implements AWSCredentials {

    private final String accessKey;
    private final String secretKey;

    public AWSCredentialsImpl(final Server server) {
        this.accessKey = server.getUsername();
        this.secretKey = server.getPassword();
    }

    @Override
    public String getAWSAccessKeyId() {
        return accessKey;
    }

    @Override
    public String getAWSSecretKey() {
        return secretKey;
    }

}