Class: RIO::FTP::Stream::RRL

Inherits:
RRL::URIBase show all
Defined in:
lib/rio/scheme/ftp.rb

Instance Attribute Summary

Attributes inherited from RRL::Base

#fs, #uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RRL::URIBase

#initialize, #initialize_copy, parse

Methods inherited from RRL::WithPath

#absolute?, #base, #base=, #fspath_no_slash, #host, #host=, #opaque, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #scheme, #split

Methods included from RIO::Fwd

#fwd, #fwd_reader, #fwd_readers, #fwd_writer, #fwd_writers

Methods included from Error::NotImplemented

#nodef

Methods inherited from RRL::Base

#==, #===, #=~, #callstr, #close, #initialize, #initialize_copy, #length, parse, #to_s, #url

Constructor Details

This class inherits a constructor from RIO::RRL::URIBase

Class Method Details

.splitrl(s) ⇒ Object



73
74
75
76
# File 'lib/rio/scheme/ftp.rb', line 73

def self.splitrl(s) 
  sub,opq,whole = split_riorl(s)
  [whole] 
end

Instance Method Details

#file_rlObject



90
91
92
# File 'lib/rio/scheme/ftp.rb', line 90

def file_rl() 
  self
end

#open(m) ⇒ Object



80
81
82
83
84
85
86
87
88
89
# File 'lib/rio/scheme/ftp.rb', line 80

def open(m)
  case
  when m.primarily_write?
    RIO::IOH::Stream.new(RIO::FTP::FTPFile.new(fs.remote_path(@uri.to_s),fs.conn))
  else
    u = URI.parse(@uri.to_s)
    hndl = u.open
    RIO::IOH::Stream.new(hndl)
  end
end

#openfs_Object



77
78
79
# File 'lib/rio/scheme/ftp.rb', line 77

def openfs_
  RIO::FTP::FS.create(@uri)
end