01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.cocoon.components.source.helpers;
19:
20: /**
21: * This class represents a credential for a given user
22: *
23: * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
24: * @version CVS $Id: SourceCredential.java 433543 2006-08-22 06:22:54Z crossley $
25: */
26: public class SourceCredential {
27:
28: private String principal = "guest";
29: private String password = "guest";
30:
31: /**
32: * Create a new credential
33: *
34: * @param principal The user name
35: */
36: public SourceCredential(String principal) {
37: this .principal = principal;
38: }
39:
40: /**
41: * Create a new credential
42: *
43: * @param principal The user name
44: * @param password Password
45: */
46: public SourceCredential(String principal, String password) {
47: this .principal = principal;
48: this .password = password;
49: }
50:
51: /**
52: * Sets the principal
53: *
54: * @param principal The user name
55: */
56: public void setPrincipal(String principal) {
57: this .principal = principal;
58: }
59:
60: /**
61: * Returns the principal
62: *
63: * @return Principal
64: */
65: public String getPrincipal() {
66: return this .principal;
67: }
68:
69: /**
70: * Sets the password
71: *
72: * @param password Password
73: */
74: public void setPassword(String password) {
75: this .password = password;
76: }
77:
78: /**
79: * Returns the password
80: *
81: * @return Password
82: */
83: public String getPassword() {
84: return this.password;
85: }
86: }
|