commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [commons vfs] ftp DefaultFileMonitor issue
Date Fri, 07 Jul 2006 05:30:49 GMT
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


Mime
View raw message