# frozen_string_literal: true
require_relative 'generic'
# The "file" URI is defined by RFC8089.
# A Default port of nil for URI::File.
# An Array of the available components for URI::File.
# Creates a new URI::File object from components, with syntax checking.
# The components accepted are +host+ and +path+.
# The components should be provided either as an Array, or as a Hash
# with keys formed by preceding the component names with a colon.
# If an Array is used, the components must be passed in the
# order <code>[host, path]</code>.
# uri1 = URI::File.build(['host.example.com', '/path/file.zip'])
# uri1.to_s # => "file://host.example.com/path/file.zip"
# uri2 = URI::File.build({:host => 'host.example.com',
# uri2.to_s # => "file://host.example.com/ruby/src"
tmp = Util::make_components_hash(self, args)
# Protected setter for the host component +v+.
# See also URI::Generic.host=.
v = "" if v.nil? || v == "localhost"
raise URI::InvalidURIError, "can not set userinfo for file URI"
raise URI::InvalidURIError, "can not set user for file URI"
raise URI::InvalidURIError, "can not set password for file URI"