1*876b9d75SXin Li -------------------------------------------------- 2*876b9d75SXin Li FakeFtpServer Features and Limitations 3*876b9d75SXin Li -------------------------------------------------- 4*876b9d75SXin Li 5*876b9d75SXin LiFakeFtpServer Features 6*876b9d75SXin Li~~~~~~~~~~~~~~~~~~~~~~ 7*876b9d75SXin Li 8*876b9d75SXin Li * Standalone dummy FTP server. Run either within the same JVM as test code or in a different JVM. 9*876b9d75SXin Li 10*876b9d75SXin Li * Implements common FTP server commands. 11*876b9d75SXin Li 12*876b9d75SXin Li * Works out of the box with reasonable and expected behavior. Can simulate most mainline success and error scenarios. 13*876b9d75SXin Li 14*876b9d75SXin Li * In most cases, requires little or no knowledge or understanding of FTP server commands and reply codes. 15*876b9d75SXin Li 16*876b9d75SXin Li * Provides a simulated server file system, including support for file and directory permissions and owner and 17*876b9d75SXin Li group authorization based on Unix. This file system can be populated at startup (or thereafter) with 18*876b9d75SXin Li directories and files (including arbitrary content) to be retrieved by an FTP client. Any files sent to the server 19*876b9d75SXin Li by an FTP client exist within that file system as well, and can be accessed through the file system API, or 20*876b9d75SXin Li can even be subsequently retrieved by an FTP client. 21*876b9d75SXin Li 22*876b9d75SXin Li * Allows defining the set of user accounts that control which users can login to the FTP server, and their home 23*876b9d75SXin Li (default) directories. 24*876b9d75SXin Li 25*876b9d75SXin Li * Supports active and passive mode data transfers. 26*876b9d75SXin Li 27*876b9d75SXin Li * Use a dynamically chosen free port number for the server control port instead of using the default (21) 28*876b9d75SXin Li or hard-coding some other value (set the serverControlPort property of the server to 0). 29*876b9d75SXin Li 30*876b9d75SXin Li * Supports extended address (IPv6) data transfers (RFC2428) 31*876b9d75SXin Li 32*876b9d75SXin Li * Fully supports configuration within the <<Spring Framework>> or other dependency-injection container. 33*876b9d75SXin Li 34*876b9d75SXin Li * Can be used to test FTP client code written in any language 35*876b9d75SXin Li 36*876b9d75SXin LiFTP Scenarios Supported by FakeFtpServer 37*876b9d75SXin Li~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38*876b9d75SXin Li 39*876b9d75SXin Li Some of the mainline success scenarios that you can simulate with <<FakeFtpServer>> include: 40*876b9d75SXin Li 41*876b9d75SXin Li * Login (USER/PASS): with password, or when no password is required 42*876b9d75SXin Li 43*876b9d75SXin Li * Retrieve existing file (RETR) from the server 44*876b9d75SXin Li 45*876b9d75SXin Li * Send file to the server (STOR,STOU,APPE) 46*876b9d75SXin Li 47*876b9d75SXin Li * List of file entries (LIST) and list of filenames (NLST) 48*876b9d75SXin Li 49*876b9d75SXin Li * Print current working directory (PWD) 50*876b9d75SXin Li 51*876b9d75SXin Li * Change current working directory (CWD) 52*876b9d75SXin Li 53*876b9d75SXin Li * Rename an existing file (RNFR/RNTO) 54*876b9d75SXin Li 55*876b9d75SXin Li * Delete an existing file (DELE) 56*876b9d75SXin Li 57*876b9d75SXin Li * Create directory (MKD) 58*876b9d75SXin Li 59*876b9d75SXin Li * Remove directory (RMD) 60*876b9d75SXin Li 61*876b9d75SXin Li * Both active and passive mode (PASV) data transfers 62*876b9d75SXin Li 63*876b9d75SXin Li * Extended Address (IPv6) data transfers (EPRT and EPSV commands) 64*876b9d75SXin Li 65*876b9d75SXin Li Some of the error scenarios that you can simulate with <<FakeFtpServer>> include: 66*876b9d75SXin Li 67*876b9d75SXin Li * Failed login (USER/PASS): no such user, wrong password 68*876b9d75SXin Li 69*876b9d75SXin Li * Invalid client requests: missing required parameter, not logged in 70*876b9d75SXin Li 71*876b9d75SXin Li * Failed retrieve (RETR): no such file, missing required access permissions for the current user 72*876b9d75SXin Li 73*876b9d75SXin Li * Failed send (STOR,STOU,APPE): missing required access permissions for the current user 74*876b9d75SXin Li 75*876b9d75SXin Li * Failed change current working directory (CWD): no such directory, missing required access permissions for the current user 76*876b9d75SXin Li 77*876b9d75SXin Li * Failed delete an existing file (DELE): file does not exist, missing required access permissions for the current user 78*876b9d75SXin Li 79*876b9d75SXin Li * Failed rename (RNFR/RNTO): no such file, missing required access permissions for the current user 80*876b9d75SXin Li 81*876b9d75SXin Li * Failed create directory (MKD): parent directory does not exist, directory already exists, missing required access permissions for the current user 82*876b9d75SXin Li 83*876b9d75SXin Li * Failed remove directory (RMD): no such directory, directory not empty, missing required access permissions for the current user 84*876b9d75SXin Li 85*876b9d75SXin Li 86*876b9d75SXin LiFakeFtpServer Limitations 87*876b9d75SXin Li~~~~~~~~~~~~~~~~~~~~~~~~~ 88*876b9d75SXin Li 89*876b9d75SXin Li Not all FTP features, error scenarios and reply codes can be simulated using <<FakeFtpServer>>. Features and 90*876b9d75SXin Li scenarios not supported include: 91*876b9d75SXin Li 92*876b9d75SXin Li * Leaving the data connection open across multiple client requests. 93*876b9d75SXin Li 94*876b9d75SXin Li * Transmission mode other than 'Stream'. The STRU command is implemented but has no effect (NOOP). 95*876b9d75SXin Li 96*876b9d75SXin Li * Data Types other than ASCII and IMAGE (binary). 97*876b9d75SXin Li 98*876b9d75SXin Li * Vertical Format Control other than the default (NON PRINT). 99*876b9d75SXin Li 100*876b9d75SXin Li * Record Structure and Page Structure. The STRU command is implemented but has no effect (NOOP). 101*876b9d75SXin Li 102*876b9d75SXin Li * Error Recovery and Restart. The REST command is implemented but has no effect (NOOP). 103*876b9d75SXin Li 104*876b9d75SXin Li * Structure Mount. The SMNT command is implemented but has no effect (NOOP). 105*876b9d75SXin Li 106*876b9d75SXin Li * Abort. The ABOR command is implemented but has no effect (NOOP). 107*876b9d75SXin Li 108*876b9d75SXin Li * Allocate. The ALLO command is implemented but has no effect (NOOP). 109*876b9d75SXin Li 110*876b9d75SXin Li [] 111*876b9d75SXin Li 112*876b9d75SXin Li For unsupported features, error scenarios and reply codes, consider using <<StubFtpServer>> instead, which 113*876b9d75SXin Li provides a lower-level abstraction and finer control over exact server reply codes and responses. 114