You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gary Gregory <GG...@rocketsoftware.com> on 2012/04/05 13:12:50 UTC

Re: Commons VFS StaticUserAuthenticator Issue

Have you tried http://commons.apache.org/vfs/filesystems.html#CIFS?

Gary

On Apr 5, 2012, at 6:23, "shabeena.k" <sh...@etpgroup.com> wrote:

> Hi All,
> 
> I am using the Commons VFS API for accessing resources from a remote machine
> over LAN.
> However, it doesn't work for one of the cases,details of which are listed
> below:
> 
> A directory containing files exists on the remote machine.However,this
> directory is not shared.Other machine tries to access this folder with the
> username and password used to connect to this machine.But this turns out to
> be a failure.The snippet of this is given below:
> 
> StaticUserAuthenticator mwwObjStaticUserAuth = new   
> StaticUserAuthenticator(mwwStrLANUsername,mwwStrLANPassword, null);
> FileSystemOptions mwwObjileSystemOptions = new FileSystemOptions(); 
> 
> DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(mwwObjileSystemOptions,
> mwwObjStaticUserAuth);
>                
> FileSystemManager fsManager = VFS.getManager();
> 
> String path =
> "//"+mwwStrSourceMachine+File.separator+mwwStrFolderPath+File.separator+"filename";
> FileObject folder = fsManager.resolveFile(path,mwwObjileSystemOptions);
> FileContent cwwObjFileContent  = folder.getContent();
> // more logic to download file on local machine    
> 
> But this leads to a FileNotFoundException, the entire trace is shown below:
> 
> 
> org.apache.commons.vfs2.FileNotFoundException: Could not read from
> "file:////WS-005/E:/abc/xyz/site-1.6.12.zip" because it is a not a file.
>    at
> org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1315)
>    at
> org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:396)
>    at landownload.Snippet.download(Snippet.java:63)
>    at landownload.Snippet.main(Snippet.java:23)
> Caused by: java.io.FileNotFoundException:
> \\WS-005\E:\abc\xyz\site-1.6.12.zip (The network path was not found)
>    at java.io.FileInputStream.open(Native Method)
>    at java.io.FileInputStream.<init>(FileInputStream.java:106)
>    at
> org.apache.commons.vfs2.provider.local.LocalFile.doGetInputStream(LocalFile.java:209)
>    at
> org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1307)
>    ... 3 more
> 
> --
> View this message in context: http://apache-commons.680414.n4.nabble.com/Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534444.html
> Sent from the Commons - Issues mailing list archive at Nabble.com.

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


RE: Commons VFS StaticUserAuthenticator Issue

Posted by "shabeena.k" <sh...@etpgroup.com>.
Got it.Thanks

--
View this message in context: http://apache-commons.680414.n4.nabble.com/Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534678.html
Sent from the Commons - Issues mailing list archive at Nabble.com.

RE: Commons VFS StaticUserAuthenticator Issue

Posted by Gary Gregory <GG...@rocketsoftware.com>.
This page: http://commons.apache.org/vfs/mail-lists.html

Describes "Questions related to the usage of Commons VFS should be posted to the User List"

You MUST first subscribe to the User List by sending an email to user-subscribe@commons.apache.org

Once subscribed, please prefix the subject line of any messages for Commons VFS with [vfs].

Gary

-----Original Message-----
From: shabeena.k [mailto:shabeena.khoja@etpgroup.com] 
Sent: Thursday, April 05, 2012 8:09 AM
To: issues@commons.apache.org
Subject: RE: Commons VFS StaticUserAuthenticator Issue

I am sorry but I am a newbie and not able to figure out where this issue has been moved.

--
View this message in context: http://apache-commons.680414.n4.nabble.com/Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534650.html
Sent from the Commons - Issues mailing list archive at Nabble.com.

RE: Commons VFS StaticUserAuthenticator Issue

Posted by "shabeena.k" <sh...@etpgroup.com>.
I am sorry but I am a newbie and not able to figure out where this issue has
been moved.

--
View this message in context: http://apache-commons.680414.n4.nabble.com/Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534650.html
Sent from the Commons - Issues mailing list archive at Nabble.com.

RE: Commons VFS StaticUserAuthenticator Issue

Posted by Gary Gregory <GG...@rocketsoftware.com>.
I moved this thread to user@commons.apache.org.

Please see my reply there.

Gary

-----Original Message-----
From: shabeena.k [mailto:shabeena.khoja@etpgroup.com] 
Sent: Thursday, April 05, 2012 7:59 AM
To: issues@commons.apache.org
Subject: Re: Commons VFS StaticUserAuthenticator Issue

Can you specifically tel me what do you want me to try?

--
View this message in context: http://apache-commons.680414.n4.nabble.com/Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534630.html
Sent from the Commons - Issues mailing list archive at Nabble.com.

Re: Commons VFS StaticUserAuthenticator Issue

Posted by "shabeena.k" <sh...@etpgroup.com>.
Can you specifically tel me what do you want me to try?

--
View this message in context: http://apache-commons.680414.n4.nabble.com/Commons-VFS-StaticUserAuthenticator-Issue-tp4534444p4534630.html
Sent from the Commons - Issues mailing list archive at Nabble.com.