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 (if needed).
14 public class UsernamePasswordAuthenticator extends Authenticator {
16 private String _username;
18 private String _password;
21 * Constructs the authenticator.
28 public UsernamePasswordAuthenticator(String aUsername, String aPassword) {
29 _username = aUsername;
30 _password = aPassword;
36 * @see javax.mail.Authenticator#getPasswordAuthentication()
39 protected PasswordAuthentication getPasswordAuthentication() {
40 if (_username == null) {
43 return new PasswordAuthentication(_username, _password);