1 17 18 package org.apache.avalon.repository.main; 19 20 import java.net.Authenticator ; 21 import java.net.PasswordAuthentication ; 22 23 30 public final class DefaultAuthenticator extends Authenticator 31 { 32 35 private String m_username; 36 37 40 private char[] m_password; 41 42 48 public DefaultAuthenticator( String username, String password ) throws NullPointerException 49 { 50 if( username == null ) throw new NullPointerException ( "username" ); 51 if( password == null ) throw new NullPointerException ( "password" ); 52 m_username = username; 53 m_password = password.toCharArray(); 54 } 55 56 60 protected PasswordAuthentication getPasswordAuthentication() 61 { 62 return new PasswordAuthentication ( m_username, m_password ); 63 } 64 } 65 | Popular Tags |