Class: Ftpd::CmdRename
- Inherits:
-
CommandHandler
- Object
- CommandHandler
- Ftpd::CmdRename
- Defined in:
- lib/ftpd/cmd_rename.rb
Constant Summary
Constants inherited from CommandHandler
Ftpd::CommandHandler::COMMAND_FILENAME_PREFIX, Ftpd::CommandHandler::COMMAND_KLASS_PREFIX, Ftpd::CommandHandler::COMMAND_METHOD_PREFIX
Instance Method Summary collapse
Methods inherited from CommandHandler
Methods included from FileSystemHelper
#ensure_accessible, #ensure_directory, #ensure_does_not_exist, #ensure_exists, #ensure_file_system_supports, #path_list, #unique_path
Methods included from Error
#error, #sequence_error, #syntax_error, #unimplemented_error
Methods included from DataConnectionHelper
#close_data_server_socket_when_done, #data_connection_description, #encrypt_data?, #handle_data_disconnect, #make_tls_connection, #open_active_data_connection, #open_active_tls_data_connection, #open_data_connection, #open_passive_data_connection, #open_passive_tls_data_connection, #receive_file, #send_start_of_data_connection_reply, #transmit_file
Constructor Details
This class inherits a constructor from Ftpd::CommandHandler
Instance Method Details
#cmd_rnfr(argument) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ftpd/cmd_rename.rb', line 7 def cmd_rnfr(argument) ensure_logged_in ensure_file_system_supports :rename syntax_error unless argument from_path = File.(argument, name_prefix) ensure_accessible from_path ensure_exists from_path @rename_from_path = from_path reply '350 RNFR accepted; ready for destination' expect 'rnto' end |
#cmd_rnto(argument) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ftpd/cmd_rename.rb', line 19 def cmd_rnto(argument) ensure_logged_in ensure_file_system_supports :rename syntax_error unless argument to_path = File.(argument, name_prefix) ensure_accessible to_path ensure_does_not_exist to_path file_system.rename(@rename_from_path, to_path) reply '250 Rename successful' end |