01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.core.auth;
13:
14: /**
15: * The <b>SVNPasswordAuthentication</b> class represents a simple
16: * user credential pair - a username and password.
17: *
18: * <p>
19: * To obtain a password credential, specify the {@link ISVNAuthenticationManager#PASSWORD PASSWORD}
20: * kind to credentials getter method of <b>ISVNAuthenticationManager</b>:
21: * {@link ISVNAuthenticationManager#getFirstAuthentication(String, String, SVNURL) getFirstAuthentication()},
22: * {@link ISVNAuthenticationManager#getNextAuthentication(String, String, SVNURL) getNextAuthentication()}.
23: *
24: * @version 1.1.1
25: * @author TMate Software Ltd.
26: */
27: public class SVNPasswordAuthentication extends SVNAuthentication {
28:
29: private String myPassword;
30:
31: /**
32: * Creates a password user credential object given a username and password.
33: *
34: * @param userName the name of a user to authenticate
35: * @param password the user's password
36: * @param storageAllowed if <span class="javakeyword">true</span> then
37: * this credential is allowed to be stored in the
38: * global auth cache, otherwise not
39: */
40: public SVNPasswordAuthentication(String userName, String password,
41: boolean storageAllowed) {
42: super (ISVNAuthenticationManager.PASSWORD, userName,
43: storageAllowed);
44: myPassword = password == null ? "" : password;
45: }
46:
47: /**
48: * Returns this user credential's password.
49: *
50: * @return the user's password
51: */
52: public String getPassword() {
53: return myPassword;
54: }
55: }
|