How can I embed FtpServer in my application?
The following script shows how the FTP server can be embedded. This is the simplest possible way to start FtpServer and uses all defaults:
FtpServer server = new FtpServer();
server.start();
If you would like to configure some part of the server, you can access all components of FtpServer on the server instance. Here's an example of setting up the default listener to accept connections on a different port:
FtpServer server = new FtpServer();
server.getListener("default").setPort(2221);
server.start();
When you want to stop the server:
That's pretty much all there is to it.