Discussions

News: MockFtpServer 2.0 rc3

  1. MockFtpServer 2.0 rc3 (1 messages)

    http://mockftpserver.sourceforge.net/ The MockFtpServer project provides a mock/dummy FTP server implementations that can be very useful for testing of FTP client code. MockFtpServer version 2.0 includes a new "fake" implementation of an FTP server. It provides a high-level abstraction for an FTP Server and is suitable for most testing and simulation scenarios. You define a virtual filesystem (internal, in-memory) containing an arbitrary set of files and directories. These files and directories can (optionally) have associated access permissions. You also configure a set of one or more user accounts that control which users can login to the FTP server, and their home (default) directories. The user account is also used when assigning file and directory ownership for new files. 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:
    data")); // Set up the Windows filesystem FileSystem fileSystem = new WindowsFakeFileSystem(); fileSystem.add(new DirectoryEntry("c:
    data")); fileSystem.add(new FileEntry("c:\\data
    file1.txt", "abcdef 1234567890")); fileSystem.add(new FileEntry("c:\\data
    run.exe")); fakeFtpServer.setFileSystem(fileSystem); fakeFtpServer.start();
    http://mockftpserver.sourceforge.net/

    Threaded Messages (1)

  2. Thanks[ Go to top ]

    Thanks for the post Chris - embedded FTP servers are few and far between. In the past I've used apache's ftp server (http://incubator.apache.org/projects/ftpserver.html) Worked OK apart from littering project root with config. Look forward to trying MockFtpServer next time.