1 package org.wcb.common; 2 3 import javax.mail.PasswordAuthentication; 4 import javax.mail.Authenticator; 5 /*** 6 * Copyright (C) 1999 Walter Bogaardt 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 * 22 * EmailAuthenticator.java 23 * 24 * Created on February 2, 2004, 7:59 PM 25 * 26 * @author wbogaardt 27 * 28 * Project: Home Automation Interface 29 * Filename: $Id: EmailAuthenticator.java,v 1.2 2004/02/27 01:29:53 wbogaardt Exp $ 30 * Abstract: This allows email accounts that need authentication to log. 31 * 32 * $Log: EmailAuthenticator.java,v $ 33 * Revision 1.2 2004/02/27 01:29:53 wbogaardt 34 * modified classes so they conform to Checkstyle format in readability 35 * 36 * Revision 1.1 2004/02/02 23:43:34 wbogaardt 37 * Email authentication wrapper 38 * 39 * */ 40 public class EmailAuthenticator extends Authenticator { 41 42 private PasswordAuthentication auth; 43 44 /*** 45 * This class basically extends the Authenticator class 46 * so that wen we du a getPasswordAuthentication it will return 47 * the PasswordAuthentication object. 48 * @param username The user name 49 * @param password The user password 50 */ 51 public EmailAuthenticator(String username, String password) { 52 auth = new PasswordAuthentication(username, password); 53 } 54 55 /*** 56 * This implementation returns the user name and password 57 * as the PasswordAuthentication object 58 * @return user name and password for email authentication. 59 */ 60 public PasswordAuthentication getPasswordAuthentication() { 61 return auth; 62 } 63 }