0

我是普通 vfs 的新手。我正在尝试阅读位于http://starpoint.com/上的 excel 表...

每当我在浏览器上使用此 url 时,它都会弹出需要身份验证的窗口。我尝试使用上面的代码,但它没有用。

StaticUserAuthenticator auth = new StaticUserAuthenticator("domain", "username", "password"); 
FileSystemOptions opts = new FileSystemOptions(); 
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth); 
FileObject fo = VFS.getManager().resolveFile("htttp://starpoint.com/../", opts);

我还尝试通过这种格式http://username:password@starpoint.com/..../在 url 中输入用户名和密码,但它不起作用。

还有一件事,如果我的用户名是 xyz\john,那么 xyz 会成为我在代码第一行中的域吗?任何其他方式也将不胜感激。

4

0 回答 0