(no commit message)
[utils] / crawler / kiss / src / org / wamblee / crawler / kiss / UsernamePasswordAuthenticator.java
1 /**
2  * Copyright (c) 2005 UPS_SCS NL
3  *  
4  */
5 package org.wamblee.crawler.kiss;
6
7 import javax.mail.Authenticator;
8 import javax.mail.PasswordAuthentication;
9
10 public class UsernamePasswordAuthenticator extends Authenticator {
11     
12     private String _username; 
13     private String _password; 
14
15     public UsernamePasswordAuthenticator(String aUsername, String aPassword) { 
16         _username = aUsername; 
17         _password = aPassword; 
18     }
19     
20     @Override
21     protected PasswordAuthentication getPasswordAuthentication( ) {
22         if ( _username == null ) { 
23             return null; 
24         }
25         return new PasswordAuthentication(_username, _password);
26     }
27   
28
29 }