2 * Copyright (c) 2005 UPS_SCS NL
5 package org.wamblee.crawler.kiss.notification;
7 import javax.mail.Authenticator;
8 import javax.mail.PasswordAuthentication;
11 * Authenticator to supply username and password to the mail server
15 public class UsernamePasswordAuthenticator extends Authenticator {
17 private String _username;
18 private String _password;
21 * Constructs the authenticator.
22 * @param aUsername User name.
23 * @param aPassword Password.
25 public UsernamePasswordAuthenticator(String aUsername, String aPassword) {
26 _username = aUsername;
27 _password = aPassword;
32 * @see javax.mail.Authenticator#getPasswordAuthentication()
35 protected PasswordAuthentication getPasswordAuthentication( ) {
36 if ( _username == null ) {
39 return new PasswordAuthentication(_username, _password);