001    /**
002     * Copyright 2010-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.maven.wagon.auth;
017    
018    import com.amazonaws.auth.AWSCredentials;
019    
020    /**
021     * Implementation of <code>AWSCredentials</code> that is immutable.
022     */
023    public final class AwsCredentials implements AWSCredentials {
024    
025            public AwsCredentials(AWSCredentials credentials) {
026                    this(credentials.getAWSAccessKeyId(), credentials.getAWSSecretKey());
027            }
028    
029            public AwsCredentials(String accessKey, String secretKey) {
030                    Assert.noBlanks(accessKey, secretKey);
031                    this.accessKey = accessKey;
032                    this.secretKey = secretKey;
033            }
034    
035            private final String accessKey;
036            private final String secretKey;
037    
038            public String getAWSAccessKeyId() {
039                    return accessKey;
040            }
041    
042            public String getAWSSecretKey() {
043                    return secretKey;
044            }
045    
046    }