>
> I'm trying to use VFS2 to copy a file from a remote path to a local folder.
>
> If I run
>
> FileObject srcFile = fsManager.resolveFile(//+hostname+"/"+filename);
>
> localFile.getName().getURI() returns something like file:////path and
> srcFile.exists() returns false.
>
> On the othe hand
>
> FileObject srcFile =
>
> fsManager.resolveFile("smb://"+user+":"+pw+"@"+hostname+"/"+filename);
>
> fails with the following exception:
>
> Badly formed URI "smb://user:***@hostname/filename"
>

Did you try checking if you can access the file with URI
"smb://user:***@hostname/filename"
There are chances that this URI might indeed be badly formed.

Also try this:
String srcURI = "smb://"+user+":"+pw+"@"+hostname+"/"+filename;
FileObject srcFile = fsManager.resolveFile(srcURI, new FileSystemOptions());

Indu

Reply via email to