/* * @(#)ProxyAuth.java (Metawerx customer example classes) * * Copyright (c) 1998-2005 Metawerx. All Rights Reserved. * * This software is the confidential and proprietary information of Metawerx * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with Metawerx. * * METAWERX MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY * OF THE SOFTWARE OR THE SOURCE CODE, EITHER EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. METAWERX SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY ANY PARTY AS A RESULT OF USING, MODIFYING OR * DISTRIBUTING THIS SOFTWARE AND DOCUMENTATION OR ITS DERIVATIVES * * Synopsis * ===================================================================================== * This class overrides Authenticator, to provide a method for passing in the * username and password * * History * ===================================================================================== * 6/19/2005 21:29 Neale Rudd * Created * */ import java.net.Authenticator; import java.net.PasswordAuthentication; public class ProxyAuth extends Authenticator { String proxy_username = null; String proxy_password = null; public void setUser(String s) { this.proxy_username = s; } public void setPass(String s) { this.proxy_password = s; } protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(proxy_username,proxy_password.toCharArray()); } }