Hi all,

we use the ftpserver library with a virtual file system.
The file system has a few restrictions, which are currently not
reflected in the FileSystemView and FtpFile interfaces.

1. FS can be encrypted, so one cannot change / append to an existing
file (the FileSystemView has isRandomAccessible() but it isn't used in
the APPE and REST commands)

2. FS can append (add stuff at the end) but not in the middle (so
technically isRandomAccessible should return false, although APPE is
possible)

As these "restrictions" are file specific (at least in our virtual file
system case) I think the FileSystemView is not the right place to
implement such a thing. As a temporary workaround we use the
isRandomAccessible flag and added exits in APPE and REST to return 550
in such cases, but we want to improve that and optimally contribute
back, so that we can switch back to vanilla ftpserver once this comes
available.

So here my question: Which is the best approach to implement such a
thing? Do you aggree in adding that to FtpFile and adding the respective
checks to APPE, REST (and STOR if session.getFileOffset() returns
something > 0)? I was thinking about methods along the line of
"canAppend" and "canRandomAccess" to distinguish from the isXXX methods
which reflect permissions.

Additionally when adding that to the file interface I think
isRandomAccessible could be deprecated, as it then isn't used anymore.

What would such a change imply for the versioning (is this a change for
1.1.x or does that already justify a 2.x)?

Any feedback is welcome.

Greetings
-Sascha-

Reply via email to