View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.artifact.repository;
20  
21  /**
22   * Authentication
23   */
24  public class Authentication {
25  
26      private String privateKey;
27  
28      private String passphrase;
29  
30      public Authentication(String userName, String password) {
31          this.username = userName;
32          this.password = password;
33      }
34  
35      /**
36       * Username used to log in to the host
37       */
38      private String username;
39  
40      /**
41       * Password associated with the login
42       */
43      private String password;
44  
45      /**
46       * Get the user's password which is used when connecting to the repository.
47       *
48       * @return password of user
49       */
50      public String getPassword() {
51          return password;
52      }
53  
54      /**
55       * Set the user's password which is used when connecting to the repository.
56       *
57       * @param password password of the user
58       */
59      public void setPassword(String password) {
60          this.password = password;
61      }
62  
63      /**
64       * Get the username used to access the repository.
65       *
66       * @return username at repository
67       */
68      public String getUsername() {
69          return username;
70      }
71  
72      /**
73       * Set username used to access the repository.
74       *
75       * @param userName the username used to access repository
76       */
77      public void setUsername(final String userName) {
78          this.username = userName;
79      }
80  
81      /**
82       * Get the passphrase of the private key file. The passphrase is used only when host/protocol supports
83       * authentication via exchange of private/public keys and private key was used for authentication.
84       *
85       * @return passphrase of the private key file
86       */
87      public String getPassphrase() {
88          return passphrase;
89      }
90  
91      /**
92       * Set the passphrase of the private key file.
93       *
94       * @param passphrase passphrase of the private key file
95       */
96      public void setPassphrase(final String passphrase) {
97          this.passphrase = passphrase;
98      }
99  
100     /**
101      * Get the absolute path to the private key file.
102      *
103      * @return absolute path to private key
104      */
105     public String getPrivateKey() {
106         return privateKey;
107     }
108 
109     /**
110      * Set the absolute path to private key file.
111      *
112      * @param privateKey path to private key in local file system
113      */
114     public void setPrivateKey(final String privateKey) {
115         this.privateKey = privateKey;
116     }
117 }