org.mockftpserver.fake.command
Class NlstCommandHandler

java.lang.Object
  extended by org.mockftpserver.core.command.AbstractCommandHandler
      extended by org.mockftpserver.fake.command.AbstractFakeCommandHandler
          extended by org.mockftpserver.fake.command.NlstCommandHandler
All Implemented Interfaces:
CommandHandler, ReplyTextBundleAware, ServerConfigurationAware

public class NlstCommandHandler
extends AbstractFakeCommandHandler

CommandHandler for the NLST command. Handler logic:

  1. If the user has not logged in, then reply with 530 and terminate
  2. Send an initial reply of 150
  3. If the current user does not have read access to the file or directory to be listed, then reply with 550 and terminate
  4. If an error occurs during processing, then send a reply of 451 and terminate
  5. If the optional pathname parameter is missing, then send a directory listing for the current directory across the data connection
  6. Otherwise, if the optional pathname parameter specifies a directory or group of files, then send a directory listing for the specified directory across the data connection
  7. Otherwise, if the pathname parameter does not specify an existing directory or group of files, then send an empty response across the data connection
  8. Send a final reply with 226
The directory listing sent includes filenames only, separated by end-of-line characters.

Version:
$Revision: 220 $ - $Date: 2009-02-07 23:05:06 -0500 (Sat, 07 Feb 2009) $
Author:
Chris Mair

Field Summary
 
Fields inherited from class org.mockftpserver.fake.command.AbstractFakeCommandHandler
INTERNAL_ERROR_KEY, replyCodeForFileSystemException
 
Fields inherited from class org.mockftpserver.core.command.AbstractCommandHandler
LOG
 
Constructor Summary
NlstCommandHandler()
           
 
Method Summary
protected  void handle(Command command, Session session)
          Handle the specified command for the session.
 
Methods inherited from class org.mockftpserver.fake.command.AbstractFakeCommandHandler
defaultIfNullOrEmpty, endOfLine, getFileSystem, getRealPath, getRequiredSessionAttribute, getServerConfiguration, getUserAccount, handleCommand, list, list, login, notNullOrEmpty, sendReply, sendReply, sendReply, sendReply, setServerConfiguration, validateUserAccount, verifyExecutePermission, verifyFileSystemCondition, verifyLoggedIn, verifyReadPermission, verifyWritePermission
 
Methods inherited from class org.mockftpserver.core.command.AbstractCommandHandler
assertValidReplyCode, getReplyTextBundle, quotes, setReplyTextBundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NlstCommandHandler

public NlstCommandHandler()
Method Detail

handle

protected void handle(Command command,
                      Session session)
Description copied from class: AbstractFakeCommandHandler
Handle the specified command for the session. All checked exceptions are expected to be wrapped or handled by the caller.

Specified by:
handle in class AbstractFakeCommandHandler
Parameters:
command - - the Command to be handled
session - - the session on which the Command was submitted


Copyright © 2014. All rights reserved.