# class Chef::Provider::RemoteFile::FTP

### Attributes

current_resource[R]
new_resource[R]
uri[R]

### Public Class Methods

new(uri, new_resource, current_resource) click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 34
    def initialize(uri, new_resource, current_resource)
      @uri = uri
      @new_resource = new_resource
      @current_resource = current_resource
      validate_typecode!
      validate_path!
    end

### Public Instance Methods

directories() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 74
    def directories
      parse_path if @directories.nil?
      @directories
    end

fetch() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 85
    def fetch
      with_connection do
        get
      end
    end

filename() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 79
    def filename
      parse_path if @filename.nil?
      @filename
    end

ftp() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 91
    def ftp
      @ftp ||= Net::FTP.new
    end

hostname() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 42
    def hostname
      @uri.host
    end

pass() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 66
    def pass
      if uri.userinfo
        URI.unescape(uri.password)
      else
        nil
      end
    end

port() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 46
    def port
      @uri.port
    end

typecode() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 54
    def typecode
      uri.typecode
    end

use_passive_mode?() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 50
    def use_passive_mode?
      ! new_resource.ftp_active_mode
    end

user() click to toggle source

    # File lib/chef/provider/remote_file/ftp.rb, line 58
    def user
      if uri.userinfo
        URI.unescape(uri.user)
      else
        'anonymous'
      end
    end