new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = nil, arg_check = false)
public
Description
Creates a new URI::FTP object from generic URL components with
no syntax checking.
Unlike build(), this method does
not escape the path component as required
by RFC1738; instead it is treated as per RFC2396.
Arguments are scheme, userinfo, host,
port, registry, path, opaque,
query and fragment, in that order.
Show source
def initialize(scheme,
userinfo, host, port, registry,
path, opaque,
query,
fragment,
parser = nil,
arg_check = false)
raise InvalidURIError unless path
path = path.sub(/^\//,'')
path.sub!(/^%2F/,'/')
super(scheme, userinfo, host, port, registry, path, opaque,
query, fragment, parser, arg_check)
@typecode = nil
if tmp = @path.index(TYPECODE_PREFIX)
typecode = @path[tmp + TYPECODE_PREFIX.size..-1]
@path = @path[0..tmp - 1]
if arg_check
self.typecode = typecode
else
self.set_typecode(typecode)
end
end
end