[
https://issues.apache.org/jira/browse/FTPSERVER-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490996
]
John West commented on FTPSERVER-82:
------------------------------------
I'm not sure that using enums is necessarily better; there will be a lot less
API, but it's pretty inflexible. Imagine the case where a custom command is
being used. onBefore/AfterCommand with enums will not work in that case without
either a lot of class overriding or by using a different technique for that one
command.
I know it's a little crazy, but how about having each command class register
its name with the ftpserver, which would then keep track of the available
commands in a list?
Thumbs up for the general idea however. This will make it much easier to write
and maintain an ftplet.
> Ftplet onBeforeCommand and onAfterCommand events
> ------------------------------------------------
>
> Key: FTPSERVER-82
> URL: https://issues.apache.org/jira/browse/FTPSERVER-82
> Project: FtpServer
> Issue Type: Improvement
> Components: Ftplets
> Affects Versions: 1.0-M1
> Reporter: im-james
> Fix For: 1.0-M1
>
>
> In the mailing list there was a message from someone who wanted to execute
> some code before a LIST command.
> The ftplet api does not currently allows this.
> The same problem can happen for several other commands so it would be nice to
> extends the ftplet api to add a way to execute code before and after any
> command.
> This could be done by adding a couple of method in the ftplet api for every
> command (onBeforeList, onAfterList) or by using a generic method like:
> onBeforeCommand(enum command, ... )
> onAfterCommand(enum command, ...)
> In these method the developer can create a switch() on the enum to filter the
> events he wants to catch.
> Of course in onBeforeCommand you should be able to abort the execution of the
> command.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.