class Pione::Location::MyFTPScheme

MyFTPScheme is a special scheme for launching PIONE embedded ftp server.

@example

URI.parse("myftp:./output")

@example

URI.parse("myftp://abc:123@192.168.0.32:45321/home/keita/pione/output")

Constants

COMPONENT
PORT

Public Instance Methods

normalize() click to toggle source

Normalize the URI.

@return [URI]

normalized URI
# File lib/pione/location/myftp-scheme.rb, line 18
def normalize
  hash = {
    :scheme => "myftp",
    :userinfo => userinfo || Util::FTPServer.auth_info.to_userinfo,
    :host => (host == "myself" or host.nil?) ? Util::IPAddress.myself : host,
    :port => port || PORT,
    :path => File.expand_path(path, Global.pwd) + (directory? ? "/" : "")
  }
  MyFTPScheme.build(hash)
end
to_ftp_scheme() click to toggle source

Return ftp scheme that refers the ftp server.

@return [URI]

ftp scheme URI
# File lib/pione/location/myftp-scheme.rb, line 33
def to_ftp_scheme
  hash = {
    :scheme => "ftp",
    :userinfo => userinfo || Util::FTPServer.auth_info.to_userinfo,
    :host => (host == "myself" or host.nil?) ? Util::IPAddress.myself : host,
    :port => port || PORT,
    :path => "/"
  }
  URI::FTP.build(hash)
end