In Apache FtpServer, you can intercept any command with Ftplet, including LIST. Deploy the Ftplet interface and override the beforeCommand or afterCommand command (depending on whether you want to process the request or response). These methods will be called for each command sent to the server.
But, from your question, instead, you may be interested in implementing a custom file system. Take a look at the FileSystemFactory, FileSystemView, and FtpFile interfaces.
source share