View Javadoc

1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework.
3    * 
4    * Copyright (C) 2000-2008, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  
11  package ch.qos.logback.core.net;
12  
13  import javax.mail.Authenticator;
14  import javax.mail.PasswordAuthentication;
15  
16  public class LoginAuthenticator extends Authenticator {
17  
18    String username;
19    String password;
20    
21    LoginAuthenticator(String username, String password) {
22      this.username = username;
23      this.password = password;
24    }
25    
26    public PasswordAuthentication getPasswordAuthentication() {
27      return new PasswordAuthentication(username, password);
28  }
29  
30  }