Hi Drake, It looks like HttpMethodBase is trying to parse retrieve the port from the URL, but there appears to be a bug in the URI class such that it's not finding the port. Only Sung-Gu really knows much about that class so if he's around I'd love to hear from him. :)
Otherwise, we'll have to log this as a bug and take a look at it when someone is free. I know that the URI classes are moving to their own commons project soonish, but I think it's time someone needs to learn what they're on about so we can support them better. If I find time I guess that will be me. I'm not sure when that will be though so hopefully someone will beat me to it. :) In the mean time you'll have to create the host configuration yourself and pass it through. Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com -----Original Message----- From: Drake Henderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 March 2003 10:15 AM To: Commons HttpClient Project Subject: RE: download a file Adrian, The code is below. It is a modification of BasicAuthenticationExample.java. I've just added the port number to the url of the GetMethod constructor. Thanks for you help. HttpClient client = new HttpClient(); // pass our credentials to HttpClient, they will only be used for // authenticating to servers with realm "realm", to authenticate agains // an arbitrary realm change this to null. client.getState().setCredentials( null, new UsernamePasswordCredentials("user", "pwd") ); // create a GET method that reads a file over HTTPS, we're assuming // that this file requires basic authentication using the realm above. GetMethod get = new GetMethod("https://www.xyz.com:2082/getsqlbackup/trace.gz"); // Tell the GET method to automatically handle authentication. The // method will use any appropriate credentials to handle basic // authentication requests. Setting this value to false will cause // any request for authentication to return with a status of 401. // It will then be up to the client to handle the authentication. get.setDoAuthentication( true ); // execute the GET int status = client.executeMethod( get ); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
