You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by André Schild <a....@aarboard.ch> on 2011/11/02 15:40:55 UTC

[vfs] Inaccessible rootdir, how to access

Hello,

we have to retrieve files from a ftp server which has this structure:

ftp://user:password@serverip/user/folder1/

The users don't have access to / directory of the server

So normal connect to "ftp://user:password@serverip/user/folder1/"
does not work and fails with

Caused by: org.apache.commons.vfs2.FileSystemException: Could not change 
to work directory "/".
         at 
org.apache.commons.vfs2.provider.ftp.FtpClientFactory.createConnection(FtpClientFactory.java:130)
         ... 11 more


For working arround the problem there exists this option in the ftp 
provider:

FtpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, true);

With this the login works fine "ftp://user:password@serverip/folder1/"
, and even a getChildren() lists all children of the folder1.

But when I then try to retrieve the files, the ftp servers tells me that 
it can't find the
requested files.
And the requested URL is: ftp://user:password@serverip/folder1/file1
instead of the correct ftp://user:password@serverip/user/folder1/file1

Any ideas how I could solve that problem ?
I did not find any such problems in the list archives.

BTW: The ftp server software is:  ProFTPD 1.3.3c

André

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