project provides a mock/dummy FTP server implementations that can be very useful for testing of FTP client code or standing in for an unavailable "real" FTP server during development. Version 2.1 includes support for IPv6 (EPRT and EPSV commands), as well as a few bug fixes.
The project provides both a low-level "stub" server implementation (StubFtpServer
) and a higher-level "fake" server (FakeFtpServer
processes FTP client requests and responds with reply codes and reply messages consistent with its configured file system and user accounts, including file and directory permissions, if they have been configured.
Here is an example showing configuration and starting of an FakeFtpServer
with a single user account and a (simulated) Windows file system, defining a directory containing two files. If you wish, you can define a Unix file system, instead.
// Create the server and add a user account
FakeFtpServer fakeFtpServer = new FakeFtpServer();
fakeFtpServer.addUserAccount(new UserAccount("user", "password", "c:
// Set up the Windows filesystem
FileSystem fileSystem = new WindowsFakeFileSystem();
file1.txt", "abcdef 1234567890"));