Methods
Included Modules
Constants
DEFAULT_PORT = 22
COMPONENT = [ :scheme, :userinfo, :host, :port, :path, :query
Attributes
[R] options
Public Class methods
new( *args )
    # File lib/uri/sftp.rb, line 25
25:     def initialize( *args )
26:       super( *args )
27: 
28:       @options = Hash.new
29:       ( query || "" ).split( /&/ ).each do |pair|
30:         name, value = pair.split( /=/ )
31:         opt_name = name.intern
32:         values = value.split( /,/ ).map { |v| v.to_i.to_s == v ? v.to_i : v }
33:         values = values.first if values.length == 1
34:         options[ opt_name ] = values
35:       end
36:     end
new2( user, password, host, port, path, query )
    # File lib/uri/sftp.rb, line 17
17:     def self.new2( user, password, host, port, path, query )
18:       new( 'sftp',
19:            [ user, password ],
20:            host, port,
21:            nil, path,
22:            nil, query )
23:     end
Public Instance methods
direct_open( buf, open_options )
    # File lib/uri/open-sftp.rb, line 29
29:     def direct_open( buf, open_options )
30:       Net::SFTP.start( host, port, user, password, options ) do |sftp|
31:         if open_options[:content_length_proc]
32:           open_options[:content_length_proc].call( sftp.lstat( path ).size )
33:         end
34: 
35:         body = nil
36:         sftp.open_handle( path ) do |handle|
37:           body = sftp.read( handle,
38:                     :chunk_size => open_options[:chunk_size],
39:                     :progress_callback => open_options[:progress_proc] )
40:         end
41: 
42:         if body.nil?
43:           raise Net::SSH::SFTP::SFTPError, sftp.status[:message]
44:         end
45: 
46:         buf << body
47:         buf.io.rewind
48:       end
49:     end