KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > helpers > SourceCredential


1 /*
2  * Copyright 2001,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.cocoon.components.source.helpers;
18
19 /**
20  * This class represents a credential for a given user
21  *
22  * @author <a HREF="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
23  * @version CVS $Id: SourceCredential.java 30932 2004-07-29 17:35:38Z vgritsenko $
24  */

25 public class SourceCredential {
26
27     private String JavaDoc principal = "guest";
28     private String JavaDoc password = "guest";
29
30     /**
31      * Create a new credential
32      *
33      * @param principal The user name
34      */

35     public SourceCredential(String JavaDoc principal) {
36         this.principal = principal;
37     }
38
39     /**
40      * Create a new credential
41      *
42      * @param principal The user name
43      * @param password Password
44      */

45     public SourceCredential(String JavaDoc principal, String JavaDoc password) {
46         this.principal = principal;
47         this.password = password;
48     }
49
50     /**
51      * Sets the principal
52      *
53      * @param principal The user name
54      */

55     public void setPrincipal(String JavaDoc principal) {
56         this.principal = principal;
57     }
58
59     /**
60      * Returns the principal
61      *
62      * @return Principal
63      */

64     public String JavaDoc getPrincipal() {
65         return this.principal;
66     }
67
68     /**
69      * Sets the password
70      *
71      * @param password Password
72      */

73     public void setPassword(String JavaDoc password) {
74         this.password = password;
75     }
76
77     /**
78      * Returns the password
79      *
80      * @return Password
81      */

82     public String JavaDoc getPassword() {
83         return this.password;
84     }
85 }
86
Popular Tags