On Sun, Jul 26, 2009 at 12:54 AM, Carlton Hanna<[email protected]> wrote: > I have created a java class that implements > org.apache.ftpserver.command.Command interface. > > I have a method called public void execute(FtpIoSession session, > FtpServerContext context, FtpRequest request), that the interface uses. > > My question is, how do I map a SITE command to use this class. I will be > using Apache's ftp client class and method sendSiteCommand("FOO").
At the moment, we do not support adding new SITE commands directly. However, this is a lack in the FtpServer API and something we should fix. So, feel free to add a JIRA issue for fixing this. That said, until this issue is fixed, you will need to also create a custom SITE command implementation. I would do so by simply copying our existing class (org.apache.ftpserver.command.impl.SITE) and add your command in the static block at the end. When that's done, you register your custom SITE command with the CommandFactory and you should be done. Let us know if this doesn't help, and feel free to add an issue (and patch if you got the energy) for doing this in a better way. /niklas
