>From what I can see, the DefaultFTPLet code does nothing on the
onDownloadStart() command. This returns null which causes the default
execute in the RETR class to be called.

I am returning FtpletResult.SKIP which causes the default RETR command
to NOT be executed.

So I think I am okay doing implementation in my FTPLet onDownloadStart() method.

Regards

On 25 November 2010 11:32, John Hartnup <[email protected]> wrote:
> On 25 November 2010 11:18, Aidan Diffey <[email protected]> wrote:
>
>> I have embedded the FTP server into a JBoss application. When the
>> client issues a RETR command, I read a database and get a byte[] which
>> I the transfer to the client.
>>
>> How can I transfer the data to the client with the onDownloadStart
>> method without opening / closing data connections?
>>
>>
> It sounds like you need to implement your own FilesystemView,
> FilesystemFactory and FtpFile class, which backends to the database.
>
> When FtpServer starts a data transfer, it would request an FtpFile object
> from the FilesystemView, and call FtpFile's createInputStream(). This
> InputStream needs to read from your database (or, if you prefer, from a
> byte[] obtained from a DB read).
>
> Configure this with the <filesystem> configuration element, or call
> setFileSystemManager().
>
> It's possible that an ftplet  onDownloadStart() and onDownloadEnd() might do
> some housekeeping to prepare for the download, and tidy up afterwards, but I
> think you'll probably find it's not necessary and that that stuff can go in
> your FtpFile implementation.
>
>
> --
> "There is no way to peace; peace is the way"
>

Reply via email to