0

I am new to common vfs. I am trying to read an excel sheet located on http://starpoint.com/...

Whenever i use this url on browser, it gives me authentication required pop up.I tried using the above code but it didn't work.

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);

I also tried entering username and password in the url by this format http://username:password@starpoint.com/..../ but it does not work.

One more thing if my username is xyz\john then will xyz be my domain in the first line of the code? Any other way will also be appreciated.

  • The domain is a specific string the server sends you when asking for the password. The browser should show this string in the password prompt. As username and password you need to use exactly whatever you put into the two fields in the browser popup. – Philipp Wendler Jan 17 '15 at 16:37
  • You also have a typo in the URL: `htttp` – Philipp Wendler Jan 17 '15 at 16:38
  • I purposely entered htttp instead of http as it was not allowing me to enter more than 2 links. Sorry for the confusion. I m getting the message authentication required server:http://starpoint.com:80. So is this the domain? – ronit more Jan 17 '15 at 18:21
  • Probably yes. I hope at least that this is what StaticUserAuthenticator wants because this is what is normally needed when you want to do HTTP basic authentication, but I could not find documentation for this class. – Philipp Wendler Jan 17 '15 at 19:28

0 Answers0