Apache FTPServer Project > Index > Documentation > Embed |
The following script shows how the FTP server can be embedded.
// get the configuration object Configuration config = getConfiguration(); // create servce context FtpServerContext ftpConfig = new ConfigurableFtpServerContext(config); // create the server object and start it FtpServer server = new FtpServer(ftpConfig); server.start();
If you want to stop the FTP server:
server.stop();