You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Geoff Watters <ge...@oracle.com> on 2013/08/21 12:38:18 UTC

[vfs] implementation requires List privilege on the remote directory structure

I am writing an application that uses VFS to implement the FTP operations.

I have found that the VFS implementation (commons-vfs2-2.0.jar)) relies 
on the List permission on the remote directory structure.

For example, if I am FTPing a file to a remote dir "uploads", then on 
the remote system, the <ftpUserHome> that already contains a 
subdirectory called "uploads", does require List privilege. This is 
targeting FileZilla Server (0.9.41 beta) on Windows 7.

If List privilege is not granted then the following exception is raised:-
Caused by: org.apache.commons.vfs2.FileSystemException: Could not create 
folder "ftp://myLaptop/upload".
     at 
org.apache.commons.vfs2.provider.AbstractFileObject.createFolder(AbstractFileObject.java:999)
     at 
org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream(AbstractFileObject.java:1424)
     at 
org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:461)
     at 
org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:441)
     at org.apache.commons.vfs2.FileUtil.copyContent(FileUtil.java:111)
     at 
org.apache.commons.vfs2.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:1053)
     ... 24 more
Caused by: org.apache.commons.vfs2.FileSystemException: Could not create 
FTP directory "ftp://myLaptop/upload".
     at 
org.apache.commons.vfs2.provider.ftp.FtpFileObject.doCreateFolder(FtpFileObject.java:544)
     at 
org.apache.commons.vfs2.provider.AbstractFileObject.createFolder(AbstractFileObject.java:988)

If the remote file does exist, then the exception is not raised even 
when List privilege is not granted to the <ftpUserHome> directory.

List privilege is not needed when using a command-line FTP client.

Is this a known issue or restriction?

Thanks in advance


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


Re: [vfs] implementation requires List privilege on the remote directory structure

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Aug 21, 2013 at 6:38 AM, Geoff Watters <ge...@oracle.com>wrote:

> I am writing an application that uses VFS to implement the FTP operations.
>
> I have found that the VFS implementation (commons-vfs2-2.0.jar)) relies on
> the List permission on the remote directory structure.
>
> For example, if I am FTPing a file to a remote dir "uploads", then on the
> remote system, the <ftpUserHome> that already contains a subdirectory
> called "uploads", does require List privilege. This is targeting FileZilla
> Server (0.9.41 beta) on Windows 7.
>
> If List privilege is not granted then the following exception is raised:-
> Caused by: org.apache.commons.vfs2.**FileSystemException: Could not
> create folder "ftp://myLaptop/upload".
>     at org.apache.commons.vfs2.**provider.AbstractFileObject.**
> createFolder(**AbstractFileObject.java:999)
>     at org.apache.commons.vfs2.**provider.AbstractFileObject.**
> getOutputStream(**AbstractFileObject.java:1424)
>     at org.apache.commons.vfs2.**provider.DefaultFileContent.**
> getOutputStream(**DefaultFileContent.java:461)
>     at org.apache.commons.vfs2.**provider.DefaultFileContent.**
> getOutputStream(**DefaultFileContent.java:441)
>     at org.apache.commons.vfs2.**FileUtil.copyContent(FileUtil.**java:111)
>     at org.apache.commons.vfs2.**provider.AbstractFileObject.**
> copyFrom(AbstractFileObject.**java:1053)
>     ... 24 more
> Caused by: org.apache.commons.vfs2.**FileSystemException: Could not
> create FTP directory "ftp://myLaptop/upload".
>     at org.apache.commons.vfs2.**provider.ftp.FtpFileObject.**
> doCreateFolder(FtpFileObject.**java:544)
>     at org.apache.commons.vfs2.**provider.AbstractFileObject.**
> createFolder(**AbstractFileObject.java:988)
>
> If the remote file does exist, then the exception is not raised even when
> List privilege is not granted to the <ftpUserHome> directory.
>
> List privilege is not needed when using a command-line FTP client.
>
> Is this a known issue or restriction?
>

Well, it does not seem to be documented in the Javadoc. It is not clear to
me if you think this is a bug or if it should be part of the documentation.

Please feel free to submit patches (for trunk) via Jira.

Thank you,
Gary


>
> Thanks in advance
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
> For additional commands, e-mail: user-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory