commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Schild <>
Subject [vfs] Inaccessible rootdir, how to access
Date Wed, 02 Nov 2011 14:40:55 GMT

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


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 "/".
         ... 11 more

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

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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message