1 24 25 27 package weblech.spider; 28 29 import org.apache.log4j.Category; 30 31 import java.net.Authenticator ; 32 import java.net.PasswordAuthentication ; 33 34 import weblech.util.Log4j; 35 36 public class DumbAuthenticator extends Authenticator 37 { 38 private final static Category _logClass = Category.getInstance(DumbAuthenticator.class); 39 40 static 41 { 42 Log4j.init(); 43 } 44 45 private final String user; 46 private final String password; 47 48 public DumbAuthenticator(String user, String password) 49 { 50 _logClass.debug("DumbAuthenticator(" + user + ", ***)"); 51 this.user = user; 52 this.password = password; 53 } 54 55 public PasswordAuthentication getPasswordAuthentication() 56 { 57 _logClass.debug("getPasswordAuthentication()"); 58 return new PasswordAuthentication (user, password.toCharArray()); 59 } 60 } 61 | Popular Tags |