1 54 55 package org.jboss.axis.utils; 56 57 import org.jboss.axis.components.net.TransportClientProperties; 58 import org.jboss.axis.components.net.TransportClientPropertiesFactory; 59 60 61 65 public class DefaultAuthenticator extends java.net.Authenticator 66 { 67 private TransportClientProperties tcp = null; 68 69 private String user; 70 private String password; 71 72 public DefaultAuthenticator(String user, String pass) 73 { 74 this.user = user; 75 this.password = pass; 76 } 77 78 protected java.net.PasswordAuthentication getPasswordAuthentication() 79 { 80 if (user == null) 82 { 83 user = getTransportClientProperties().getProxyUser(); 84 } 85 if (password == null) 86 { 87 password = getTransportClientProperties().getProxyPassword(); 88 } 89 return new java.net.PasswordAuthentication (user, password.toCharArray()); 90 } 91 92 private TransportClientProperties getTransportClientProperties() 93 { 94 if (tcp == null) 95 { 96 tcp = TransportClientPropertiesFactory.create("http"); 97 } 98 return tcp; 99 } 100 } 101 | Popular Tags |