commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Cooke" <Tony.Co...@elders.com.au>
Subject RE: [commons vfs] ftp DefaultFileMonitor issue
Date Fri, 07 Jul 2006 05:38:55 GMT
Hi Mario.

The problems is I think I need to use 2 different user IDs and passwords
to get to the data.

One to get past the proxy, the other to authenticate to the remote
website.

Can I use the FileSystemOptions example below to set up the proxy
authentication and then use the
http://user:pass@target.host.net/file.txt approach as well to get past
the remote website's authentication?

Ie.

  FileSystemOptions opts = new FileSystemOptions();
  HttpFileSystemConfigBuilder.getInstance().setProxyHost(opts,
"proxy.host.net");
  HttpFileSystemConfigBuilder.getInstance().setProxyPort(opts, 8080);
       
 
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts,
you_user_authenticator);
  FileObject fo =
VFS.getManager().resolveFile("http://user:passtarget.host.net/file.txt",
opts);

I hope you understand what I have written.

Thanks for your help Mario. I do appreciate it.

All the best,
Tony


-----Original Message-----
From: Mario Ivankovits [mailto:mario@ops.co.at] 
Sent: Friday, 7 July 2006 3:01 PM
To: Jakarta Commons Users List
Subject: Re: [commons vfs] ftp DefaultFileMonitor issue

Hi Tony!
> How can I set up commons-vfs (specifically HTTP) to use a proxy AND
> authenticate to the site (which is password protected)?
>   
You can add the password to the url e.g.
http://user:pass@target.host.net/file.txt or configure a user
authenticator as shown below:

        FileSystemOptions opts = new FileSystemOptions();
        HttpFileSystemConfigBuilder.getInstance().setProxyHost(opts,
"proxy.host.net");
        HttpFileSystemConfigBuilder.getInstance().setProxyPort(opts,
8080);
       
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts,
you_user_authenticator);
        FileObject fo =
VFS.getManager().resolveFile("http://target.host.net/file.txt", opts);

I dont know if and how the user/pass stuff works with your proxy, please
tell us your experiences afterwards.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message