Class Net::SFTP::Operations::Abstract
In: lib/net/sftp/operations/abstract.rb
Parent: Object

The base class for all SFTP operations. Subclasses must implement a perform method, which accepts the arguments expected by the corresponding method of the driver. Subclasses may also override the default implementations of do_status, do_data, do_name, do_handle, and do_attrs, as necessary.

Methods

do_attrs   do_data   do_handle   do_name   do_status   execute   new  

Included Modules

Constants

Constants

Status = Struct.new( :code, :message, :language )   A structure for reporting status information.
OK = Status.new( FX_OK, "Success", "" )   A constant for representing the commonly-used FX_OK status.

Public Class methods

Create a new operation with the given logger instance, which will operate atop the given session, using the given driver to format and send the requests to the server.

Public Instance methods

A callback for SFTP attrs packets. By default, invokes the registered callback, passing an OK status and the attributes object.

A callback for SFTP data packets. By default, invokes the registered callback, passing an OK status and the data.

A callback for SFTP handle packets. By default, invokes the registered callback, passing an OK status and the handle.

A callback for SFTP name packets. By default, invokes the registered callback, passing an OK status and the list of items.

A callback for SFTP status packets. By default, raises an exception unless the status is FX_OK, in which case the registered callback is invoked.

Execute the operation. If a callback is given, the operation will be performed asynchronously with the callback being invoked when the operation completes. If a callback is not given, the operation will be performed synchronously, with the expected value being returned.

[Validate]