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  /**
23   * Authentication
24   */
25  public class Authentication
26  {
27  
28      private String privateKey;
29  
30      private String passphrase;
31  
32      public Authentication( String userName, String password )
33      {
34          this.username = userName;
35          this.password = password;
36      }
37  
38      /**
39       * Username used to login to the host
40       */
41      private String username;
42  
43      /**
44       * Password associated with the login
45       */
46      private String password;
47  
48      /**
49       * Get the user's password which is used when connecting to the repository.
50       *
51       * @return password of user
52       */
53      public String getPassword()
54      {
55          return password;
56      }
57  
58      /**
59       * Set the user's password which is used when connecting to the repository.
60       *
61       * @param password password of the user
62       */
63      public void setPassword( String password )
64      {
65          this.password = password;
66      }
67  
68      /**
69       * Get the username used to access the repository.
70       *
71       * @return username at repository
72       */
73      public String getUsername()
74      {
75          return username;
76      }
77  
78      /**
79       * Set username used to access the repository.
80       *
81       * @param userName the username used to access repository
82       */
83      public void setUsername( final String userName )
84      {
85          this.username = userName;
86      }
87  
88      /**
89       * Get the passphrase of the private key file. The passphrase is used only when host/protocol supports
90       * authentication via exchange of private/public keys and private key was used for authentication.
91       *
92       * @return passphrase of the private key file
93       */
94      public String getPassphrase()
95      {
96          return passphrase;
97      }
98  
99      /**
100      * Set the passphrase of the private key file.
101      *
102      * @param passphrase passphrase of the private key file
103      */
104     public void setPassphrase( final String passphrase )
105     {
106         this.passphrase = passphrase;
107     }
108 
109     /**
110      * Get the absolute path to the private key file.
111      *
112      * @return absolute path to private key
113      */
114     public String getPrivateKey()
115     {
116         return privateKey;
117     }
118 
119     /**
120      * Set the absolute path to private key file.
121      *
122      * @param privateKey path to private key in local file system
123      */
124     public void setPrivateKey( final String privateKey )
125     {
126         this.privateKey = privateKey;
127     }
128 
129 }