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 Niklas Gustavsson <ni...@protocol7.com> on 2010/12/09 10:45:49 UTC

Re: Setting a FileObserver

Sorry for the late reply

On Mon, Nov 29, 2010 at 9:37 AM, Aidan Diffey <ai...@gmail.com> wrote:
> I would like to create and set my own custom FileObserver so I can
> keep a track of what has been downloaded.   How can I do this?

You should be able to do something like:

        DefaultFtpServerContext ctx = new DefaultFtpServerContext();
        DefaultFtpStatistics stats = new DefaultFtpStatistics();
        stats.setFileObserver(new MyFileObserver());
        ctx.setFtpStatistics(stats);
        FtpServer server = new DefaultFtpServer(ctx);
        server.start();

Please note that FileObserver is not currently part of our public API
and thus might change.

/niklas