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