01: package com.jat.util.mail;
02:
03: import javax.mail.Authenticator;
04: import javax.mail.PasswordAuthentication;
05:
06: /**
07: * <p>Title: JAT</p>
08: * <p>Description: </p>
09: * <p>Copyright: Copyright (c) 2004 -2005 Stefano Fratini (stefano.fratini@gmail.com)</p>
10: * <p>Distributed under the terms of the GNU Lesser General Public License, v2.1 or later</p>
11: * @author stf
12: * @version 1.1
13: */
14:
15: public class Authentication extends Authenticator {
16:
17: public String getUsername() {
18: return this .passwordAuthentication.getUserName();
19: }
20:
21: protected Authentication(String username, String password) {
22: this .passwordAuthentication = new PasswordAuthentication(
23: username, password);
24: }
25:
26: protected PasswordAuthentication getPasswordAuthentication() {
27: return this .passwordAuthentication;
28: }
29:
30: protected String getPassword() {
31: return this .passwordAuthentication.getPassword();
32: }
33:
34: private PasswordAuthentication passwordAuthentication;
35: }
|