You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Gentian Hila <ge...@gmail.com> on 2013/10/21 22:31:10 UTC

Fwd: locking files while being downloaded

Is there any way to make sure that when one file is downloaded from the
user, a second connection from the same user won't be able to download it
again?

It feels like on RETR command we need to keep a map of the file as the key
and an object that stores the user and the downloading state of the file.

Once the RETR has been completed that entry is updated or removed
completely. So an FTPlet extension might work but not sure how to get a
handle to the file.

Probably could use FTPRequest and parse the argument for RETR which is the
file and get the working directory from FileSystemView to construct a
unique reference for the file.

Is there maybe a simpler way than this?

Genti